aspose file tools*
The moose likes JSP and the fly likes Help with buttons on a JSP page Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Help with buttons on a JSP page" Watch "Help with buttons on a JSP page" New topic
Author

Help with buttons on a JSP page

nash avin
Ranch Hand

Joined: Nov 18, 2004
Posts: 45
Hi All,

I have a HTML page , that has certain text fields.... on entering values into the text fields, it is directed to a servlet.

The servlet(puts the values into the database) then directs to a jsp with the values entered in the form.

I would like to know whether on the jsp page i can have 2 buttons like "edit" and "OK".
(how do I code it???)

The "edit" button edits the information on the initial HTML page and

The "OK" button just confirms the inputted information.

I hope I have asked a clear question.It would be great if someone directs me in the right direction.

Thanking everyone in advance

AS
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

This sounds pretty typical.

  • The user clicks a link and is forwarded to the form page.
  • When done filling out the form, the user clicks the "Save" button.
  • The servlet redirects to a confirmation page that has all the values stored in hidden form fields but also in a pretty, readable form.
  • If the user clicks 'OK' the form submits and the servlet writes the information and forwards to an 'Thank you' page.
  • If the user clicks the 'Edit' Button the servlet forwards back to the original form for the user to make the needed corrections.


  • What part are you stuck on?


    Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
    nash avin
    Ranch Hand

    Joined: Nov 18, 2004
    Posts: 45
    Hi,

    Thanks a lot for the information.

    I would like to know the following details

    1) I would like to know how the "OK" and "Submit" buttons are generated on the jsp page.

    2) Following which , If the user clicks the OK button on the JSP the "form submits" the servlet writes the info. & forwards to a "Thank you" page. How can this be done...???

    3) If the user clicks Edit button the servlet forwards back to the original html form for the user to make the needed corrections.

    It would be great if a detailed description can be given..

    Thanks a lot for your time and help

    AS
    Ben Souther
    Sheriff

    Joined: Dec 11, 2004
    Posts: 13410

    I'm guessing by your questions that you are new to both JSP/Servlets and to HTML and web programming.

    If this is the case, you'll be much better off if you step back a bit and find some good books and tutorials to follow.

    One book that I would strongly recommend is "Core Servlets and Java Server Pages"; available for free download at http://pdf.coreservlets.com.
    I think this one would be good because it devotes a chapter just to HTML forms and how they work (for any web programming language).

    The time you set aside upfront to learn the basics will more than pay off when you go back to your project.

    -Ben
    nash avin
    Ranch Hand

    Joined: Nov 18, 2004
    Posts: 45
    Hi,

    Thanks again for your time and consideration.Will read the book as you have suggested.

    AS
     
    I agree. Here's the link: http://aspose.com/file-tools
     
    subject: Help with buttons on a JSP page