You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Martin Leja <Ma...@mpluss.de> on 2003/04/14 16:49:22 UTC

why start the path attribute in an action mapping with a slash '/'

hi,

its common practice to use
/do/* or
*.do

for the action servlet mapping which gives urls like
http://webserver:port/webapp/do/myaction or
http://webserver:port/webapp/myaction.do

the interesting part for an action mapping in the struts xml config file is
only "myaction" so why the leading slash?
<action path="/myaction" ...

api javadoc of the path attribute of the class
org.apache.struts.config.ActionConfig gives no explanation
Context-relative path of the submitted request, starting with a slash ("/")
character, and omitting any filename extension if extension mapping is being
used.

i do understand the necessity of a context relative path in an action
forward like
<forward name="welcome" path="/do/welcome" />

or in html or jsp pages.

--
regards, martin leja


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