File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes help... jsp error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "help... jsp error" Watch "help... jsp error" New topic
Author

help... jsp error

Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
I dunno why i will get these error.. can anybody help me?
my Bean:
public class Login implements Serializable{
String Username, Password;
boolean Valid;

public Login(){
Username = "Kelvin";
Password = "Kelvin";
Valid = true;
}

public void setUsername(String Username){
this.Username = Username;
}

public void setPassword(String Password){
this.Password = Password;
}

public void setValid(boolean Valid){
this.Valid = Valid;
}

public String getUsername(){
return Username;
}

public String getPassword(){
return Password;
}

public boolean getValid(){
return Valid;
}
}
my jsp:
<jsp:useBean id="test" scope="page" class="ssp.Login">
</jsp:useBean>
<html>
<body>
User is <%= test.getUsername() %>
password is <%= test.getPassword() %>
is Valid? <%= test.getValid() %>
</body>
</html>
Error Message:
org.apache.jasper.JasperException: Unable to compile class for JSPG:\jakarta-tomcat-3.2.1\work\localhost_8080\_0002fLogin_0002ejspLogin_jsp_0.java:85: Method getUsername() not found in class ssp.Login.
out.print( test.getUsername() );
^
G:\jakarta-tomcat-3.2.1\work\localhost_8080\_0002fLogin_0002ejspLogin_jsp_0.java:91: Method getPassword() not found in class ssp.Login.
out.print( test.getPassword() );
^
G:\jakarta-tomcat-3.2.1\work\localhost_8080\_0002fLogin_0002ejspLogin_jsp_0.java:97: Method getValid() not found in class ssp.Login.
out.print( test.getValid() );
^
Sakthivel Palanivelu
Greenhorn

Joined: Mar 28, 2001
Posts: 3
First, please check for the ssp is a sub-directory inside the directory where jsp is saved. Because in the compilation, it was clear that it was not able to see the Login class. So, it is issue with the path.
------------------
Sakthi


Sakthi
dharmeshc
Greenhorn

Joined: Apr 16, 2001
Posts: 8
Hello
also see that in the bean you havent included the package line
i mean
package (the path);
Also make sure you are placing the jsp's and the class file in proper respective directories
in tomcat 3.2.1
jsp-->
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: help... jsp error