开发者

GWT + GAE Servlet URL and Servlet Mapping

开发者 https://www.devze.com 2023-01-07 13:02 出处:网络
http://127.0.0.1:8888/socialnetwork/contactsService That\'s the current URL for one of my servlets. My question is, how do I change it?

http://127.0.0.1:8888/socialnetwork/contactsService

That's the current URL for one of my servlets. My question is, how do I change it?

In my web.xml file, altering

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

to

  <servlet-mapping>
    <servlet-name>contactsServiceServlet</servlet-name>
    <url-patte开发者_JAVA百科rn>/a/contactsService</url-pattern>
  </servlet-mapping>

Makes absolutely NO difference to the URL it requests when I make an RPC-call to the servlet.


Once you have done the above you need to change where you invoke (Which is described in the Annotation below) as in...

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

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

0

精彩评论

暂无评论...
验证码 换一张
取 消