Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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()
{
return(message);

}
public void setMessage(String message)
{
this.message=message;
}

}
also here is my jsp file:
<html>
<head>
</head>
<body>
<table border=5 align="CENTER">
<TR><TH class="TITLE">
using javabaens
</table>
<jsp:useBean id="stringBean" class="StringBean" />
<OL>
<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>

</OL>

</BODY>
</html>
i put it under:
install_directory/webapp/examples/jsp directory.
i will appreciate your help
i put it in :
install_dir\webapps/web_inf/classes
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13058
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
Bill
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic