File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSP and the fly likes Populate Form Elements Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Make it so: Java DB Connections & Transactions this week in the JDBC forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Populate Form Elements" Watch "Populate Form Elements" New topic

Populate Form Elements

Jason Stortz
Ranch Hand

Joined: Jan 11, 2001
Posts: 68
Does anyone know how to make the form elements in a JSP populate automatically? I am getting very sick of doing:
input type="text" name="text" value="<%= myvalue %>"
This is even uglier with select lists, those of you who have done this know what I mean.
Anyone got any ideas?
I have all the values when entering the JSP I just want to be able to do something easy to make the form populate with those values.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 17280

Struts is good for this. Take a look at and read the docs on Form Beans.
If you need a quick overview of Struts and can get your hands on the April 2002 issue of Java Pro magazine, I humbly offer my attempt along those lines. Unfortunately the online issue has now gone over to May and the April hasn't yet been added to the archives, so you'll probably have to chase down a print copy.

An IDE is no substitute for an Intelligent Developer.
I agree. Here's the link:
subject: Populate Form Elements
It's not a secret anymore!