gudii9
asked on
jsp:useBean as in MVC compared to standaalone JSP
Hi,
I was reading as below
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
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
The type there is the class of the object. It simply means that the specific bean is of type xxx.yyy.Z.
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.