• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Serialized Template? with <jsp:useBean>

 
Tyler Wright
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi folks,

I've really gotten in a number of questions of late... but, I am really getting this stuff

Anyway, in the <jsp:useBean> action; the semantics determine its behavior and I was trying to really get my head around the idea of a "serialized template."

<% jsp:useBean id=”ptr” type=”com.person.PersonalInfo” beanName=”PersonalInfo.ser” %>

I know that PersonalInfo.ser is a file, and the ".ser" extension means it is serialized.

Is PersonalInfo,ser considered a "Serialized Template"?
 
Deepali Anand
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The JSP specification says the following about the beanName attribute

“The attribute beanName specifies the name of a Bean, as specified in the JavaBeans specification. It is used as an argument to the instantiate method in the java.beans.Beans class. It must be of the form a.b.c, which may be either a class, or the name of a resource of the form a/b/c.ser that will be resolved in the current ClassLoader.”

The key to that fantastically opaque explanation is the extension ser where it says a/b/c.ser. The beanName attribute can be used to point to a file that contains a serialized bean (the extension .ser is used to indicate a serialized object). However when using beanName with a serialized file the .ser extension is not included. The advantage of beanName over class is that the the value can be specified at requestion-time unlike class which must be specified at translation time. A useBean tag can use either class or beanName but not both. A beanName attribute must always be accompanied by a type attribute.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic