[Javalist] Spring kerdesek

zamek zamek at vili.pmmf.hu
2012. Jún. 4., H, 19:50:27 CEST


06/04/2012 07:15 PM keltezéssel, Böszörményi Péter írta:
> Meg lehetne tekinteni, hogy pontosan hogyan nez ki az xml, mik, es 
> hogyan lettek annotalva, milyen csomagokban vannak az osztalyok?
>
Persze, csak a relevans reszeket masoltam ki, hogy minel rovidebb 
legyen. A DeviceServiceImpl mukodik, a kliens hivasait tudja fogadni.

applicationContext.xml
======================================================
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xmlns:aop="http://www.springframework.org/schema/aop"
     xmlns:context="http://www.springframework.org/schema/context" 
xmlns:tx="http://www.springframework.org/schema/tx"
     xsi:schemaLocation="http://www.springframework.org/schema/beans
             
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
             http://www.springframework.org/schema/context
            
http://www.springframework.org/schema/context/spring-context-2.5.xsd">

<context:component-scan base-package="com.zamek.monitor.gwt.server"/>

<bean id="getDeviceData" 
class="com.zamek.monitor.gwt.server.device.communication.DeviceServiceImpl"/>


</beans>
======================================================

web.xml:
======================================================
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
               http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
          version="2.5"
          xmlns="http://java.sun.com/xml/ns/javaee">

<!-- Servlets -->
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/applicationContext.xml</param-value>
</context-param>

<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>

<servlet>
<servlet-name>springGwtRemoteServiceServlet</servlet-name>
<servlet-class>org.spring4gwt.server.SpringGwtRemoteServiceServlet</servlet-class>
</servlet>


<servlet-mapping>
<servlet-name>springGwtRemoteServiceServlet</servlet-name>
<url-pattern>koszovo/deviceServices/*</url-pattern>
</servlet-mapping>

<!-- Default page to serve -->
<welcome-file-list>
<welcome-file>Koszovo.html</welcome-file>
</welcome-file-list>

</web-app>
======================================================

PollingService.java
======================================================
package com.zamek.monitor.gwt.server;

import javax.annotation.PostConstruct;

import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

@Component
@Scope("singleton")
public class PollingService {

}
======================================================

DeviceServiceImpl.java
======================================================
package com.zamek.monitor.gwt.server.device.communication;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.google.gwt.user.server.rpc.RemoteServiceServlet;
import com.zamek.monitor.gwt.client.device.communication.DeviceService;
import com.zamek.monitor.gwt.server.PollingService;

@Service("getDeviceData")
public class DeviceServiceImpl extends RemoteServiceServlet implements
         DeviceService {

     @Autowired
     PollingService pollingService;

     @Override
     public Response<Map<String, Pojo>> getDeviceData() {
     }
}
======================================================

-- 
  thx,
----------------------------------
Zoltan Zidarics programmer
PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary
E-Mail: zamek at vili.pmmf.hu
----------------------------------
       



További információk a(z) Javalist levelezőlistáról