struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Laurie Harper <lau...@holoweb.net>
Subject Re: [s1] action paths not resolving correctly
Date Fri, 03 Aug 2007 22:50:33 GMT
I can't tell you anything definitive, since you didn't include all your 
relevant code. I would suggest starting by simplifying things as much as 
possible. Take out all your Javascript and strip the page down to just a 
form with a couple of submit buttons dispatching to different methods.

Once you get that working, start adding functionality back in one piece 
at a time until you find out what's broken. Fix, and continue.

L.

robinbajaj wrote:
> Hi All, 
> I have done this before with success, don't know where am I missing some bit
> this time. 
> 
> I have a dispatchAction with the following mapping.
>   <action
>       input="page.addNewPatient"
>       name="navigatePatientForm"
>       parameter="do"
>       path="/navigatePatient"
>       scope="request"
>       type="com.bcdrg.struts.action.NavigatePatientAction"
>       validate="true">
>       <forward name="last" path="page.addNewPatient" />
>       <forward name="previous" path="page.addNewPatient" />
>       <forward name="first" path="page.addNewPatient" />
>       <forward name="next" path="page.addNewPatient" />
>     </action>
> 
> when I call this dispatch action from a link
> 
> navigatePatient.do?do=getFirstPatient 
> it works fine, the url requested when i click on this link is 
> http://localhost:<port>/<context-path>/navigatePatient.do?do=getFirstPatient
> 
> however, when I call the same dispatch action from a regular button, like
> shown below:
> 
> <input type="button" id="FirstButton" name="First" value="First"					
> onclick='setup("getFirstPatient");defaultsetup();document.forms["navigatePatientForm"].submit();'></input>
> 
> where setup and defaultsetup are two javascript functions that only setup
> some parameters.
> But the problem is the url being requested in the browser in this case is :
> 
> http://localhost:<port>/navigatePatient?do=getFirstPatient
> 
> please note that the <context-path> is missing here, which is why i get the
> http 404 error message.
> 
> I don't understand why is the <context-path> missing in the second url
> request. 
> 
> here's my form tag for this form..which seems to be fine too 
> <form   name="navigatePatientForm" action="/navigatePatient.do"
> onsubmit="return OK();">
> 
> any helpful pointers will be much appreciated, 
> thanks,
> robin


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


Mime
View raw message