How to go to previous page in JSP

I have designed a page with database in JSP,
I am having 3 textboxes on the form where user can enter ID,name and address.
Suppose user enters values such as ID="xyz" name="atm" address="ksh". Then it should prompt "Enter numerical values" and it should remain on the same page. I tried this with the "response.sendRedirect(url)" method ,Its working but the the textboxes are becoming empty.
I want such that the textboxes should not be empty ,they should contain the previously entered values.
Means I want to call "back" page or previously visited page.
It can be done using JavaScript but I want to do it in JSP.
So plzz help me
How to call back page in JSP

1. U need to preopulate the data in ur jsp using form beans or from request, session....
or.
2. Use javascript to do the validation
Either of them will solve ur problem

Similar Messages

  • Problem in how to stop displaying previous page after Logout

    <%
    // I invalidate all my session when i logout and comes on Login.jsp page but if i go back still it open
    previous pages
    How i can stop these
    i am adding these line in avery jsp page
    1)
    response.setHeader("pragma","no-cache");
    response.setHeader("Cache-Control","no-cache");
    response.setHeader("Cache-Control","no-store");
    response.addDateHeader("Expires", 0);
    response.setDateHeader("max-age", 0);
    response.setIntHeader ("Expires", -1); //prevents caching at the proxy server
    response.addHeader("cache-Control", "private"); //IE5.x only;
    %>
    2) and in Logout.jsp
    response.sendRedirect("Login.jsp");
    session.invalidate();
    session.removeAttribute("viv");
    still on reaching login page i can move to previous page by clicking back button

    Hi sreenathreddy.
    I am doing exactly what you are talking about.
    On load of each jsp page, I check to see if I am still in session. If i am not, i redirect the user to the login page saying his session has expired.. This works perfectly fine in the sense that after I log out, if I directly type in the url or click on any other link from history, it redirects you to the login page.
    But my problem sitll remained that after logging out, if i clicked the back button, it would still take me to the previous page even though none of the links on that page would work.
    So i added all the response.SetHeaders that are mentioned in this discussion.
    Now the scenario is such that, when i press the back button after logging out, it tells me that the page has expired and i have to resubmit the form.
    There are two problems with this
    1. at this point , if i refresh my page, it still gets the details from the server and even though i am invalidating the session and all the user details, and checking to see if the session is invalidated,it still somehow manages to get all the details(i dont know where that info is stored)
    2. even if the person has not logged out. ie in the middle of a perfectly valid session and clicks on the back button, he is warned that the session has expired.
    please do reply
    thanks
    ritesh

  • How to go to previous page in task flow using 'BACK' button in the browser?

    Hi...
    I have created system using ADF application that can detect 'BACK' button in the browser(e.g. firefox and google chrome).Everytime i click the 'BACK' button in the browser,it will prompt out message that ask user whether want to 'stay in the current page' or 'leave the page'. Once i click 'leave the page' it will take me to the login page.
    Is there any possibility for go back to previous page in task flow when user click on browser's back button? By the way, the task flow is in the page fragment.
    can anyone tell me how to do it?Need this step urgently..
    Thanks in advance.
    Edited by: 942376 on Jun 22, 2012 11:03 PM
    Edited by: 942376 on Jun 22, 2012 11:07 PM

    Can you send that code to have a look ? Share it on some site

  • How to include an ASP page from JSP?

    I had a working ASP page to be repeated on each page of the web site as an navigation bar updated from a single SiteMap.xml. Anyone knew how to include the ASP page from the JSP app?
    Thanks

    You might achieve your desired result by calling the ASP page from your JSP controller (server side) using the standard JAVA HTTP classes you could then process the resulting XML. I suggest you look at the JAVA API for more information in particular the JAVA.NET package and the HTTPUrlConnection class...
    http://java.sun.com/j2se/1.4.2/docs/api/java/net/HttpURLConnection.html
    Hope this helps,
    BRgds,
    Simon

  • How to get to previous page on iPad?

    Can anyone tell me how to reurn to the previous page on the iPad 2?  If I use the back arrow, it usually takes me back to a previously viewed website. Also, is there any way to store favorite websites? Thanks.

    The Previous page is kind of vague, and may depend on how the website is made.
    The Back arrow in Safari will take you to the last visited address.  Wether that's your last page is not certain.
    Some websites do not have physical page changes so nothing to go back to. They change the content of the same page.
    To store favorites or Bookmarks, tap on the twisted arrow icon that's on the left side of the address bar. Then tap on Bookmark.
    When you want to access the favorites, tap on the little book icon to the left of the twisted arrow, and tap on the bookmarks tab if its not selected and then tap on the link you want to open.

  • How to return to previous pages without going back one at a time

    I do a lot of work on ebay and have to return to previous searches or pages and I used to be able to have a button that would show all the previous pages and I could go down the list and click on it. The only option I have now is to go into history and it only shows recent pages and it's for ALL the tabs open. I want just the tab for ebay previous pages. For instance if I go to ebay sold and relist an item it takes me through the prompts and if I want to return to ebay sold I want a drop down showing that option. I no longer see one. This normally wouldn't be too much of an issue except that the ebay sold is on ebay.com and relist is on ebay.ca so I like to go back to the previous page instead of going to bookmarks, ebay, my ebay, sold etc to get there again. Too much work!!! thanks, Iris

    Try this script that Yvan Koenig has written. Help text is both in english and french
    https://www.box.com/s/00qnssoyeq2xvc22ra4k/1/129506087/5871856782/1

  • How to go to previous pages using AT LINE-SELECTION

    Using AT LINE-SELECTION we can move on to next page up to 20 pages.
    Is it possible to go navigate to the previous pages?
    Letu2019s say, now I am in 15th page. I have to go to 5th page from 15th.
    Any comments appreciated.

    Hi,
    set your list index = 5 when u reach list 15.
    case:
    when Sy-lsind = 15.
       sy-lsind = 5.
    thanks,

  • How to go to previous page in windows phone 8 when back button is pressed

    I have a home page or landing page in my windows phone c# based app where user enters login details and upon successful login user is redirected to page2 . Here the user will see a list box with few items . Upon selecting an item from this list box a new
    page called "Threadx" opens.(where x is the each page that opens upon clicking the x item in the list box)
    While user is on this Thread page "Threadx" he may receive the toast notifications and the thread gets updated with new replies or answers on that thread.
    But When user clicks on back button the "ThreadX" page doesn't get closed and instead it goes to its previous state where it has less number of messages , and so on until the app gets closed.
    protected override void OnNavigatedTo(NavigationEventArgs e)
    base.OnNavigatedTo(e);
    if (e.NavigationMode == NavigationMode.Back)
    return;
    I would like to know if this "Threadx" page can be closed upon clicking back button without affecting other "Threadx+1","Threadx+2"..."Threadx+n" pages.
    Any help would be really appreciated.

    you don't need to navigate explicitly. Just clear the back stack till your specific page and say goback. below is the  code you can use.
     protected override void OnBackKeyPress(System.ComponentModel.CancelEventArgs e)
                        e.cancel=true;
                    RemoveBackStackTillSpecificPage("page2.xaml");
                    GoBack();
    public static void RemoveBackStackTillSpecificPage(string pageName)
    PhoneApplicationFrame frame = Application.Current.RootVisual as PhoneApplicationFrame;
    var previousPage = frame.BackStack.FirstOrDefault();
    if (previousPage != null && previousPage.Source != null)
                    while (!previousPage.Source.ToString().Contains(pageName))
                        frame.RemoveBackEntry();
                        previousPage = frame.BackStack.FirstOrDefault();
            public static void GoBack()
                PhoneApplicationFrame frame = Application.Current.RootVisual as PhoneApplicationFrame;
                LastPageUri = frame.Source;
                frame.GoBack();
    Please mark this as answer if this answers your question
    Purushothama V S

  • How to get a dynamic pages using jsp?

    actually using jsp we create static pages.
    My question is whether it is possible to create dynamic pages. ie the page should reflect changes without refreshing or reloading. for example we have date timings frequently updated without refreshing

    Read Beginning JSP from WROX Press. It is a good book for developing dynamic JSP using all latest technologies.

  • How to return to previous page based on record number?

    Not sure if the subject of this is how i shoudl have worded
    it... but here
    is what i am looking for...
    which ever is the easiest to accomplish....
    currently when someone completes a form they are taken back
    to there main
    pool of records... in some cases there are over 100 records
    per location and
    the page is setup to display 20 records per page..
    So one case may be that i found the record i need to view and
    edit on page 3
    of 5. I click the record.. edit and submit.. i receive my
    confirmation that
    the changes were made and then redirected back to the records
    list. So if i
    want to see what the record looks like, i have to get to page
    3 again to
    view the record as it now displays on the list.
    So my question is how can i return the person back to the
    same page they
    found that record OR is there any easy way to display only
    the modified
    record first in the list and once they navigate away from
    that page the list
    is back in numerical order?
    Examples...
    Page 1 Page 2 Page 3
    2 6 10
    3 7 11
    4 8 12
    5 9 13
    I click on record # 11 to modify, currently after the
    modification im taken
    back to the main page#1 so would currently have to navigate
    to page 3 to
    view how it looks in the list.
    So what can i do to either take me back to page 3 on
    completion of the
    edit.... Or display the modified record at the top of the
    list on page 1
    while they are on that page.. but once that page is refreshed
    then its back
    to the way above in the example.....
    Page 1 Page 2 Page 3
    11
    2 6 10
    3 7 11
    4 8 12
    5 9 13

    Didnt realize my signature was turned off...
    but below are my apps and language
    ASP, SQL2005, DW8 VBScript
    "Daniel" <[email protected]> wrote in message
    news:fahqbk$dnj$[email protected]..
    > Not sure if the subject of this is how i shoudl have
    worded it... but here
    > is what i am looking for...
    >
    > which ever is the easiest to accomplish....
    >
    > currently when someone completes a form they are taken
    back to there main
    > pool of records... in some cases there are over 100
    records per location
    > and the page is setup to display 20 records per page..
    >
    > So one case may be that i found the record i need to
    view and edit on page
    > 3 of 5. I click the record.. edit and submit.. i receive
    my confirmation
    > that the changes were made and then redirected back to
    the records list.
    > So if i want to see what the record looks like, i have
    to get to page 3
    > again to view the record as it now displays on the list.
    >
    > So my question is how can i return the person back to
    the same page they
    > found that record OR is there any easy way to display
    only the modified
    > record first in the list and once they navigate away
    from that page the
    > list is back in numerical order?
    >
    > Examples...
    >
    > Page 1 Page 2 Page 3
    >
    > 2 6 10
    > 3 7 11
    > 4 8 12
    > 5 9 13
    >
    > I click on record # 11 to modify, currently after the
    modification im
    > taken back to the main page#1 so would currently have to
    navigate to page
    > 3 to view how it looks in the list.
    >
    > So what can i do to either take me back to page 3 on
    completion of the
    > edit.... Or display the modified record at the top of
    the list on page 1
    > while they are on that page.. but once that page is
    refreshed then its
    > back to the way above in the example.....
    >
    > Page 1 Page 2 Page 3
    >
    > 11
    > 2 6 10
    > 3 7 11
    > 4 8 12
    > 5 9 13
    >

  • How to return to previous page

    I have a form A. Once filled out, they should subnmit to
    insert the data into a table. However, they can fill out the form
    and not submt. There is a icon in the upper left that will take
    them to another form B (comments) to fill out. If they submit form
    B and insert form B data into a table, how do I return them to form
    A, which is filled out but not submitted yet ?

    Hi Olivia and I appologize for calling you "crazy house"
    instead of "crazy horse" :)
    In my opinion, you have to make it all one form or you will
    loose your form variables when one is chosen versus the other. I
    don't think there is any other solution. You can have multiple
    buttons so it appears to be 2 forms to the user - but you
    physically have to make it one single form. Your action program can
    detect which button was hit and know which "virtual form: to
    process. It can also save all the variables as URL variables or
    session variable.
    Hope this helps.
    hefterr

  • How to get , how many users visited my page in jsp

    hi all,
    Can u help me on this.
    Advance thanx

    you may want to add a routine to flash the value each day to a file just incase you have any service interruptions...on startup the jsp could initialize itself with the value from that file.

  • How to forward a page in jsp?

    hi,
    I have 5 button, Now i want to forward page when a user will click a button? my following code is for the action of a main form,,,,,,
    <%
    String action=request.getParameter("submit");
         if(action.equalsIgnoreCase("For dynamic form set")){
              RequestDispatcher rd =request.getRequestDispatcher("FrameSet.jsp");
              rd.forward(request,response);
         else if(action.equalsIgnoreCase("Data Read")){
              RequestDispatcher rd =request.getRequestDispatcher("DataReadForm.jsp");
              rd.forward(request,response);
         else if(action.equalsIgnoreCase("New Registration")){
              RequestDispatcher rd =request.getRequestDispatcher("NewRegistration.jsp");
              rd.forward(request,response);
         else if(action.equalsIgnoreCase("Continue from previous position")){
              RequestDispatcher rd =request.getRequestDispatcher("FrameSet.jsp.jsp");
    //          RequestDispatcher rd =request.getRequestDispatcher("ContinuesForm.jsp");
              rd.forward(request,response);
         else if(action.equalsIgnoreCase("Frame Search")){
              RequestDispatcher rd =request.getRequestDispatcher("FrameSearch.jsp");
              rd.forward(request,response);
    %>my problem is that ...when i click "For dynamic form set" button then it go FrameSet page, But when i click another button then my code is not working. What's the problem of my code? how i will forward a page in jsp . Is there anyone who can help me about this? Please help me.
    With regards
    Bina

    you should get a value from the requested page to decide where to forward the next page.. example of forwarding a page:
    <jsp:forward page="/page.jsp">

  • Redirect a page with JSP

    Hi there,
    How do you redirect a page using JSP. For example I create a login screen and once a user click on the login button it goes to validate page and validate the userID and password. If the userID and password is correct I want to redirect to the application else redirect to a Fail login screen.
    Thanks in advance with any help.
    Nite()
    null

    Hi Slag,
    Thanks for your help, it work. Now another problem is I am trying to write a code that validate the password and it didn't check the request.getParameter. Here are the following code:
    <% if (request.getParameter("password") == null) { %>
    <jsp:forward page="LoginFailed.jsp" />
    <% } else { %>
    <%@ include file="untitled1.jsp" %>
    <%
    %>
    If I run the response page(current page) it work, it actually see it null and populate the LoginFailed.jsp page, but when I run the login page and it didn't check against the statement.
    Thanks in advance,
    Nite()
    null

  • How to remember previous page in a JSP page that's reloaded

    I have a JSP page where i want a "back" link that brings me back to the previous page. The problem is, some actions on this page will call a servlet that reloads my page, so using history.back() brings me back to the previous version of the same page.
    What is a good way to solve this in a servlet/JSP application?

    I just wrote a simple bean with a few methods that i frequently use.
    the bean is session scope, and you just call something like
    setCurrentPagePath(), and you build your link up by calling getCurrentPagePath()
    before settings the new one.

Maybe you are looking for

  • SAP Script 'space' check in IF  statement

    Hi, I want to check for space in SAP script i want to check something like /: IF &TS_ITEM-USPOS& EQ SPACE ZD ........... /: ENDIF even if the there is space in uspos field this lines under are not printing. your help is appriciated. thanks surya

  • Probook 470 G1 touchpad problem - NOT SOLVED with SP64284

    Hello, my touchpad is problematic. It registers movement but often misses a click, also hangs from time to time. I have installed SP64284 but the problem remains. Please help, Miljan (HP Probook 470 G1)

  • Configuring "auto" revoke of BPM task execution

    Hi All, I need to implement something to do an "auto" revoke of a task when the user exit from "task execution" view without using revoke+close button. Someone can help me? Thanks in advance. Edited by: g.agnelli on Apr 11, 2011 2:41 PM

  • SNC connection between two SAProuter

    Hi Guys, Please give me the procedure to establish the SNC connectivity between two SAProuter. Thanks and Regards, Atul

  • Slide show settings

    Is there a way to set times for individual photos? I want some to be on screen longer than others.