View Single Post
  #1 (permalink)  
Old 08-15-2008, 08:34 PM
impact impact is offline
Member
 
Join Date: May 2008
Posts: 18
Rep Power: 0
impact is on a distinguished road
Default Bean class error
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
Reply With Quote