You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by Tim Adler <me...@s-h-i-n-y.com> on 2005/05/15 00:54:46 UTC
How does Struts resolve wildcard mappings?
Hey everybody!
I'm currently working on a Web-application in which I have to do a
custom handler-mapping resolvement. I have my Servlet mapped to a
*.extension wildcard. The mappings that I would like to resolve to
handlers, should look like "/page", which themselves are executed on
"/page.extension"-requests.
I cannot seem to manage to get that path within the serlvet-mapping,
with the extenstion stripped of. So basically the path within the
servlet-mapping. I know that Struts does this with the *.do mappings.
Like in the struts-config there is a "/Welcome", which I executed on a
"/Welcome.do"-request. This is what I would like to achieve on my custom
handler resolvement too. Can somebody point me directions, how this is
achieved?
Thank you, Tim
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org
Re: How does Struts resolve wildcard mappings?
Posted by Joe Germuska <Jo...@Germuska.com>.
Tim:
If I read you correctly, you're asking "how does Struts recognize
action paths independent of their servlet mappings?" and not asking
anything about Struts' support for wildcards in the path mappings
themselves (see
http://struts.apache.org/userGuide/building_controller.html#action_mapping_wildcards)
Quite simply, Struts parses the web.xml file as part of the
ActionServlet's initialization. (See initServlet in
http://cvs.apache.org/viewcvs.cgi/struts/core/trunk/src/share/org/apache/struts/action/ActionServlet.java?root=Apache-SVN&view=markup)
Hope that helps.
Joe
At 12:54 AM +0200 5/15/05, Tim Adler wrote:
>Hey everybody!
>
>I'm currently working on a Web-application in which I have to do a
>custom handler-mapping resolvement. I have my Servlet mapped to a
>*.extension wildcard. The mappings that I would like to resolve to
>handlers, should look like "/page", which themselves are executed on
>"/page.extension"-requests.
>
>I cannot seem to manage to get that path within the serlvet-mapping,
>with the extenstion stripped of. So basically the path within the
>servlet-mapping. I know that Struts does this with the *.do
>mappings. Like in the struts-config there is a "/Welcome", which I
>executed on a "/Welcome.do"-request. This is what I would like to
>achieve on my custom handler resolvement too. Can somebody point me
>directions, how this is achieved?
>
>Thank you, Tim
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
>For additional commands, e-mail: dev-help@struts.apache.org
--
Joe Germuska
Joe@Germuska.com
http://blog.germuska.com
"Narrow minds are weapons made for mass destruction" -The Ex
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org