File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

need help running jsps with tomcat 4.1

 
Ryan G Johnson
Ranch Hand
Posts: 33
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3695
IntelliJ IDE Java Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic