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

Using java-beans in your jsp

 
Ranch Hand
Posts: 267
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all
I created an application and also a web interface to access mysql tables! My problem currently is using one of the classes of my application in my jsp code! I created a WEB-INF/classes folder as requires and dropped the folders which is also the way the package should be accessed and it gives errors when i am trying to run the page! Your help would be highly appreciated!
 
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Could you please Tell The Details?
 
Saheed Adepoju
Ranch Hand
Posts: 267
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
I am so sorry i didnt provide so much details to my problem so here they go:
My Jsp code is like this: I just posted the jsp code i have written so far:

When i try to run the page, i get this translation-time error:



I use jdk1.5, i dont know if this could pose a problem!I created a WEB-INF folder and placed the Library/db folder under the classes directory created under the WEB-INF folder! I hope this could help in solving my little problem! Thanks!
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Saheed,

Can you post the full path to your Database.class file (preferably by pasting from your command line or explorer address window)?
 
Saheed Adepoju
Ranch Hand
Posts: 267
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Ben Souther:
Saheed,

Can you post the full path to your Database.class file (preferably by pasting from your command line or explorer address window)?



I also have a jar located in e:\Testing

e:\Testing\Library\db\Database.class

I hope this helps! Thanks
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I thought you said you have one under WEB-INF.

Can you post the full path to the one that Tomcat is supposed to use?
 
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

Note that in addition to giving the package as part of the class name in the useBean tag, you also have to import the class OR give the complete package in every reference.
Bill
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by William Brogden:

Note that in addition to giving the package as part of the class name in the useBean tag, you also have to import the class OR give the complete package in every reference.
Bill



I've never had to do either.

Jasper has always fully qualified any reference to classes defined in a useBean tag in the generated servlet code.

Maybe I'm mis-reading your comment.
 
Saheed Adepoju
Ranch Hand
Posts: 267
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all
Thanks for your reply so far! Well as for the full path, i am usually @ a cafe! Here is what i think is the path
f:\windows\ProgramFile\ApacheGroup\ROOT\Web_App\WEB-INF\classes\Library\...
and also f:\windows\programFile\ApacheGroup\ROOT\WEB-INF\lib\Library.jar
This is the path i have! I hope this helps in solving my problem. Thanks
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Saheed Adepoju:
Hi all
Thanks for your reply so far! Well as for the full path, i am usually @ a cafe! Here is what i think is the path
f:\windows\ProgramFile\ApacheGroup\ROOT\Web_App\WEB-INF\classes\Library\...
and also f:\windows\programFile\ApacheGroup\ROOT\WEB-INF\lib\Library.jar
This is the path i have! I hope this helps in solving my problem. Thanks



Have you configured Tomcat to look for webapps in a directory other than TOMCAT_HOME/webapps?
Or have you created your own context.xml file to tell Tomcat where to look for your webapp?

Take a look at this page to see what the structure of a webapp running under tomcat should be
 
William Brogden
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

I've never had to do either.

Jasper has always fully qualified any reference to classes defined in a useBean tag in the generated servlet code.

Maybe I'm mis-reading your comment.


That comment was based on my experience with previous versions of Tomcat which did not add the package to bean class references, causing exactly that error. I'm glad to hear that the current one catches the problem.
Bill
 
eat bricks! HA! And here's another one! And a tiny ad!
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic