I have a basic struts project i can't redirect my jsp page to another.But i did the similar example before that it was working but know it's not.
My problem is bookAdd.jsp dont redirect to the data.jsp it's redirecting to the bookAdd.do please help!Thanks
Here is my BookAddForm
when i click submit button at the jsp file it shows me the same page can't redirect to data.jsp but my browser changes bookAdd.jsp to bookAdd.do
i cant understand why it is
I couldn't understand your problem properly because I think its working the way it is supposed to. You have a struts action named bookAdd, and your bookAdd.jsp has a form which has the action as bookAdd. So the form will be submitted to bookAdd action. Then that action will forward (not redirect) to data.jsp. If you want bookAdd action to redirect to data.jsp, then you should use redirect="true" in your result i.e.
(I've not worked on struts 1.x much, but I think this will work as given here)...
No i didnt use validator.i did an example like thiss and it's working fine but its not icant understand where am i wrong i'm loosing my mind
posted 10 years ago
This is another example and its working fine i cant understand what is the difference between the other example why this signup example working but addbook not.in this example when i click the submit button at the signup.jsp the page forward to the signUpSuccess.jsp it works fine
please help me i will be really grateful
Please make sure that there isn't any exception at runtime when the action is called. Also add some logging or System.out.println statements in your action to see what exactly is going on, is your action even being called or not. Also if I remember correctly, if mapping.findForward(SUCCESS) returns null i.e. you return null from your execute method, struts doesn't process your request any further (although that would result in a blank page as output as opposed to the input page). Check if it is returning a valid ActionForward object...