• 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

Javabean in JSP impossible

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi!
I have been trying for two days to start using javabeans with jsp but I can�t get my jsp-file to use a bean that I have created. I save the .jsp file in:
C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\ROOT\kise

And the javabean is saved in:
C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\ROOT\WEB-INF\classes\Beans

The code for the bean is:


the code for the jsp-page is:


I get the internal error message:


Does anyone have a clue what to do, it feels like I have tried everything? /davmal
 
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


Are you putting the .java or the .class file in this location?
 
dav mal
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have the .class file in that directory. /davmal
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
My wild guess is that it does not like the fact that you have named the class with a lower case initial letter (and the package with upper case) - contrary to the Java convention.
If this is not the answer, the next thing to do is to search the Tomcat source code for the point where that exception is generated.
Bill
 
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What version of Tomcat are you using? Because I had this same problem when I moved to Tomcat 5. I do not remember the exact fix, but it had something to do with the useBean tag. I was using class="package.class" and in T5, it has to use type="package.class" or vice versa to instantiate the bean. You might want to do some checking and see if that fixes your problem. After instantiating it, the code as was worked fine on all other pages, it was just the 1st page that was creating the bean that had problems.

Edit: Duh...obviously you are using Tomcat 5...oh well.
[ December 01, 2004: Message edited by: Logan Owen ]
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
<%-- <jsp:useBean id="beanInstanceName" scope="session" class="beanPackage.BeanClassName" /> --%>
 
Logan Owen
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
OK...here is what I was talking about. I was having this exact problem, and doing what was suggested in this thread about the class and type fixed my problem. Maybe it can help you.

linky
 
reply
    Bookmark Topic Watch Topic
  • New Topic