This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes Struts and the fly likes mapping.getInputForward() Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "mapping.getInputForward()" Watch "mapping.getInputForward()" New topic
Author

mapping.getInputForward()

Saritha Penumudi
Ranch Hand

Joined: Aug 18, 2003
Posts: 147
Hi,

I have a menu from where I will click on a hyperlink which takes me to listing page. In my listing page I have checkbox before each record and delete button in the bottom of the listing.

Now, when user selects records from the listing and clicks delete button, I have to go and delete those records from the database.

on error, I have to show same listing with error message on top when I say return (mapping.getInputForward()); it is taking me to menu page. How can i get back to my listing page without getting whole data from the database again?

or it is compulsory to get whole records from database in both success and error conditions.

I am not sure why return (mapping.getInputForward()); is taking me to menu page. How can I get back to my listing page

Please help me out.
Thank you
Saritha
Marc Peabody
pie sneak
Sheriff

Joined: Feb 05, 2003
Posts: 4727

What does the ActionMapping look like?


A good workman is known by his tools.
Saritha Penumudi
Ranch Hand

Joined: Aug 18, 2003
Posts: 147
I am sorry I did not understand your quetion.

I am using DispatchAction
This is the method signature


mapping is the method parameter of delete method.

This is the configuration in struts-config.xml file


I always thought that mapping.getInputForward() should hold page url from which I am making the request.

I would really appreciate if you could help me in solving my problem

Thank you
Saritha
[ September 22, 2004: Message edited by: Saritha ventrapragada ]
Sheldon Fernandes
Ranch Hand

Joined: Aug 18, 2004
Posts: 157
getInputForward() returns an ActionForward that corresponds to the "input" property of the Action.

In your case this is 'index.jsp'
<action input="/index.jsp" path="/messages" scope="request" ...

If you want to forward to "ListMessages.jsp" use:
- mapping.findForward("continueList")
OR
- change your action mapping to
<action input="/ListMessages.jsp" path="/messages" scope="request" ...
and continue using getInputForward()

Sheldon Fernandes
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: mapping.getInputForward()
 
Similar Threads
Need Help and Suggestion
Problems with Struts
Hold Form Data
how to reload a jsp page ?
Listing and Action Form Validation