Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem in JSP compilation with Weblogic 6.1

 
sahababu shah
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi I have written a simple JSP page which is using a simple javabean using the <jsp:useBean> tag.I am using weblogic6.1 and kept the .jsp file under the DefaultWebApp folder and the corresponding class file(which is actually the bean)in
DefaultWebApp\
WEB-INF\
classes folder which is the right place.Now while I am trying to run the jsp using the URL http://localhost:7001/DefaultWebApp/hello.jsp it is throwing the servlet exception which shows the compilation error and that is basically due to not getting the bean class.
Could anyone show me some wayout?
Thanks in advance
 
Chris Mathews
Ranch Hand
Posts: 2712
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your javabean is in the default package (ie no package) right? JSPs that use JavaBeans which do not have a package declaration (i.e. are in the default package) will not compile in WebLogic. Add a package declaration for your JavaBeans, add the necessary import statement, and recompile the JSP.
This is one of the few undocumented areas of the JSP Specifications and each Container handles it in their own way. Some Containers implicitly make the default package visible, others do not. For portability purposes (and maintainability) it is recommended that you always put your classes in a package.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic