File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "mapping.getInputForward()" Watch "mapping.getInputForward()" New topic


Saritha Penumudi
Ranch Hand

Joined: Aug 18, 2003
Posts: 148

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
Marc Peabody
pie sneak

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: 148
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
[ 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")
- 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:
subject: mapping.getInputForward()
It's not a secret anymore!