Hi All,
In Page 420 HFS there is a question :
<
jsp:useBean id=”person” type=”foo.Employee” scope=”request” >
<jsp:setProperty name=”person” property=”name” value=”Fred” />
</jsp:useBean >
Name is: <jsp:getProperty name=”person” property=”name” />
What happens if the
servlet code looks like:
foo.Person p = new foo.Employee();
p.setName(“Evan”);
request.setAttribute(“person”, p);
Its says:
The body will NEVER
run! It’s pointless to
put a body inside a <jsp:
useBean > tag if you have
only a type and no class!
Remember,
the tag body
executes ONLY if a new
bean is created, which can
never happen when only
a type (but no class) is
declared in the tag.
But Now since the person attribute is already present ,so when the beanid is checked it wil know that in request scope the person is there ,so there is no point in creating a bean , an dthrowing an error that class is not specified?
Thanks
Amarshi Mohanty