You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Romin K. Irani" <ri...@infinitymarkets.com> on 2001/05/10 22:43:05 UTC

JSP compilation under Tomcat 4.0 Beta 3

Hi All,

I have installed tomcat 4-b3 in d:\tomcat directory.

I have created another context by adding the following entry to the 
server.xml file
        <Context path="/timesheet" docBase="timesheet" debug="0" 
reloadable="true" />

There is one jsp i.e  d:\tomcat\webapps\timesheet\test.jsp , the contents 
of which are shown below:
<jsp:useBean id="emp" class="timesheet.Employee">
</jsp:useBean>
<%
  emp.setName("tomcat");
  out.println(emp.getName());
%>

The above bean Employee.class is present in 
d:\tomcat\webapps\timesheet\web-inf\classes\employee directory
so the fullpath to the class is : 
d:\tomcat\webapps\timesheet\web-inf\classes\timesheet\Employee.class

The bean code (Employee.java) is given below:
package timesheet;

public class Employee
{
	public Employee() {}
	String name = "";
	public void setName(String n) { name = n;}
	public String getName() { return name; }
}

When I try to access this jsp, it gives the following error
org.apache.jasper.JasperException : and the description that the class 
timesheet.Employee was not found.

The same application if placed in Tomcat 3.2 works. What is more surprising 
is that if I place the above files under the examples directory of Tomcat 
4-b3, everything works fine.
Can someone please explain whats happening ????
Thanks in Advance,
Romin.


Re: JSP compilation under Tomcat 4.0 Beta 3

Posted by "David M. Karr" <dm...@earthlink.net>.
>>>>> "Romin" == Romin K Irani <ri...@infinitymarkets.com> writes:

    Romin> Hi All, I have installed tomcat 4-b3 in d:\tomcat directory.

    Romin> I have created another context by adding the following entry to the
    Romin> server.xml file <Context path="/timesheet" docBase="timesheet"
    Romin> debug="0" reloadable="true" />

    Romin> There is one jsp i.e d:\tomcat\webapps\timesheet\test.jsp , the
    Romin> contents of which are shown below: <jsp:useBean id="emp"
    Romin> class="timesheet.Employee"> </jsp:useBean> <% emp.setName("tomcat");
    Romin> out.println(emp.getName()); %>

    Romin> The above bean Employee.class is present in
    Romin> d:\tomcat\webapps\timesheet\web-inf\classes\employee directory so
    Romin> the fullpath to the class is :
    Romin> d:\tomcat\webapps\timesheet\web-inf\classes\timesheet\Employee.class

    Romin> The bean code (Employee.java) is given below: package timesheet;

    Romin> public class Employee { public Employee() {} String name = "";
    Romin> public void setName(String n) { name = n;} public String getName() {
    Romin> return name; } }

    Romin> When I try to access this jsp, it gives the following error
    Romin> org.apache.jasper.JasperException : and the description that the
    Romin> class timesheet.Employee was not found.

    Romin> The same application if placed in Tomcat 3.2 works. What is more
    Romin> surprising is that if I place the above files under the examples
    Romin> directory of Tomcat 4-b3, everything works fine.  Can someone please
    Romin> explain whats happening ????  Thanks in Advance, Romin.

Well, since noone who knows better has responded yet, I'll give it a try.

Did you really name the directory "web-inf" and not "WEB-INF"?  That could be a
problem.  I believe the directory name has to be exactly "WEB-INF".

-- 
===================================================================
David M. Karr          ; Best Consulting
dmkarr@earthlink.net   ; Java/Unix/XML/C++/X ; BrainBench CJ12P (#12004)