GWT + GAE Servlet URL和Servlet映射

时间:2010-07-17 15:31:47

标签: java apache google-app-engine gwt

http://127.0.0.1:8888/socialnetwork/contactsService

这是我的一个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>

当我对servlet进行RPC调用时,它对请求的URL没有任何区别。

1 个答案:

答案 0 :(得分: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

相关问题