File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes Where in Tomcat3.1 should i put  .jsp files, .java files(Beans files) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Where in Tomcat3.1 should i put  .jsp files, .java files(Beans files)" Watch "Where in Tomcat3.1 should i put  .jsp files, .java files(Beans files)" New topic

Where in Tomcat3.1 should i put .jsp files, .java files(Beans files)

Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
Hi all
I'm trying to call a bean from jsp file and i'm getting this error 500)
Class jsp.StringBean not found.
here is my bean file:
public class StringBean
private String message="No message specified ";
public String getMessage()

public void setMessage(String message)

also here is my jsp file:
<table border=5 align="CENTER">
<TR><TH class="TITLE">
using javabaens
<jsp:useBean id="stringBean" class="StringBean" />
<LI> initial value (getproperty):
<I><jsp:getProperty name="stringBean" property="message" /></I>

<LI> initial value (jsp expression):
<I><%=stringBean.getMessage() %></I>

<LI> <jsp:setProperty name="stringBean" property="message" value="best string bean:fortex" />

value after setting property with setProperty "
<I><jsp:getProperty name="stringBean" property="message" /></I>
<LI><% stringBean.setMessage("my favorite:kentucky wonder "); %>
value after setting property with scripltlet:
<I><%=stringBean.getMessage() %></I>


i put it under:
install_directory/webapp/examples/jsp directory.
i will appreciate your help
i put it in :
William Brogden
Author and all-around good cowpoke

Joined: Mar 22, 2000
Posts: 12761
JSP pages are served just like HTML pages so they go in that directory.
Beans you have to compile - the class files go in the WEB-INF/classes directory that belongs to the particular web application - or - if you want all applications to see them, they go in the tomcat/lib directory
If your JSP is in the examples directory, I think your Bean class files have to be in examples/WEB-INF/classes
All of this directory stuff is defined by the Applet 2.2 API documentation - although it is a bunch to wade through.
I agree. Here's the link:
subject: Where in Tomcat3.1 should i put .jsp files, .java files(Beans files)
Similar Threads
Setting up directory structure for Bean Component in JSP
Error - Please Help!!!
classpath or package problems?
The value for the useBean class attribute StringBean is invalid
import package problem???