On Thu, Jun 16, 2011, nicolas wrote:

> Any others sources by any chance ?

You can use an interceptor for this as described in chapter 14 of "Stripes:
...and Java Web Development Is Fun Again". The source code of the book also
contains a complete example:

http://pragprog.com/titles/fdstr/stripes
http://pragprog.com/titles/fdstr/source_code
http://stripesbook.com/

But before you can create the example WAR file, you have to fix two syntax
errors in the LoginInterceptor class. Please see the attached patch for this.

On a Linux-based system, the steps below will create a deployable WAR file:

$ wget 'http://media.pragprog.com/titles/fdstr/code/fdstr-code.tgz'
$ tar -zxvf fdstr-code.tgz
$ patch -p0 < LoginInterceptor.java.patch 
$ cd code/email_34/
$ ant
$ ls dist/email_34.war 
dist/email_34.war

And don't forget to start the HSQLDB server:

$ java -cp ../lib/hsqldb/hsqldb.jar org.hsqldb.Server -database.0 file:webmail 
-dbname.0 webmail &

http://www.hsqldb.org/doc/guide/ch01.html

:-)
--- code-original/email_34/src/stripesbook/ext/LoginInterceptor.java
+++ code/email_34/src/stripesbook/ext/LoginInterceptor.java
@@ -55,8 +55,7 @@
         Class<? extends ActionBean> cls = actionBean.getClass();
 
         if (ctx.getUser() == null && !ALLOW.contains(cls)) {
- /*
-            resolution = new RedirectResolution(LoginActionBean.class)
+            resolution = new RedirectResolution(LoginActionBean.class);
 
             resolution = new RedirectResolution(LoginActionBean.class);
             if (ctx.getRequest().getMethod().equalsIgnoreCase("GET")) {
------------------------------------------------------------------------------
EditLive Enterprise is the world's most technically advanced content
authoring tool. Experience the power of Track Changes, Inline Image
Editing and ensure content is compliant with Accessibility Checking.
http://p.sf.net/sfu/ephox-dev2dev
_______________________________________________
Stripes-users mailing list
Stripes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/stripes-users

Reply via email to