Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Different Types of Redirect techniques that are used in Struts2

 
Ravi Kiran Va
Ranch Hand
Posts: 2234
Eclipse IDE Firefox Browser Redhat
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ,

I am new to Struts2 , meanwhile i am going through the concept of Redirect in Struts .
I got Confusion in understanding these two Redirect types

1.Redirect After Post

2.Redirect Action Result:

As per the definations these are for :

Redirect After Post: This is a common pattern in web application. In which an action is redirected to another action.

Redirect Action Result: The ActionMapper provided by the ActionMapperFactory is used to redirect the browser to a URL that invokes the specified action.

Can anybody please explain this .when to use the First type and Second Type .
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
They're two completely different things.

You can use redirect-after-post to avoid a refresh trying to run the same post action again.

A "redirectAction" is a Struts 2-specific result type.
 
Ravi Kiran Va
Ranch Hand
Posts: 2234
Eclipse IDE Firefox Browser Redhat
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can use redirect-after-post to avoid a refresh trying to run the same post action again.


That was a good explanation , means i think it is a PRG Pattern
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic