• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Can't use Bean

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,
When I run jsp on tomcat I get error 500 stating
"org.apache.jasper.JasperException: Unable to compile class for JSPNote: sun.tools.javac.Main has been deprecated.
An error occurred between lines: 3 and 5 in the jsp file: /CounterBean.jsp
Generated servlet error:
C:\Program Files\Apache Tomcat 4.0\work\localhost\howjsp\CounterBean$jsp.java:60: Class org.apache.jsp.CounterBean not found.
CounterBean counterBean = null;"
The CounterBean.jsp is placed in the Context directory(\howjsp) which is configured correctly in server.xml. The content is:
<HTML>
<BODY>
<jsp:useBean id="counterBean"
scope="session"
class="CounterBean"/>
....
</HTML>
And the CounterBean.java file has been compiled and placed in \howjsp\WEB-INF\classes.
Thanks a lot.
 
Ranch Hand
Posts: 3244
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It looks like your saying that you ahve a JSP page named CounterBean and also bean named CounterBean? And you use the bean in the JSP of the same name? Sure this'll work but it can get very confusing and is probably not the best design.
I know that there are issuse with the useBean expecting a fully qualified class name in the useBean, using beans that are not actually part of a package other than the default means you dont use a package name in the classname attribute. Try putting your bean into a package and using the fully qualified class name in the useBean tag.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic