2010-07-17 195 views
1

http://127.0.0.1:8888/socialnetwork/contactsServiceGWT + GAE Servlet URL和Servlet映射

这就是我的一个servlet的当前URL。我的问题是,我该如何改变它?

在我的web.xml文件,改变

<servlet-mapping> 
    <servlet-name>contactsServiceServlet</servlet-name> 
    <url-pattern>/socialnetwork/contactsService</url-pattern> 
    </servlet-mapping> 

<servlet-mapping> 
    <servlet-name>contactsServiceServlet</servlet-name> 
    <url-pattern>/a/contactsService</url-pattern> 
    </servlet-mapping> 

完全不会有什么区别它请求的URL,当我做一个RPC调用这个servlet。

回答

1

一旦你完成上面的你需要改变,你调用(在下面的注释说明)在...

// The RemoteServiceRelativePath annotation automatically calls setServiceEntryPoint() 
@RemoteServiceRelativePath("email") 
public interface MyEmailService extends RemoteService { 
    void emptyMyInbox(String username, String password); 
} 

http://google-web-toolkit.googlecode.com/svn/javadoc/1.6/com/google/gwt/user/client/rpc/RemoteServiceRelativePath.html

+0

就是这样,谢谢。 :) – 2010-07-18 15:19:42