url-pattern for shared servlets

Asked by Scott Ritchie

Is there a way to set up Servlet mappings to work on multiple pages? To explain the question in more depth:

When setting up Services to talk between the client and server in GWT, information about them needs to be added to the web.xml file along the lines of:

  <servlet>
    <servlet-name>ServletName</servlet-name>
    <servlet-class>package.Class</servlet-class>
  </servlet>

  <servlet-mapping>
    <servlet-name>ServletName</servlet-name>
    <url-pattern>/[module rename-to]/[service relative path]</url-pattern>
  </servlet-mapping>

Where
[module rename-to] is a field in the xml file corresponding to the class the entry point for the page is
[service relative path] is defined in an annotation in the Service class itself.

So for example:
   The Mugle page has the <module rename-to="mugle">
   and the login service has the relative path of "login"
   so in web.xml we have:
   <url-pattern>/mugle/login</url-pattern>

However this login service needs to be used on every page. However not knowing enough about GWT or servlet mappings im not sure how to go about doing this, and was wondering if you had any advice, having worked used GWT before?

Question information

Language:
English Edit question
Status:
Solved
For:
MUGLE Edit question
Assignee:
Matt Giuca Edit question
Solved by:
Matt Giuca
Solved:
Last query:
Last reply:
Revision history for this message
Best Matt Giuca (mgiuca) said :
#1

This was explained in an email: https://lists.launchpad.net/mugle-dev/msg00085.html
GWT applications should only have one page (or at least, that is the "right" way to do it). This blog post explains more:
http://alensiljak.blogspot.com/2009/04/gwt-concepts-no-multiple-pages.html

I have places select quotes from that blog post in the email above.

Revision history for this message
Scott Ritchie (sritchie) said :
#2

Thanks Matt Giuca, that solved my question.