Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

calling beans from jsp

 
lakkapragada
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
I've created a bean and calling it in useBEan tag of JSP. I've placed the bean class file in public_html along with jsp file.
On execution , an error is displayed. why? Otherwise, where should i place the bean class file and jsp file.
please let me know.
LAKKAPRAGADA RAMA KUMAR
 
Peter den Haan
author
Ranch Hand
Posts: 3252
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by lakkapragada:
i've created a bean and calling it in useBEan tag of JSP. I've placed the bean class file in public_html along with jsp file.
On execution , an error is displayed. why?

Probably because the servlet engine couldn't find your class file. It's not supposed to be in there with the jsp.

Otherwise, where should i place the bean class file and jsp file.
please let me know.

I cannot say if the jsp should sit there in the "public_html" directory... if you would either have told us what servlet engine you use or quoted the error you get it would've helped.
The bean class file needs to go into <your application root>/WEB-INF/classes/. Don't forget to turn the package name into a directory path in the usual way.
HTH
- Peter
 
Adrian Yan
Ranch Hand
Posts: 688
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you are using tomcat, put your bean classes in the WEB-INF\classes directory should work.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13077
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I really hate to see a line like:
"On execution , an error is displayed. why?"
When you get an error - STOP - DON'T PANIC - write things down, capture the error text to a separate file - make notes about what you were doing right before the error. Learn where the various logs go. An error or exception message usually contains the information you need but you have to capture it.
Bill
 
Raghav Mathur
Ranch Hand
Posts: 641
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what web server r u using ?
do tell . rax_india@yahoo.com

Originally posted by lakkapragada:
Hello,
I've created a bean and calling it in useBEan tag of JSP. I've placed the bean class file in public_html along with jsp file.
On execution , an error is displayed. why? Otherwise, where should i place the bean class file and jsp file.
please let me know.
LAKKAPRAGADA RAMA KUMAR

 
Sagar Sharma
Ranch Hand
Posts: 92
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
place the bean file in the directory which is in the server's regular classpath. it should not be in the servlets or the public_html directory.
hope this helps

sagar
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic