You are correct.  I know this from looking at the Struts ActionServlet
source code that it is Struts looking for the 1 URL mapping.  How else
could Struts know to add the .do at the end (or /do/ at the beginning)
of every request? 

It parses the URL mapping in the web.xml and knows that is what needs
to be appended.  If there were multiple mappings I think it just takes
the last one in the first or last one specified (can't remember off hand).

If you wanted you could the URL mapping for "*.cool" or something and
you will see Struts append that to your path.  That way people would
not know you are using Struts (maybe to fake out hackers).

Glad to here it is working.



-----Original Message-----
From: Travis Stevens [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, August 06, 2003 6:04 PM
To: Struts Users Mailing List
Subject: Re: modules, somethings missing

I cna't say that I really understand why my way didn't work.  I really 
don't see a problem with having multiple
mappings to an ActionServlet, at least on the tomcat side of things. 
 Now that I think about it,  struts accesses
the web.xml file for some configuration information, maybe struts itself 
only looks for one action mapping when it
does its internal configuration.

Anyhow, I changed the mapping to *.do and everything works great, thanks 
Shane!

-Trav

Bailey, Shane C. wrote:

>
>I believe the problem is that you can only have 1 URL mapping to the Struts
>Servlet.
>
>All you have to have is your first servlet-mapping.  Struts will then take
>care of everything automatically from then on out.  The thing you will have
>to keep in mind is that if you are in the "main" module to access you link
>to module actions by doing <html:link action="/public/someAction"> and
><html:link action="/private/someAction">  or if you want to go to an action
>with the same name in the "main" module you just do <html:link
>action="someAction">
>
>One you have linked to the desired action and JSPs served up by those
>modules will then be accessed like such <html:link action="someAction"> but
>Struts will automatically figure you are in a JSP served by, say, private
so
>it makes the URL "whatever.com/nmmr/private/someAction".
>
>When you are in say the public module (meaning in a JSP which was served up
>by an action within that module) and you want to get to a private modules
>action then you do something like this:
>
>public module struts config:
><global-forward>
><forward name="privateHome" contextRelative="true"
>path="/private/privateHomeAction"/>
></global-forward>
>
>then inside a public module JSP you would link to the private area by doing
><html:link forward="privateHome">Private Home</html:link>
>
>
>To be honest with you I use the ".do" instead of "/do/*" (meaning like your
>/nmmr/ prefix) so that part is kinda sketchy with me as to when you need to
>add "/nmmr" to the front of the action link etc.
>
>But you should get the idea I hope.
>
>-----Original Message-----
>From: Travis Stevens [mailto:[EMAIL PROTECTED] 
>Sent: Wednesday, August 06, 2003 5:08 PM
>To: [EMAIL PROTECTED]
>Subject: modules, somethings missing
>
>I am doing something wrong with modules, and am not quite sure what.
>
>Basically, the rui requested is always being routed to default.  Here 
>are my settings:
>
>web.xml:
><servlet>
>   <servlet-name>NmmrActionServlet</servlet-name>
>   <servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
>   <init-param>
>       <param-name>config</param-name>
>       <param-value>/WEB-INF/conf/nmmr-struts-config.xml</param-value>
>   </init-param>
>   <init-param>
>       <param-name>config/public</param-name>
>       <param-value>/WEB-INF/conf/public-struts-config.xml</param-value>
>   </init-param>
>   <init-param>
>       <param-name>config/private</param-name>
>       <param-value>/WEB-INF/conf/private-struts-config.xml</param-value>
>   </init-param>
>   <load-on-startup>2</load-on-startup>
> </servlet>
>
> <servlet-mapping>
>   <servlet-name>NmmrActionServlet</servlet-name>
>   <url-pattern>/nmmr/*</url-pattern>
> </servlet-mapping>
> <servlet-mapping>
>   <servlet-name>NmmrActionServlet</servlet-name>
>   <url-pattern>/public/*</url-pattern>
> </servlet-mapping>
> <servlet-mapping>
>   <servlet-name>NmmrActionServlet</servlet-name>
>   <url-pattern>/private/*</url-pattern>
> </servlet-mapping>
>
>When I request a url of: <context>/public/someAction i get this:
>Thread-4 DEBUG util.RequestUtils - Get module name for path /private
>Thread-4 DEBUG util.RequestUtils - Module name found: default
>
>any ideas?
>
>thanks,
>-Trav
>
>
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>  
>




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to