hi,
this is my .jsp file.
<jsp:useBean id="languageBean" scope="page" class="LanguageBean.class">
<jsp:setProperty name="languageBean" property="*" />
</jsp:useBean>
<html>
<body>
<P>Hello, <jsp:getProperty name="languageBean" property="name"/></p>
<P>your favourite language is
<jsp:getProperty name="languageBean" property="language"/></p>
<p>my comments on this language is
<jsp:getProperty name="languageBean" property="languageComments"/></p>
</body>
</html>
this is .html file.
<html>
<body>
<form method="post" action="beans.jsp">
please enter your username :
<input type="text" name="name">
what is your favourite language?
<select name="language">
<option value="Java">Java
<option value="C++">C++
<option value="Perl">Perl
</select>
<input type="submit" value="submit button">
</form>
</body>
</html>
this is .java file
public class LanguageBean{
private
String name;
private String language;
public LanguageBean(){}
public void setName(String name){
this.name=name;
}
public String getName(){
return name;
}
public void setLanguage(String language){
this.language=language;
}
public String getLanguage(){
return language;}
public String getLanguageComments(){
if(language.equals("Java")) {
return "king of java";
}else if(language.equals("C++")){
return "king of c++";
}else if(language.equals("Perl")){
return "get bored";}
else return " i know little bit";
}
}
i compiled this .java file and put .class file in web-inf/classes directory.
i have tomcat structure as follows.
webapps
sub(application name)
beans.html, beans.jsp, web-inf
inside web-inf, classes, lib, web.xml.
the errror what i get is when i click
http://localhost:8080/sub/beans.jsp is
unable to compile class for jsp.
cannot resolve symbol
class LanguageBean;
this is the problems pls read it and provide suggestions.
THanks,
pop