title: How to pass a List as parameter by using ActionForward?
body: <p>I am Building a simple Project Using Sturts 1.0 and Hibernate. The main function of the Project is to Take the Entity Number from the Welcome page and Then Query the Database for the details regarding the entity and show the result on Index.jsp page.</p>
  
  <p><strong>Struts-config.xml</strong>  </p>
  
  <pre><code>&lt;struts-config&gt;
  &lt;form-beans&gt;
      &lt;form-bean name="welcomeForm"
          type="tutorial.Struts.Form.welcomeForm" /&gt;
  &lt;/form-beans&gt; 
  
  &lt;action-mappings&gt;
       &lt;action path="/viewAsset" 
               name="welcomeForm"
               type="tutorial.Struts.Action.ViewAllAsset"     
               scope="request"         
               validate="true"
               input="welcome.jsp"&gt;
               &lt;forward name="success" path="/index.jsp" /&gt;
               &lt;forward name="failure" path="/welcome.jsp" /&gt;
       &lt;/action&gt;
  &lt;/action-mappings&gt;
  </code></pre>
  
  <p><strong>Action Class</strong> </p>
  
  <pre><code>public class ViewAllAsset extends Action {
  
      @SuppressWarnings("unused")
      public ActionForward execute(ActionMapping mapping , ActionForm form , 
              HttpServletRequest request , HttpServletResponse response)
      throws Exception{
          //HttpSession page_session = request.getSession(true);
          //String entity_id = page_session.getAttribute("entity_id").toString();
          List&lt;Asset&gt; result = null;
          String target = null;
          welcomeForm wForm = (welcomeForm)form;
          String entity_id = wForm.getEntity_id();
          AssetDataDAO ad = new AssetDataDAO();
          result = ad.GetAssetList(entity_id);                            /*Fetch the list*/
          List&lt;Asset&gt; asl = new ArrayList&lt;Asset&gt;();
  
          for(int i=0;i&lt; result.size();i++) {
                  Asset veh = new Asset();  
                  veh.setAssetId(result.get(i).getAssetId());       /*set the asset POJO */
                  veh.setEntityId(result.get(i).getEntityId());
                  veh.setAssetTypeId(result.get(i).getAssetTypeId());
                  veh.setFuelType(result.get(i).getFuelType());
                  asl.add(veh);
          }
          if(result != null)
              target = "success";
          else
              target = "failure"; 
  
  
      ActionForward forward = mapping.findForward(target);    
      forward = new ActionForward( addParameterToUrl(forward.getPath(),"List",asl),forward.getRedirect() );
      return forward;
      //return new ActionForward(forward.getPath()+"list="+asl);
  
      }
  
      private String addParameterToUrl(String url, String parameter, List&lt;Asset&gt; asl) {
          // TODO Auto-generated method stub
          return  url + ( (url.indexOf("?")==-1) ? "?" : "&amp;" ) + parameter + "=" +asl;
      }
  
  
  }
  </code></pre>
  
  <p><strong>DAO class</strong></p>
  
  <pre><code> public class AssetDataDAO {
  
      public List&lt;Asset&gt; GetAssetList(String entity_id)
              throws Exception{
                  Session session = null;
                  String sql = "from Asset asset where asset.entityId=:entityId and asset.isActive='Y'";
                  try
                      {
                      session = HibernateSessionFactory.getSession();
                      List&lt;Asset&gt; assetList = session.createQuery(sql).setString("entityId", entity_id).list();
                      return assetList;
                      }
                  catch(HibernateException hibernateException)
                      {
                      throw hibernateException;
                      }
                  catch(Exception exception)
                      {
                      throw exception;
                      }
              }
  
  }
  </code></pre>
  
  <p>But whenever I am Executing the project I am getting an error message indicating an error during passing of List through ActionForward. Please suggest any necessary changes that should be made to execute the project properly.</p>