aspose file tools*
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 Soft Skills this week in the Jobs Discussion 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
Author

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

Anonymous
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()
{
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

Joined: Mar 22, 2000
Posts: 12835
    
    5
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Where in Tomcat3.1 should i put .jsp files, .java files(Beans files)