• 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

Tomcat doesn't know my bean

 
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm just starting to learn JSP and java beans, so this probably is a common silly mistake:
I created a jsp, where I want to use "ProbeBean"; "ProbeBean.class" and a "manifest.mf" (containing " Name: ProbeBean.class Java-Bean: true") are in a jar file, which together with the jsp is in the war file that I deploy into Tomcat 5.0.
After starting the jsp, Tomcat tells me "cannot resolve symbol symbol : class ProbeBean ".
I'd appreciate if somone could be patient enough to help on my way!
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Your bean should be in a package other than the default. Be sure to place the jar file in WEB-INF/lib.
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What I suspect might be missing is the following statement near the beginning of the jsp:

<%@ page import="mypackage.ProbeBean" %>

Just like regular java classes, JSPs require an import if you use classes from another package. The above code assumes that your class is in a package called mypackage. If you didn't put your bean in a package, I suggest you do so, as this is the way it's done in the real world, and it helps keep things organized.
 
guenter krannich
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks!
just putting the bean in a package did the job!
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic