tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Parker <dlpar...@facstaff.wisc.edu>
Subject problems compile .jsp with a <jsp:useBean id="mybean"
Date Wed, 05 Jul 2000 18:27:34 GMT
I'm attempting to use the set and get properties from a bean, following the 
tutorial from sun.
http://java.sun.com/products/jsp/html/jspbasics.fm2.html

This is my directory structure.
E:\Express\jsp\hellouser.jsp
E:\Express\WEB-INF\jsp\beans\hello\NameHandler.java

I have the following context in the tomcat.conf

ApJservMount /express /root
<Location /express/WEB-INF/>
     AllowOverride None
     deny from all
</Location>

<LocationMatch /express/*.jsp>
     SetHandler jserv-servlet
</LocationMatch>

____________________________________________________________________________ 
___________________

There seems to be a problem with the directory structure because the 
servlet engine is not able to find include files.

Error: 500
Location: /express/jsp/hellouser.jsp
Internal Servlet Error:
org.apache.jasper.JasperException: Bad file argument to include
         at 
org.apache.jasper.compiler.JspParseEventListener.handleDirective(JspParseEve 
ntListener.java, Compiled Code)
         at 
org.apache.jasper.compiler.DelegatingListener.handleDirective(DelegatingList 
ener.java:116)
         at org.apache.jasper.compiler.Parser$Directive.accept(Parser.java, 
Compiled Code)
         at org.apache.jasper.compiler.Parser.parse(Parser.java, Compiled Code)
         at org.apache.jasper.compiler.Parser.parse(Parser.java:1038)
         at org.apache.jasper.compiler.Parser.parse(Parser.java:1034)
         at org.apache.jasper.compiler.Compiler.compile(Compiler.java, 
Compiled Code)
         at org.apache.jasper.runtime.JspServlet.loadJSP(JspServlet.java:413)
         at 
org.apache.jasper.runtime.JspServlet$JspServletWrapper.loadIfNecessary(JspSe 
rvlet.java:149)
         at 
org.apache.jasper.runtime.JspServlet$JspServletWrapper.service(JspServlet.ja 
va:161)
         at 
org.apache.jasper.runtime.JspServlet.serviceJspFile(JspServlet.java:261)
         at org.apache.jasper.runtime.JspServlet.service(JspServlet.java, 
Compiled Code)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at 
org.apache.tomcat.core.ServletWrapper.handleRequest(ServletWrapper.java, 
Compiled Code)
         at 
org.apache.tomcat.core.ContextManager.service(ContextManager.java:559)
         at 
org.apache.tomcat.service.connector.Ajp12ConnectionHandler.processConnection 
(Ajp12ConnectionHandler.java, Compiled Code)
         at 
org.apache.tomcat.service.TcpConnectionThread.run(SimpleTcpEndpoint.java, 
Compiled Code)
         at java.lang.Thread.run(Unknown Source)

____________________________________________________________________________ 
___________________

E:\Express\jsp\hellouser.jsp

<%@ 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>
____________________________________________________________________________ 
___________
E:\Express\WEB-INF\jsp\beans\hello\NameHandler.java
package hello;

public class NameHandler {

     private String username;

     public NameHandler() {
         username = null;
     }

     public void setUsername( String name ) {
         username = name;
     }

           public String getUsername() {
         return username;
     }
}


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message