struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alan Bram <ar...@cornell.edu>
Subject can I avoid *.do in my URLs?
Date Sun, 30 Nov 2003 16:54:55 GMT
Hi,

I would like to avoid having to formulate my URLs as "*.do", or even
"/do/*".  I want to have simple names like "/foo" and "/bar", names
that no single pattern could match.  The reason is that I don't want
to expose implementation details in my URLs, because an implementation
could change and then my URLs would be no good.  I care about this
because I want bookmarked URLs within my application to continue to
work.

(See http://www.w3.org/Provider/Style/URI.html, especially the section
called "We used to use a cgi script for this and now we use a binary
program.")

I had planned to accomplish this by making multiple <servlet-mapping>
entries in the web.xml file, one for each page, each one pointing to
the controller servlet.  (My application has only a small number of
pages, so this seemed feasible.)  But I just noticed the following
warning in the User's Guide (section 5.4.2 "Configure the Action
Servlet Mapping"):

    WARNING - Struts will not operate correctly if you define more
    than one <servlet-mapping> element for the controller servlet.

Eeek!

Is there some other way I can do this?  Or am I stuck?  (Is there
maybe some way a servlet Filter could do this for me?)

Thanks for listening.

Cheers,
 - arb

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Mime
View raw message