Results 1 to 5 of 5
  1. #1
    jason.3dmagic is offline Member
    Join Date
    Oct 2009
    Posts
    30
    Rep Power
    0

    Question Scriptlet Not Running on JSP after coming back from back button of browser

    Hi,
    I am facing problem when i come back from one page to previous page.
    Scenario is:
    There is a scriptlet on firstPage.jsp at start which runs everytime page gets load. When I goto secondPage.jsp from firstPage.jsp and click on 'back' button of browser I come back to firstPage.jsp. But the scriptlet on that page doesn't work at all.

  2. #2
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,856
    Rep Power
    19

    Default

    By scriptlet do you mean Javascript?

  3. #3
    jason.3dmagic is offline Member
    Join Date
    Oct 2009
    Posts
    30
    Rep Power
    0

    Default

    Following code
    <%System.out.println("In firstpage.jsp")%>

  4. #4
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,856
    Rep Power
    19

    Default

    Which isn't surprising.
    The back button does not automatically result in a call to the server.
    It often simply retrieves the page stored on the client.

    Using something like Firebug (for Firefox) you'd see that no call to the server is made.

  5. #5
    jason.3dmagic is offline Member
    Join Date
    Oct 2009
    Posts
    30
    Rep Power
    0

    Default

    It makes sense and I checked no call was made to server. I solved it by using JQuery scripts and now I am getting my values back.
    Thanks for the reply.

Similar Threads

  1. Browser's back button refresh the pages
    By hasansheikh18 in forum JavaServer Pages (JSP) and JSTL
    Replies: 3
    Last Post: 05-31-2011, 04:44 PM
  2. how to maintain the state in jsp even moving from that page and coming back
    By sabarishkl in forum JavaServer Pages (JSP) and JSTL
    Replies: 1
    Last Post: 12-10-2010, 12:56 PM
  3. problem with back button of the browser.
    By shivakumari in forum Java Servlet
    Replies: 2
    Last Post: 03-25-2009, 07:41 AM
  4. Saved files are coming back as read-only
    By Manoeuvre in forum Eclipse
    Replies: 0
    Last Post: 11-21-2008, 05:18 PM
  5. Running application in back
    By fernando in forum Advanced Java
    Replies: 1
    Last Post: 08-01-2007, 12:25 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •