How to fill a form using JSP?

Posted on 2010-01-04
Last Modified: 2013-11-23
hi experts,

I need to use JSP to do a small program. I have to read a text file. If the file is empty then I have to show a empty form to fill out and submit. If the files is not empty, I get the data from the file and fill the form with this data using JSP. How can I do that? I am new working with JSP, can you please help? Thanks!
Question by:alasdemarfil
    LVL 26

    Expert Comment

    What jsp code do you have so far?

    If you do not have any code, then you need to walk through a JSP tutorial.  There are many out there -- pick the one that looks best to you, or matches the environment in which you are running your jsp page.

    Some JSP tutorials:

    Once you have a jsp page, and you need help with it, post your jsp code and we'll work with you on that.
    LVL 40

    Accepted Solution

    what is the format of the text file.
    Is it like a properties file, like

    1) you need to use the resource bundle, and populate the same in your servlet.
    2) you need to add the resource bundle to the session
    3) extract the values for those properties in the JSP.
    using something like
    Properties properties = session.getAttribute("resourceBundle");

    <%=properties.get('property1'); %>

    i guess you would want to name your properties as the field labels.

    Now if you can come up with the source code, we will be happy to help you


    LVL 20

    Expert Comment

    What is the format of the text file?

    Author Closing Comment


    Featured Post

    How to improve team productivity

    Quip adds documents, spreadsheets, and tasklists to your Slack experience
    - Elevate ideas to Quip docs
    - Share Quip docs in Slack
    - Get notified of changes to your docs
    - Available on iOS/Android/Desktop/Web
    - Online/Offline

    Join & Write a Comment

    Suggested Solutions

    Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
    Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
    Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
    This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.

    733 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    24 Experts available now in Live!

    Get 1:1 Help Now