Hello,

I am learning JWS and JSP and used a did the first Hello World example. But
when I tried the second example where the jsp page contains <jsp:useBean
id="mybean" scope="page"
class="hello.NameHandler" /> it cannot compile the page saying that it
cannot find the hello.NameHandler class, although this NameHandler.class is
within c:\test\hello directory (the jsp page hellouser.jsp is in c:\hello).
Why is this?
Actually the behavior is more enigmatic:
When I try to open the hellouser.jsp first time after I have saved it, it
says:
500 Internal Server Error
Java Server Page Translation Error
Error during page parsing:
com.sun.server.http.pagecompile.jsp.JspException: Class: hello.NameHandler
not found
When I press Refresh, it says:
500 Internal Server Error
Java Server Page Translation Error
Error during compilation :
D:\JavaWebServer2.0\tmpdir\default\pagecompile\jsp\_test\_hellouser.java:14:
Class hello.NameHandler not found in import.
import hello.NameHandler;
       ^
D:\JavaWebServer2.0\tmpdir\default\pagecompile\jsp\_test\_hellouser.java:19:
'}' expected.
    static char[][] _jspx_html_data = null;
                                           ^
2 errors
----------------------------------------------------------------------------
-----
Here is the hellouser.jsp file:

<%@ page import="hello.NameHandler" %>
<jsp:useBean id="mybean" scope="page"  class="hello.NameHandler" />
<jsp:setProperty name="mybean" property="*" />
<html>
<head><title>Hello, User</title></head>
<body bgcolor="#ffffff" background="background.gif">
<%@ include file="dukebanner.html" %>
<table border="0" width="700">
<tr>
<td width="150"> &nbsp; </td>
<td width="550">
<h1>My name is Duke. What's yours?</h1>
</td>
</tr>
<tr>
<td width="150" &nbsp; </td>
<td width="550">
<form method="get">
<input type="text" name="username" size="25">
<br>
<input type="submit" value="Submit">
<input type="reset" value="Reset">
</td>
</tr>
</form>
</table>
<%
    if ( request.getParameter("username") != null ) {
%>
<%@ include file="response.jsp" %>
<%
    }
%>
</body>
</html>

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
FAQs on JSP can be found at:
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html

Reply via email to