Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

set java bean property using JSTL

 
praveen sharma
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

i need help in setting the java bean property using JSTL .which i am fail to accomplish .so anyone who can help me will be a world of good.

Bye
praveen
 
subodh gupta
Ranch Hand
Posts: 203
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi Parveen,

Where are you facing problem?

If you have tried something please paste the code and the exception.

If not i'll recommend you to try it yourself first.
 
Sahid Khan
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can do that using set core tag.
e.g., <c:set target="${bean}" property="name" value="foo"/> is equivalent to bean.setName("foo").

HTH.
 
praveen sharma
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,

thank alot i am able to access Java bean but i want to knew can't i create bean object using JSTL tag.i first have to create bean object using standard tag then i am able to use .

any suggestion will be help ful to me

Thanks
Praveen
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You shouldn't be creating objects using JSTL.

In a well written, scriptless JSP application, JSTL and EL are only needed to work with existing scoped variables.

If you want to see a very simple example of a JSP that uses a bean that was bound to scope by a servlet, look at the SimpleMVC example in our codebarn.
http://www.javaranch.com/codebarn/codebarn-servlets-simplemvc.jsp
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic