You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by secam secam <se...@yahoo.fr> on 2004/03/19 11:38:00 UTC
Example
Hi,
Is anyone got an example project in tapestry that contains forms to update and query a database, and also contains table and list.
Thanks,
Regard's
Secam
---------------------------------
Yahoo! Mail : votre e-mail personnel et gratuit qui vous suit partout !
Créez votre Yahoo! Mail
Dialoguez en direct avec vos amis grâce à Yahoo! Messenger !
RE : Tapestry Torque
Posted by Frédéric Ledent <fr...@market-ip.com>.
Hi,
Here is an example how to configure Torque in Tapestry :
public class InitTorque extends HttpServlet {
public void init(ServletConfig config) throws ServletException {
super.init(config);
try {
InputStream configStream =
getServletContext().getResourceAsStream(config.getInitParameter("configT
orque"));
PropertiesConfiguration c = new PropertiesConfiguration();
c.load( configStream );
Torque.init(c);
}
catch ( IOException e ) {
throw new ServletException( e.toString() );
}
catch ( TorqueException e ) {
throw new ServletException( e.toString() );
}
}
}
and in your web.xml you should add :
<servlet-name>InitTorque</servlet-name>
<servlet-class>com.mycompany.InitTorque</servlet-class>
<init-param>
<param-name>configTorque</param-name>
<param-value>/WEB-INF/Torque.properties</param-value>
</init-param>
<load-on-startup>2</load-on-startup>
</servlet>
If you are used to work with Torque, you should dont have any problem
in Tapestry.
Simple Example :
public void formLoginSubmit(IRequestCycle cycle) {
Criteria criteria = new Criteria();
criteria.add(UserPeer.LOGIN,login);
criteria.add(UserPeer.PASSWD,password);
User user = UserPeer.doSelect(criteria);
If (user != null) {
...
cycle.activate("HomePage");
}
}
Fred
-----Message d'origine-----
De : secam secam [mailto:secam2004@yahoo.fr]
Envoyé : vendredi 19 mars 2004 16:53
À : Tapestry users
Objet : Tapestry Torque
hi,
I'm new in tapestry
Have you got some simple example that illustrate the connection to a
database using torque in tapestry?
Thanks,
Regard's
Secam
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.591 / Virus Database: 374 - Release Date: 17/02/2004
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
Tapestry Torque
Posted by secam secam <se...@yahoo.fr>.
hi,
I'm new in tapestry
Have you got some simple example that illustrate the connection to a
database using torque in tapestry?
Thanks,
Regard's
Secam
---------------------------------
Yahoo! Mail : votre e-mail personnel et gratuit qui vous suit partout !
Créez votre Yahoo! Mail
Dialoguez en direct avec vos amis grâce à Yahoo! Messenger !