Difference between <jsp:useBean> and <bean:define> ?

A

Anan H. Samiti

When I define something like the following in my ActionClass (in a Struts/JSP Architecture)

request.setAttribute("myVo", myVoObject);

I could access this object from my JSP page (as far as I know) by declaring a bean like:

<jsp:useBean id="myVo" class="mypackage.myVo" />

resp.

<bean:define id="myid" name="myVo" property="getVo" type="mypackage.myVo" />



But what is the difference?

Is the next html:text tag valid for both declarations?

<html:text name="myidValue" property="myValue" size="10" value="<%= myVo.getMyValue() %>" />

Anan
 
K

kaeli

I could access this object from my JSP page (as far as I know) by declaring a bean like:

<jsp:useBean id="myVo" class="mypackage.myVo" />

resp.

<bean:define id="myid" name="myVo" property="getVo" type="mypackage.myVo" />

AFAIU, the main difference between these two is that the first is recognized
in any JSP context. The second requires Struts, which not everyone uses.


--
--
~kaeli~
I can't sleep.
The clowns might eat me.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,577
Members
45,054
Latest member
LucyCarper

Latest Threads

Top