Link to home
Start Free TrialLog in
Avatar of gudii9
gudii9Flag for United States of America

asked on

jsp:useBean as in MVC compared to standaalone JSP

Hi,

I was reading as below


jsp:useBean as in  MVC

AS JSP page should not create the objects

servlet(not JSP page), should create all the data objects. To ensure JSP page will not create
objects, we should say like below.
<jsp:useBean ... type="package.Class" scope="request" />

instead of

<jsp:useBean ... class="package.Class" scope="request"/>

Note:
scope is not used in MVC (Model 2) architecture


<jsp:useBean id="..." type="..." />




JSP should never modify the objects
 
 So say jsp:getProperty
but not

jsp:setProperty.
 


 




I have not clearly understood what it means. How 'type' and 'class' are different. When to use use which one and advatages, disadvantages of using each one of them.

Please advise.

Any links resources ideas highly appreciated. Thanks in advance
Avatar of girionis
girionis
Flag of Greece image

The type there is the class of the object. It simply means that the specific bean is of type xxx.yyy.Z.
Avatar of gudii9

ASKER


line1
<jsp:useBean ... type="package.Class" scope="request" />

line2
<jsp:useBean ... class="package.Class" scope="request"/>



when to use line1

when to use line2

please advise
ASKER CERTIFIED SOLUTION
Avatar of girionis
girionis
Flag of Greece image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial