You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Sachin Chowdhary <cs...@pisoftek.com> on 2003/02/05 13:09:07 UTC

bean with jsp

I am trying to use a class by using useBean tag in jsp but i am not able to
do it so remove all coding and just using import class name syntax but still
i am not able to do that on tomcat4.1.18 .so what i am doing wrong

can you suggest me


C:\Program Files\Apache Group\Tomcat 4.1\webapps\examples\jsp
<%@ page import="MyClass" %>

<html>
    <body>
        Meet a Bean!
   </body>
</html>

//MyClass.java


C:\Program Files\Apache Group\Tomcat 4.1\webapps\examples\WEB-INF\classes
public class MyClass
{
 public String val;
}



HTTP Status 500 -

type Exception report
message
description The server encountered an internal error () that prevented it
from fulfilling this request.
exception
org.apache.jasper.JasperException: Unable to compile class for JSP

An error occurred at line: -1 in the jsp file: null

Generated servlet error:
    [javac] Compiling 1 source file

C:\Program Files\Apache Group\Tomcat
4.1\work\Standalone\localhost\examples\jsp\MyJsp_jsp.java:7: '.' expected
import MyClass;
              ^
1 error




---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org