I tried to run the sample project Bookstore, the BookDetailServlet and
CatalogServlet always give the NullPointerException. I found that the
statement: String bookId = request.getParameter("bookId") won't work, I
tried getParameterValues("bookId")[0] and getQueryString(),
won't either. Why? This is question 1.
Question 2: I tried to modify this statement using
try{ String bookId = request.getParameter("bookId");
System.out.println("get bookId "+bookId);
}catch(Exception e){
e.printStackTrace();
},
it simply doesn't work, the javac message is : varaible bookId is not
defined, after removing try/catch block the complaint is gone. Why
I can't use try/catch for this statement?
Anybody has any idea? I appreciate.
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html