db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Guy Galil <guy_ga...@guardium.com>
Subject Re: Torque and jsp
Date Tue, 15 Mar 2005 14:29:33 GMT
You can pass the full path to the Torque.properties file as a parameter
to Torque.init() 

On Tue, 2005-03-15 at 09:19, salwa idrissi wrote:
> the problem is not confusing presentation and model but when i compile in jdev i have
the exception "Could not open file Torque.properties"because i must put it in a specific directory
in jdev that i don't know.
> 
> this is the code:
> 
> affichage.jsp:
> 
> 
> <table width="165" border="0" cellpadding="2" cellspacing="0" class="textindex">

> <%
> Iterator i;
> List listecr=(List)session.getAttribute("liste");
>  i = listecr.iterator();
>  while ( i.hasNext() )
>  {
>   Ecriture monecriture = (Ecriture) i.next();
> %>
>           <tr> 
>            <td width="8" align="center">
>                       <%= monecriture.getCodeetape()%>
>                       </td> 
>            
>           </tr> 
> <%
>  }
> %>
>          </table>
> 
>  
> 
> actionaccueil.java
> 
> 
>       public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest
request, HttpServletResponse response) throws IOException, ServletException
>   {
>     HttpSession session=request.getSession();
>     
>     AddEcriture test=new AddEcriture();
>     test.afficher();
> 
>     session.setAttribute("liste",test.getListecrs());
>     return mapping.findForward("success");
>   }
> }
> 
> AddEcriture.java:
> 
>  
> 
> package si.av;
> 
> import java.util.*;
> import org.apache.torque.Torque;
> import org.apache.torque.util.Criteria;
> import si.av.om.*;
> 
> public class AddEcriture
> {
> 
>  List listecrs;
>  public List getListecrs()
>  {return listecrs;}
>  
>   public void afficher()
>   {
>   try{
>       Torque.init("Torque.properties");
> 
>      Criteria critaffichage=new Criteria();
>       critaffichage.addAscendingOrderByColumn(EcriturePeer.NSEQUENCE);
>       listecrs=EcriturePeer.doSelect(critaffichage);
>       
>   }
>   
>   catch(Exception e){e.printStackTrace();}
>   }
> 
> }
> 
> 		
> ---------------------------------
>  Découvrez nos promotions exclusives "destination de la Tunisie, du Maroc, des Baléares
et la Rép. Dominicaine sur Yahoo! Voyages. 


---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org


Mime
View raw message