Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

help... jsp error

 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
dharmeshc
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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-->
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic