• 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

Tomcat settings

 
Ranch Hand
Posts: 116
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi!
I'd like to try using JSP + bean with some logic for implementation. It is simple example so probably Tomcat is good enough.
I created ProJavaServer directory and placed .jsp file, created
ProJavaServer\WEB-INF\classes directory and placed compiled bean there.
In %TOMCAT_HOME%/conf/server.xml i added:
docBase="c:\WORK/ProJavaServer">
I run successfully examples that not included beans, so path and other settings probably set properly.
To exclude typo i downloaded example from coreservlets.com
And it does not work.
C:\tomcat\work\localhost_8080%2Fexamples\_0002fjsp_0002fStringBean_0002ejspStringBean_jsp_0.java:105: Class jsp.StringBean not found.
out.print(JspRuntimeLibrary.toString((((StringBean)pageContext.findAttribute("stringBean")).getMessage())));
I look for advice how to place my files to make it work.
Thanks in advance

 
Sheriff
Posts: 7001
6
Eclipse IDE Python C++ Debian Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think the problem is not that it can't find your bean, but that you haven't "import"ed it into your JSP. If you look at the error message it is looking for a class jsp.StringBean.
Just as with any other Java class, a JSP only looks in its own package (jsp) and any packages or classes listed in import statements for classes mentioned by name.
Is your StringBean class in a package? if so you need to import the full classname or the whole package it belongs to. Is your StringBean in the "default" package? if so you need to explicitly import it by name.
reply
    Bookmark Topic Watch Topic
  • New Topic