Can a JSP page instantiate a serialized bean?

Govind Seshadri

No problem! The useBean action specifies the beanName attribute, which can be used for indicating a serialized bean. For example:

<jsp:useBean id="shop"  type="shopping.CD" beanName="CD"  />
<jsp:getProperty name="shop" property="album" />

A couple of important points to note. Although you would have to name your serialized file "filename.ser", you only indicate "filename" as the value for the beanName attribute.

Also, you will have to place your serialized file within the WEB-INFjspbeans directory for it to be located by the JSP engine.

For details, see the JSP 1.1 specification at http://java.sun.com/products/jsp/tags/11/syntaxref11.fm14.html .

0 Comments  (click to add your comment)
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

About | Sitemap | Contact