aspose file tools*
The moose likes Spring and the fly likes Seeting default value in form input tags Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "Seeting default value in form input tags" Watch "Seeting default value in form input tags" New topic
Author

Seeting default value in form input tags

jas preet
Ranch Hand

Joined: Mar 31, 2010
Posts: 76

I have form input tags ...
I want to set a default value such as ${UserName} to it .
Please suggest . i could not find any way out .


Thanks Jaspreet ----- Nothing is permanent
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17250
    
    6

jas preet wrote:I have form input tags ...
I want to set a default value such as ${UserName} to it .
Please suggest . i could not find any way out .


In the request for the form in the first place, the Get add the object to the Model.

Usually you have a Controller with multiple methods. One method is mapped to the GET request and one to the POST request.

In the GET request method add the backing object of the form to the Model and return it.

Then in the jsp web page use ${backingBean.propertyName}, then when the submit button is mapped to the POST method the backingBean passed in as a request parameter you can access the values through that parameter object.

Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Seeting default value in form input tags