Can some one tell me why the value from the servlet class is not reaching the bean class?
Here is my servlet
|
Code:
|
try{
StringBean bean = new StringBean();
bean.setBean(value);
request.setAttribute("result", bean);
}catch(Exception e){
e.printStackTrace();
} |
Here is my bean class (StringBean)
|
Code:
|
package pack01;
public class StringBean{
private String answer="Hi";
public void setBean(String value){
answer = value;
}
public String getBean(){
return(answer);
}
} |
When I run my program I only see Hi as the output. Some how the value is not reaching the StringBean class.
Many thanks