Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

redirect=true in config does not work

 
Joshua Elkino
Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've added redirect=true in something like <forward name="success" path="/newsletterok.do" redirect="true"/>, yet the page does not redirect. When i use then this works as intended. Why is that?
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What behavior are you seeing?
 
Joshua Elkino
Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Using the config file redirect, the user gets sent to the jsp yet the URL is pointing to the servlet. If i refresh i get a POST once again.
If i use the new ActionForward code, it works as intended. I see the new URL where i'm forwarding to as well as refreshing without posting data back to the server.
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Gets sent to what JSP?
 
Joshua Elkino
Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
using the above example... the newsletterok.jsp page.
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
...

What is the servlet *supposed* to display? I mean, if you redirect to a URL that's the URL that's going to be in the browser.
 
Joshua Elkino
Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
They go to the same place, but the problem is that using the config method it only forwards even if i set the redirect=true.
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How do you know?
 
Joshua Elkino
Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
well the the difference is in the URL and on the refresh... If i do a refresh on a page that got "redirected" from the struts config, it tries to post back to the servlet... thus giving me the impression the page got forwarded rather than redirected. Am i wrong?
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You wrote: Using the config file redirect, the user gets sent to the jsp yet the URL is pointing to the servlet. If i refresh i get a POST once again.
If the URL is of the servlet then it got redirected.

Not sure about the refresh thing, but I just find it *extremely* unlikely that redirect="true" doesn't work, as it's pretty much been working for 7-8 years.
 
Joshua Elkino
Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok so better question. How can i tell the difference between a forward or redirect from the client side? I too find it odd, but maybe there is something that is overwritting that configuration file setting
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's also unlikely. Use something like Firebug or a local proxy.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic