My default web application is not "/sports", but rather just "localhost".  If the site was live the web app would be "http://www.mysite.com", and I would be in the "/sports" directory.  What can I do to get the behavior I am expecting?
----- Original Message -----
Sent: Monday, October 22, 2001 9:42 PM
Subject: RE: ~~ Confusion with triggering an Action ~~

/processTrivia.do is in fact "root-slash-processTrivia" - but in relation to your current context. If your webapp is named sports, then it will have to be /sports/processTrivia.do
 
How you get around this depends on your servlet container. In Tomcat 4, you could make sports the default webapp, so /processTrivia.do would go to the sports webapp. Other containers probably have a similar method. However, I don't recommend any of these, especially if you have multiple web applications.
 
Cheers,
Brett
-----Original Message-----
From: Jonathan Asbell [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, 23 October 2001 11:38 AM
To: [EMAIL PROTECTED]
Subject: ~~ Confusion with triggering an Action ~~
Importance: High

in my jsp page http://localhost/sports/trivia.jsp I have a Struts form <html:form action="/processTrivia.do">
 
Considering this, the following is true:
1) the directory I am currently in is "/sports"
2) the request I am submitting to is "/processTrivia.do"
 
When I create my mapping inside struts-config.xml <action path="/processTrivia" ........> the action is not triggered when the form submits.  This is because for some reason I have to match to the path "/sports/processTrivia".  This does not make sense to me, because I am actually submitting to "/processTrivia" inside my form, and not "/sports/processTrivia" even though I am actually in the "/sports" directory.  When I submit a form to "/processTrivia.do", I expect that it will actually submit to "root-slash-processTrivia".  Can someone clarify this.  I have mentioned this before and noone seemed to respond.  In addition, my collegues also feel this is misleading.  The result is that I have to make mapping entries for this action in each level of the directory where I want this service.

Reply via email to