|
 |
pro_jsp thread: Please help me with the Simple JSP.
Message #1 by "Anders Wong" <kwok@s...> on Mon, 9 Oct 2000 06:19:17 +0100
|
|
Hi.. I am new to JSP. I did make apache and tomcat working in my W2k pro.
I can run the examples from the book of pro_jsp. In chapter 2's example,
wordpro.jsp. It works fine. After, I created one similar example by
myself.
1. I program a Java file which call personal.java and I compiled it and I
save the pesonal.class file to /web-inf/classes/.../ch02/(same location
with chapter 2's example)
2. I make HTML file (anders.html)
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor="#FFFFFF">
<form name="form1" method="post" action="me.jsp">
<input type="submit" name="Go" value="Show!!!">
</form>
<p> </p>
</body>
</html>
3. I create a JSP file (me.jsp)
<jsp:useBean id="showme" scope="request" class="com.wrox.projsp.ch02.personal"/>
<jsp:setProperty name="showme" property="*"/>
<html>
<head>
<title>Personal Details</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor="#FFFFFF">
<p>Here you are!!!!!</p>
<p>My First Name is : <%= showme.getFirstName() %> </p>
<p>My Last Name is : <%= showme.getLastName() %></p>
<p> Age : <%= showme.getAge() %> </p>
<p> </p>
<p> </p>
</body>
</html>
4. When I run the JSP under the server..I GOT AN ERROR AS BELOW
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
Error: 500
Location: /projsp/me.jsp
Internal Servlet Error:
java.lang.NullPointerException
at
org.apache.tomcat.core.ContextManager.handleError(ContextManager.java:736)
at
org.apache.tomcat.core.ServletWrapper.handleRequest(ServletWrapper.java:527)
at org.apache.tomcat.core.ContextManager.service(ContextManager.java:559)
at
org.apache.tomcat.service.connector.Ajp12ConnectionHandler.processConnection(Ajp12ConnectionHandler.java:156)
at
org.apache.tomcat.service.TcpConnectionThread.run(SimpleTcpEndpoint.java:338)
at java.lang.Thread.run(Unknown Source)
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>
Please help me to slove the problem. Thanks a lot
Anders Wong
|
|
 |