Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

When is 'mapping.getInputForward()' used?

I would like to know what mapping.getInputForward() does in Struts. The API says that it creates and returns an ActionForward that corresponds to the input of the Action.

But I don't understand what this means. Could anybody explain to me more clearly? Can I use this method to return to the previous page? And if I can, how do I do this?

like image 469
Ifozest Avatar asked Mar 30 '26 22:03

Ifozest


1 Answers

getInputForward() does precisely what it says it does: it returns an ActionForward corresponding to the action's input attribute value.

You probably wouldn't want to use it as a general "return to previous page", because that wouldn't make any sense. It's commonly used when calling validation "by hand" and there's a validation error; the input value would be the form page. In those cases it's similar to "return to previous page", but different, because it's generally a forward (not a redirect) to the form JSP.

That said, it's just a normal findForward but for the action's input page.

like image 64
Dave Newton Avatar answered Apr 02 '26 20:04

Dave Newton



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!