JSP Beans and Form Processing:can't find class
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   juan_jara
Posted On:   Tuesday, June 18, 2002 07:30 PM

Hello all. I am new in JSP. Test Scenario: ============== - Tomcat Web Server Release 1.4 - I have my HTML called GetName.html: GetName.html contains a FORM with METHOD=POST action=SaveName.jsp GetName.html contains 3 inputs with names: "username" ,"email" and "age" ------------------------------------------------------ - I have my class called UserData as follows: The members of this class match the Form Names public class UserData { String username; String email; int age; public void setUsername( String value ) {    More>>

Hello all. I am new in JSP.

Test Scenario:

==============

- Tomcat Web Server Release 1.4

- I have my HTML called GetName.html:


GetName.html contains a FORM with METHOD=POST action=SaveName.jsp

GetName.html contains 3 inputs with names: "username"

,"email" and "age"



------------------------------------------------------


- I have my class called UserData as follows:

The members of this class match the Form Names


public class UserData {

String username;

String email;

int age;



public void setUsername( String value )

{

username = value;

}



public void setEmail( String value )

{

email = value;

}



public void setAge( int value )

{

age = value;

}


public String getUsername() { return username; }


public String getEmail() { return email; }


public int getAge() { return age; }

}


This class is located at:

c: omcat4.0webappsROOTWEB-INFclassesUserData.class

(My CLASSPATH has access to

c: omcat4.0webappsROOTWEB-INFclasses directory)


--------------------------------------------------------

My first 2 lines of my SaveName.jsp is as follows





----------------------------------------------

When SaveName.jsp is executed I got the error:



type Exception report


message Internal Server Error


description The server encountered an internal error

(Internal Server Error) that prevented it from fulfilling
this request.


exception

org.apache.jasper.JasperException: Unable to compile class

for JSPNote: sun.tools.javac.Main has been deprecated.



An error occurred at line: 1 in the jsp file: /SaveName.jsp



Generated servlet error:

C: omcat4.0worklocalhost\_SaveName$jsp.java:56: Class org.apache.jsp.UserData not found.

UserData user = null;

^


An error occurred at line: 1 in the jsp file: /SaveName.jsp



Generated servlet error:

C: omcat4.0worklocalhost\_SaveName$jsp.java:59: Class org.apache.jsp.UserData not found.

user= (UserData)

^

An error occurred at line: 1 in the jsfile: /SaveName.jsp



Generated servlet error:

C: omcat4.0worklocalhost\_SaveName$jsp.java:64: Class org.apache.jsp.UserData not found.

user = (UserData)

java.beans.Beans.instantiate(this.getClass().getClassLoader(), "UserData");

^
3 errors, 1 warning


at org.apache.jasper.compiler.Compiler.compile(Compiler.java:285)

at org.apache.jasper.servlet.JspServlet.loadJSP(JspServlet.java:552)

---------------------------------------------------

Why my JSP can not find my class UserData ???

My CLASSPATH has access to the directory where

the UserData.class file is created.


Thanks for your time
   <<Less

Re: JSP Beans and Form Processing:can't find class

Posted By:   Derek_Illchuk  
Posted On:   Wednesday, June 19, 2002 10:06 PM

Did you cut and paste the actual code into this message? If so, you'll notice that in your

If that's not it, please reply, and I'll try to help you out some more.



Derek

Techportfolio.ca - Wanna see what JSP can do?

About | Sitemap | Contact