<jsp:useBean...> didn't create new bean?

According to tutorial or specification (in my perception),

the following tag will create a new bean if it doesn't

exist:

<jsp:useBean id="prodDetail"

class="mycomp.model.ProductDetail"

scope="request" />

Say I put the tag in Product.jsp, and it is an entry form

for insert and update a new product. For insert, I intend

to access Product.jsp directly from browser. For update,

I have clients to access a servlet that in turn, will

dispatch {[Product.jsp + prodDetail to be updated)}.

There was no problem with update, however, for insert

(directly access Product.jsp via url), I got this exception.

I am using Tomcat, and I wonder whether it's a "Java error"

or "Tomcat error".

Any help would be appreciated. Thanks...

javax.servlet.ServletException

at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:459)

at _0002fProduct_0002ejspProduct_jsp_0._jspService(_0002fProduct_0002ejspProduct_jsp_0.java:187)

at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)

...etc...

Root cause:

java.lang.NullPointerException

at _0002fProduct_0002ejspProduct_jsp_0._jspService(_0002fProduct_0002ejspProduct_jsp_0.java:112)

at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)

at org.apache.jasper.servlet.JspServlet$JspCountedServlet.service(JspServlet.java:130)

...etc...

[1765 byte] By [verdi96] at [2007-9-26 4:08:21]
# 1

Whoops, sorry, I made a silly silly mistake, apparently

there was an extra scriplet <% } %> I forgot to delete.

It's works now....

I figured that out when I was composing following posting

about snipplet of the JSP..., so I guess this "embarassing"

posting does help me too...., in a short time :D

verdi96 at 2007-6-29 13:10:26 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...