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

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "set java bean property using JSTL" Watch "set java bean property using JSTL" New topic

set java bean property using JSTL

praveen sharma
Ranch Hand

Joined: May 27, 2006
Posts: 44

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.

subodh gupta
Ranch Hand

Joined: Jul 23, 2007
Posts: 203
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

Joined: Jun 27, 2007
Posts: 41
You can do that using set core tag.
e.g., <c:set target="${bean}" property="name" value="foo"/> is equivalent to bean.setName("foo").

praveen sharma
Ranch Hand

Joined: May 27, 2006
Posts: 44

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

Ben Souther

Joined: Dec 11, 2004
Posts: 13410

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.

Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
subject: set java bean property using JSTL
Similar Threads
rendered problem
JSTL Drop Down
JSTL Expression issue
Spring Javamelody
accessing bean variable dynamically