aspose file tools*
The moose likes Tomcat and the fly likes need help running jsps with tomcat 4.1 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "need help running jsps with tomcat 4.1" Watch "need help running jsps with tomcat 4.1" New topic
Author

need help running jsps with tomcat 4.1

Ryan G Johnson
Ranch Hand

Joined: Nov 11, 2004
Posts: 33
The only java beans I can get to work are the ones that come in the example directory.

I made a simple jsp and put it in the 'cal' package under the examples directory. It works fine if use the TableBean that comes with tomcat as follows:

<jsp:useBean id="table" scope="session" class="cal.TableBean" />

If I save TableBean as TableBean2.java and I only change the class name and the constructor to TableBean2 and recompile, I then use the following to call it in my jsp

<jsp:useBean id="table" scope="session" class="cal.TableBean2" />

I get the following set of errors: I get these errors everywhere I use a bean I create. I do not get errors when I use the default beans. Is there a configuration parameter i need to set? I don't see it in any books.

org.apache.jasper.JasperException: Unable to compile class for JSP

An error occurred at line: 13 in the jsp file: /jsp/cal/hw6.jsp

Generated servlet error:
[javac] Compiling 1 source file

C:\Tomcat_new\work\Standalone\localhost\examples\jsp\cal\hw6_jsp.java:63: cannot resolve symbol
symbol : class TableBean2
location: package cal
cal.TableBean2 table = null;
^



An error occurred at line: 13 in the jsp file: /jsp/cal/hw6.jsp

Generated servlet error:
C:\Tomcat_new\work\Standalone\localhost\examples\jsp\cal\hw6_jsp.java:65: cannot resolve symbol
symbol : class TableBean2
location: package cal
table = (cal.TableBean2) pageContext.getAttribute("table", PageContext.SESSION_SCOPE);
^



An error occurred at line: 13 in the jsp file: /jsp/cal/hw6.jsp

Generated servlet error:
C:\Tomcat_new\work\Standalone\localhost\examples\jsp\cal\hw6_jsp.java:68: cannot resolve symbol
symbol : class TableBean2
location: package cal
table = (cal.TableBean2) java.beans.Beans.instantiate(this.getClass().getClassLoader(), "cal.TableBean2");
^
3 errors
Mike Curwen
Ranch Hand

Joined: Feb 20, 2001
Posts: 3695

dumb question, but... did you put your new class under WEB-INF/classes or WEB-INF/classes/cal ?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: need help running jsps with tomcat 4.1