[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 619
  • Last Modified:

How to fill a form using JSP?

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!
0
alasdemarfil
Asked:
alasdemarfil
1 Solution
 
mrcoffee365Commented:
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:
http://www.jsptut.com/
http://java.sun.com/j2ee/1.4/docs/tutorial/doc/index.html

Once you have a jsp page, and you need help with it, post your jsp code and we'll work with you on that.
0
 
Gurvinder Pal SinghCommented:
what is the format of the text file.
Is it like a properties file, like
property1=value1
....
propertyn=valuen

then
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

Thanks



0
 
a_bCommented:
What is the format of the text file?
0
 
alasdemarfilAuthor Commented:
thanks!
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now