title: How to pass object from action class to JSP using Bean in Struts2?
body: <p>I have to send object of Bean class back to JSP from my action class. I am instantiating the Bean class in my action class and and setting some values in my Action class.</p>
  
  <pre><code>ElasticitiesVariable elasticitiesVariable = new ElasticitiesVariable();
  elasticitiesVariable.setAuto_Auto_cost_peak("-0.047");  
  elasticitiesVariable.setAuto_Ride_cost_peak("0.000");
  elasticitiesVariable.setAuto_Van_cost_peak("0.000");
  elasticitiesVariable.setAuto_Transit_cost_peak("0.050");
  elasticitiesVariable.setAuto_Bike_cost_peak("0.000"); 
  </code></pre>
  
  <p>and in my JSP I am declaring the bean class as well.</p>
  
  <pre><code>&lt;s:bean name="org.apache.struts.register.model.ElasticitiesVariable" var="elasticitiesBean" /&gt;
  &lt;td class="edit_area"&gt;
     &lt;s:property value="#elasticitiesBean.auto_Auto_cost_peak" /&gt;&lt;/td&gt;
  </code></pre>
  
  <p>in the bean class i have declared the variable private with public getter and setter.
  But the values coming null in JSP.
  After debugging I found that there is no problem in action class. But when command goes to bean class, values becomes <code>null</code>.</p>