This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
I am having problem with struts dispatch action.
In my form action, iam concatenating action path with additional parameter and using method as GET..
when i submit, the additional parameter is not going and my form parameters are going..
But using POST, I am able to send the additional parameter also..
This is the form iam using. I am concatenating a string with the action attribute path,i.e.DispatchAction Method.
<form action="setValues.do?method=execute" method="get">
First Name:<input type="text" name="t1" value=""/>
Last Name:<input type="text" name="t1" value=""/>
Middle Name:<input type="submit" value="submit"/>
Hi Vipul, no tools to set it up
I am still sure about dispatch action, that it doesnt do something like that.
But after looking couple of times into the code posted, i realized that you are not using html:form. Just let us know if the result changes after using struts-html tag. I am expecting the same result - it should fail If i remember properly, if the html form submission is of type GET, then it would take the 'action' mentioned and append '?' followed by appending the form data [anybody please correct me if I am wrong]
So the above submission would be something like 'doWork.do?method=doWork?&first=something'. Now if we give something like this to struts, I do not know how it would behave - we have to look into the implementation.
Since you already have a debug environment could you please check and see [by retrieving HttpServletRequest.getRequestURL()] if my understanding is correct/wrong.
Thank you in advance
Joined: Oct 14, 2010
Shankar Tanikella wrote:
If i remember properly, if the html form submission is of type GET, then it would take the 'action' mentioned and append '?' followed by appending the form data [anybody please correct me if I am wrong]
So the above submission would be something like 'doWork.do?method=doWork?&first=something'
You are right shankar.
More over we no need to check the reqeust object. we can see the url in the browser address bar. As the request is a GET request you can see the whole query parameter in the address bar. there you won't find method=doWork parameter. Remaining form parameters will be available.