<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...

