Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Installing Bean classes with Tomcat3.1

 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all
how do we can call a bean fro jsp?
where we should put the files?
i put jsp file in install_dir/webapp/examples/jsp
also i put bean java class in
install_dir/webapp/examples/web-inf/classes
i got an error that:
Unable to load class StringBean(bean class).
thanks alot for your time.
 
RAY CARNES
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I suspect you have a problem with the package name on your bean. You need to have the bean and its class in that package, and, if you use the <useBean> tag, make sure you include the class= argument. For instance:
install_dir/webapp/examples/web-inf/classes
should be
install_dir/webapp/examples/web-inf/classes/packagename/StringBean.class
If you simply instantiate the bean in your jsp, remember to use <%@ page import="packagename.*" %>
Good luck
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks alot
I will try it.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic