• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Seeting default value in form input tags

 
Ranch Hand
Posts: 78
Eclipse IDE Tomcat Server Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 .
 
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
 
Life just hasn't been the same since the volcano erupted and now the air is full of tiny ads.
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic