title: How to pass JSP variable value to this Struts tag
body: <p>I want to set the JSP variable value to the struts tag <code>&lt;s:set var=""  value=""&gt;</code>, 
  in the following code I have to set the value of <code>carbo</code> variable in <code>&lt;s:set name="c" value=" "/&gt;</code> instead of constant value.</p>
  
  <p>How can I do this?</p>
  
  <pre class="lang-jsp prettyprint-override"><code>&lt;%! String carbo=""; %&gt;
  
  &lt;%
  String dish_name=(String)session.getAttribute("d");
  String calories_qty=(String)session.getAttribute("a");
  
  try {
      Class.forName("com.mysql.jdbc.Driver").newInstance();  
      Connection conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/medical","root","root");  
      //Connection conn=dbConn.getConnection();
      Statement stmt = conn.createStatement();  
      System.out.println("jsp dish_name="+dish_name);
      System.out.println("jsp dish_name="+calories_qty);
      ResultSet rs = stmt.executeQuery("Select * from calories c,dishdetail d where  c.dishdetail_Id=d.id and d.dishName='"+dish_name+"' AND d.size='"+calories_qty+"' "); 
  
      while(rs.next()){
          carbo=rs.getString("carbo");
          //carbo=Float.parseFloat(rs.getString("carbo"));
      } 
      System.out.println("jsp carbo:"+carbo);
  }
  catch(Exception e){
      System.out.println("error:"+e);
  }
  
  %&gt;
  
  &lt;s:set name="c" value="45" /&gt;
  
  &lt;p&gt; carbo: &lt;s:property  value="#c" /&gt;&lt;/p&gt;
  
  &lt;sj:progressbar  cssStyle="width:20%; height:10px;" value="%{c}"  onCompleteTopics="reloadfifthlist" onChangeTopics="mychangetopic"/&gt; 
  </code></pre>