• Post Reply Bookmark Topic Watch Topic
  • New Topic

Redirect  RSS feed

 
Nicola Guy
Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a basic application which works in the following way.
1. The welcome page checks the URL for the Action parameter and displays the screen accordingly,
2.The user then has the choice to edit data and save the changes.
3. On choosing to save the page the user is directed to the welcome page, the action parameter read and the servlet which accesses the database and saves the changes is called.

My problem is, at the end of the servlet, I want to navigate the user back to the welcome page again. This is to overcome difficulties with pathnames.

I have tried using the RequestDispatcher but it sends the request as well, including the Action parameter, which enters the page into an endless loop.
And also sendRedirect which just displays a blank page and I can't find any errors to explain it.

Any insight or ideas would be gratfully received.

Thanks
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66153
146
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's a really odd pattern of shifting around in your resources. Sounds like you are using a display page as a front controller. This is bound to get you into binds like this.

I'd highly recommend becoming familiar with the standard accepted patterns for web application flow of control. Perhaps this article might be a good place to start.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!