• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

need help running jsps with tomcat 4.1

 
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
dumb question, but... did you put your new class under WEB-INF/classes or WEB-INF/classes/cal ?
 
Run away! Run away! Here, take this tiny ad with you:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic