Win a copy of Murach's MySQL this week in the JDBC and Relational Databases forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How can I get correct backto page?

 
Ranch Hand
Posts: 90
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

I'm new here. I need your help with the browser back button. The sequence of the jsp pages are: page 1 -> page 2 -> page 3. On page 2, there is an 'Export to Excel' button. When user clicks on it, it goes back to the servlet and generate an Excel file and downloads it to jsp page 3. Then when user clicks on the Browser back button on page 3, it does not go back to page 2, it goes back to page 1 instead. How can I control the 'backto' page on jsp page 3, which is the excel file page? It is obviously treated as page 2.

Thanks!
Jenny
 
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
a quick hack would be to use response.sendRedirect in ur servlet to get to the JSP page so that page 3 is treated as it should be... I am assuming that the servlet forwards the request to page 3 using requestdispatcher...
 
Sheriff
Posts: 67745
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"Ganesh M",

We're pleased to have you here with us on the Ranch, but there are a few rules that need to be followed, and one is that proper names are required. Please take a look at the JavaRanch Naming Policy and adjust your display name to match it.

In particular, your display name must be a first and a last name separated by a space character, and must not be obviously fictitious.

Thanks!
bear
Forum Bartender
 
Jingh Yi
Ranch Hand
Posts: 90
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ganesh,

Thanks for your reply. I did try to use redirect and it didn't work. The erro message I got is:

Exception happened:
com.ibm.servlet.engine.webapp.WebAppErrorReport:
Please call the System Administrator.

The reason is that, we are using STRUTS framework. Every action has to return ActionForward from the executeBody() method. In order to use the redirect, I had to return null for that method and it caused this error.

Any solutions for that?

Thanks,
Jenny
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic