You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Kwok Peng Tuck <pe...@makmal.net> on 2003/05/20 07:09:29 UTC
Re: Can someone tell me what should be the directory structure
Or
.....WEB-INF/lib/myjar.jar
Richie Chauhan wrote:
>Your java class file should be under:
>....WEB-INF/classes/beans/LanguageBean.java
>
>Your LanguageBean.java source code should have
>
>package beans;
>
>The jsp file should then work with
>
><jsp:useBean id="languageBean" scope="page" class="beans.LanguageBean">
> <jsp:setProperty name="languageBean" property="*"/>
></jsp:useBean>
>
>That should be all you need to get it going.
>
>Richie Chauhan
>
>
>-----Original Message-----
>From: Ashutosh Sharma [mailto:Ashutosh.Sharma@tavant.com]
>Sent: Monday, May 19, 2003 8:38 PM
>To: Tomcat Users List
>Subject: Can someone tell me what should be the directory structure
>
>I am working on a simple jsp and java beans kind of projects. Can
>someone
>tall me what shud be the directory structure of such an application.
>For example where we shud keep the beans-becoz i 'm getting class not
>found
>exception whenever i refer to those beans from my JSPs.
>
>Let us take this example:
>This is my beans.jsp
><jsp:useBean id="languageBean" scope="page" class="beans.LanguageBean">
> <jsp:setProperty name="languageBean" property="*"/>
></jsp:useBean>
>
><html>
> <head>
> <title>useBean action test result</title>
> </head>
> <body>
> <h1>useBean action test result</h1>
>
> <p>Hello, <jsp:getProperty name="languageBean"
>property="name"/>.</p>
>
> <p>Your favorite language is <jsp:getProperty name="languageBean"
>property="language"/>.</p>
>
> <p>My comments on your language:</p>
> <p><jsp:getProperty name="languageBean"
>property="languageComments"/></p>
> </body>
></html>
>which i have placed inside webapps/beans and added a context name beans
>in
>the server.xml.
>Further i have put LanguageBean.java inside
>webapps/beans/WEB-INF/classes/LanguageBean.java and
>LanguageBean.class-this
>is under the package beans.
>
>now at the time of execution-i'm getting the class not found exception.
>
>With best regards:
>Ashutosh Sharma
>
>Tavant Technologies India Pvt. Ltd.,
>"Driving Profits Through Channel Collaboration"
>http://www.tavant.com
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
>
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org