Re: [Stripes-users] Stripes Today

2018-10-12 Thread Janne Jalkanen

I have a fairly large production installation running on Stripes serving 
~billion API calls/month, so it’s very much in active use. Works great! :-)

May you have energy and success!
/Janne



> On 12 Oct 2018, at 15:56, DJDaveMark via Stripes-users 
>  wrote:
> 
> Hi,
> 
> Just wondered how many people on this list still work with projects using 
> Stripes?
> 
> I only ever managed to convince 2 project managers to use Stripes (both with 
> Spring/Hibernate), and I had a brief encounter with JAX-RS. Lately I've 
> mostly been on projects using Node (Express/Sequelize).
> 
> Cheers,
> Dave
> .
> ___
> Stripes-users mailing list
> Stripes-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/stripes-users

___
Stripes-users mailing list
Stripes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/stripes-users


Re: [Stripes-users] Stripes and Paypal IPN

2017-05-28 Thread Janne Jalkanen
Looking at our own codebase (which isn’t unfortunately public), it seems to be 
a fairly straightforward POST handler.  All you need to do is to parse the 
IPNMessage out of the request, and you should be fine, and luckily Paypal 
provides a library to do just that.

Basically we have something like this:

@DefaultHandler
public Resolution receiveEvent()
{
if( !"post".equalsIgnoreCase( getContext().getRequest().getMethod() ) )
{
return new ErrorResolution( HttpServletResponse.SC_METHOD_NOT_ALLOWED );
}

Map configMap = new HashMap();
configMap.put( "mode", c_mode );

IPNMessage message = new IPNMessage( getContext().getRequest(), configMap );
if(!message.validate()) { …handle error… }
return processMessage(message);
}

May you have energy and success!
/Janne



> On 25 May 2017, at 17:10, Nestor Hernandez  wrote:
> 
> The integration with any payment gateway is not necessary related with a web 
> framework. Furthermore, it is a responsability of the bussiness layer not of 
> the presentation layer (Stripes). 
> 
> Regards.
> 
> 2017-05-25 2:17 GMT-05:00 Heather and Jon Turgeon 
> >:
> Hi all, since I seem to get some great advice from you all I thought I would 
> ask if anyone has setup a Stripes action to handle Paypal IPN? I have started 
> my action but thought I would ask to see if there is a better way. Thanks 
> again.
> 
> 
> Jon
> 
> 
> --
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot 
> 
> ___
> Stripes-users mailing list
> Stripes-users@lists.sourceforge.net 
> 
> https://lists.sourceforge.net/lists/listinfo/stripes-users 
> 
> 
> 
> --
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! 
> http://sdm.link/slashdot___
> Stripes-users mailing list
> Stripes-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/stripes-users

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
Stripes-users mailing list
Stripes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/stripes-users


Re: [Stripes-users] CMS Integration with Stripes

2015-03-03 Thread Janne Jalkanen

Supporting Apache Shiro (which I highly recommend; it’s really good) in any 
Stripes app is pretty easy:

http://www.ecyrd.com/ButtUgly/wiki/Main_blogentry_100910_1

You can then e.g. have your own Interceptor or actionbean superclass which does 
Subject.login() based on e.g. OAuth headers or cookies or whatever you fancy.  
We use something like this:

@Before(stages=LifecycleStage.BindingAndValidation)
public void resolveAccessToken()
{
String bearer = getContext().getRequest().getHeader( Authorization );
String at = getContext().getRequest().getParameter(access_token);

if( bearer != null )
{
at = bearer.substring( AUTH_BEARER.length() ).trim();
}

/* some validation omitted due to brevity */

if( at != null )
{
try
{
AccessToken token = new AccessToken(at);

SecurityUtils.getSubject().login( token );
}
catch( Exception e )
{
/* some code here */
}
}
}

/Janne

On 3 Mar 2015, at 00:35, Nestor Hernandez ilu...@gmail.com wrote:

 One option could be Standard Servlet security offers Basic auth, SSL and 
 other goodies. Configure your web.xml pointing to an actionbean url
 
 El mar 2, 2015 4:38 PM, Joaquin Valdez joaquinfval...@gmail.com escribió:
 Thanks Rick!  Off topic a bit,  but how are login credentials handled with 
 this framework when calling a rest method?
 
 Thanks 
 Joaquin 
 
 
 
 On Feb 28, 2015, at 7:13 AM, Rick Grashel rgras...@gmail.com wrote:
 
 Hi guys,
 
 I also had similar issues writing REST services with Stripes.  I absolutely 
 did not want to get rid of Stripes, so I had to write a REST ActionBean 
 framework for Stripes which supported all of Stripes validation and binding. 
  If you are interested, you can download it here:
 
 https://github.com/rgrashel/stripes-rest
 
 I can help anybody out with implementation of a REST service if they need 
 it.  But for this library, full Stripes validation is supported.  It uses 
 the same convention approach that Stripes uses, so you write get(), 
 post(), delete(), head(), put() methods and they will be automatically 
 called.  It also uses Stripes' own internal Javascript builder and has a new 
 JsonResolution to create JSON-based responses.
 
 Give it a look if you are interested.  I have been using it in production 
 for quite awhile and it works well.
 
 Thanks.
 
 -- Rick
 
 
 On Sat, Feb 28, 2015 at 7:17 AM, Janne Jalkanen janne.jalka...@ecyrd.com 
 wrote:
 
 We’ve just been lazy and done
 
 public Resolution foo()
 {
  switch( getContext().getRequest().getMethod() )
  {
   case “post”:
  return doPost();
case “get”
  return doGet()
case “delete”:
  return doDelete();
   default:
  return new ErrorResolution( … );
  }
 }
 
 What’s a bit more difficult is to incorporate validation into this, but we 
 basically have a superclass which has something like this:
 
 /**
  *  Normally Stripes turns validation errors into HTML, but since this 
 is an API,
  *  we turn it into JSON.  Returns a JSON resolution with a single
  *  field error which then contains a number of errors.
  */
 @Override
 public Resolution handleValidationErrors( ValidationErrors errors )
 {
 JSONObject obj = new JSONObject();
 
 obj.put( error, constructErrorObject(errors) );
 
 return new JSONResolution( HttpServletResponse.SC_BAD_REQUEST, obj );
 }
 
 /**
  *  Turns a ValidationErrors document into JSON.
  *
  *  @param errors
  *  @return
  */
 private Object constructErrorObject( ValidationErrors errors )
 {
 JSONObject obj = new JSONObject();
 
 if( !errors.hasFieldErrors() )
 {
 if( errors.containsKey( ValidationErrors.GLOBAL_ERROR ) )
 {
 obj.put( code, ERR_VALIDATION );
 obj.put( description, errors.get( 
 ValidationErrors.GLOBAL_ERROR ).get( 0 ).getMessage( 
 getContext().getLocale() ) );
 }
 }
 else
 {
 for( ListValidationError list : errors.values() )
 {
 obj.put( code, ERR_VALIDATION );
 obj.put( description, list.get(0).getFieldName() + : + 
 list.get( 0 ).getMessage( getContext().getLocale() ) );
 }
 }
 
 obj.put(status, 400);
 
 return obj;
 }
 
 JSONResolution is a custom class which has this in its heart:
 
 protected static ObjectMapper c_mapper = new ObjectMapper();
 protected static ObjectMapper c_prettyMapper = new ObjectMapper();
 
 static
 {
 c_prettyMapper.configure( SerializationFeature.INDENT_OUTPUT, true );
 }
 
 @Override
 public void

Re: [Stripes-users] CMS Integration with Stripes

2015-02-28 Thread Janne Jalkanen

We’ve just been lazy and done

public Resolution foo()
{
 switch( getContext().getRequest().getMethod() )
 {
  case “post”:
return doPost();
  case “get”
return doGet()
  case “delete”:
return doDelete();
  default:
return new ErrorResolution( … );
}
}

What’s a bit more difficult is to incorporate validation into this, but we 
basically have a superclass which has something like this:

/**
 *  Normally Stripes turns validation errors into HTML, but since this is 
an API,
 *  we turn it into JSON.  Returns a JSON resolution with a single
 *  field error which then contains a number of errors.
 */
@Override
public Resolution handleValidationErrors( ValidationErrors errors )
{
JSONObject obj = new JSONObject();

obj.put( error, constructErrorObject(errors) );

return new JSONResolution( HttpServletResponse.SC_BAD_REQUEST, obj );
}

/**
 *  Turns a ValidationErrors document into JSON.
 *
 *  @param errors
 *  @return
 */
private Object constructErrorObject( ValidationErrors errors )
{
JSONObject obj = new JSONObject();

if( !errors.hasFieldErrors() )
{
if( errors.containsKey( ValidationErrors.GLOBAL_ERROR ) )
{
obj.put( code, ERR_VALIDATION );
obj.put( description, errors.get( 
ValidationErrors.GLOBAL_ERROR ).get( 0 ).getMessage( getContext().getLocale() ) 
);
}
}
else
{
for( ListValidationError list : errors.values() )
{
obj.put( code, ERR_VALIDATION );
obj.put( description, list.get(0).getFieldName() + : + 
list.get( 0 ).getMessage( getContext().getLocale() ) );
}
}

obj.put(status, 400);

return obj;
}

JSONResolution is a custom class which has this in its heart:

protected static ObjectMapper c_mapper = new ObjectMapper();
protected static ObjectMapper c_prettyMapper = new ObjectMapper();

static
{
c_prettyMapper.configure( SerializationFeature.INDENT_OUTPUT, true );
}

@Override
public void execute( HttpServletRequest request, HttpServletResponse 
response ) throws Exception
{
response.setStatus( m_status );
response.setContentType( m_contentType );
response.setCharacterEncoding( UTF-8 );

if( true.equals(request.getParameter( pretty )) )
c_prettyMapper.writeValue( response.getOutputStream(), m_object );
else
c_mapper.writeValue( response.getOutputStream(), m_object );

response.getOutputStream().flush();
}

This btw lets you just get nice JSON back from any API call by adding 
“pretty=true” to the request URL.  This has proven to be invaluable while 
debugging.

One important caveat is that to protect against CSRF attacks you will want to 
make sure that every single one of your API endpoints handles GET requests 
properly. Since Stripe does not really differentiate between GET and POST, you 
might accidentally allow people to make changes to your DB using a GET method.  
We just limit the allowable methods via an annotation and an interceptor.

Stripe is OK for REST API development; more modern frameworks like Dropwizard 
do make some things a bit easier though (btw, Dropwizard+Guice has a lot of the 
same feel as Stripe for development - though Stripe’s templating system is 
still pretty darned powerful and I haven’t really found an equivalent).

/Janne

 On 28 Feb 2015, at 14:56 , Juan Pablo Santos Rodríguez 
 juanpablo.san...@gmail.com wrote:
 
 Hi,
 
 we've been in the same situation, and we've used the same double approach 
 described by Remi: facing public, CMS-heavy sites using REST-like services 
 provided by Stripes, whereas transactional applications are invoking CMS's 
 services via its REST services. 
 
 The only downside with this approach is that modern js frameworks are more 
 prepared to use true/full/complete/you-name-it REST services (= a post on an 
 URL is not the same as a GET), which is complex to achieve if using Stripes, 
 as you'd have to make your ActionBeans aware of the http verb (maybe 
 extending @URLBinding, @HandleEvent, etc. maybe with a new @Verb), and write 
 your ActionBeanResolver, so it can understand all the previous. We felt we 
 were going to modify too much Stripes internals, so we chose instead to make 
 calls to some URLs managed by Stripes' apps which return some JSON. 
 
 Btw, we'd love to hear if someone has tried any other approach to serve true 
 REST services with Stripes.
 
 Lastly, another approach you could use is to try portofino 
 (http://portofino.manydesigns.com/ http://portofino.manydesigns.com/). It 
 has CMS capabilities, it's Stripes-based, has user/roles, different kind of 

Re: [Stripes-users] Stripes Ajax calls on error

2014-09-30 Thread Janne Jalkanen

I suppose you mean validation errors in particular?  We use something like this 
in our AbstractApiActionBean from which all our Api beans inherit from:

/**
 *  Normally Stripes turns validation errors into HTML, but since this is 
an API,
 *  we turn it into JSON.  Returns a JSON or JSONP resolution with a single
 *  field error which then contains a number of errors.
 */
@Override
public Resolution handleValidationErrors( ValidationErrors errors )
{
JSONObject obj = new JSONObject();

obj.put( error, constructErrorObject(errors) );

if( m_callback != null )
return new JSONPResolution( m_callback, obj );

return new JSONResolution( HttpServletResponse.SC_BAD_REQUEST, obj );
}

/Janne

On 30 Sep 2014, at 17:01, Yann Bourdeau ybourd...@mnubo.com wrote:

 Hello,
 
   I was wondering is it possible to have an Ajax Call in a Stripes 
 handler to return an error code and specific body (like a JSON) instead of 
 the default HTML error message in ErrorResolution. I use StreamingResolution 
 for returning JSON on successful call and ErrorResolution to returns an 
 error. However, ErrorResolution returns an html text body and i’d like to 
 return a JSON containing the error. It will be easier to parse in JQuery. Any 
 idea?
 
 thanks
 
 Yann Bourdeau, M. Ing.
 514-219-4607
 ybourd...@mnubo.com
 
 
 
 
 -- 
 
 
 CONFIDENTIALITY: This e-mail message (including attachments, if any) is 
 confidential and is intended only for the addressee. Any unauthorized use 
 or disclosure is strictly prohibited. Disclosure of this e-mail to anyone 
 other than the intended addressee does not constitute waiver of privilege. 
 If you have received this communication in error, please notify us 
 immediately and delete this. Thank you for your cooperation.  This message 
 has not been encrypted.  Special arrangements can be made for encryption 
 upon request.
 
 CONFIDENTIALITÉ:  Ce message courriel (y compris les pièces jointes, le cas 
 échéant) est confidentiel et destiné uniquement à la personne ou  à 
 l'entité à qui il est adressé. Toute utilisation ou divulgation non permise 
 est strictement interdite.  L'obligation de confidentialité et de secret 
 professionnel demeure malgré toute divulgation.  Si vous avez reçu le 
 présent courriel et ses annexes par erreur, veuillez nous en informer 
 immédiatement et le détruire.  Nous vous remercions de votre 
 collaboration.  Le présent message n'a pas été crypté.  Le cryptage est 
 possible sur demande spéciale.
 
 --
 Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
 Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
 Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
 Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
 http://pubads.g.doubleclick.net/gampad/clk?id=154622311iu=/4140/ostg.clktrk
 ___
 Stripes-users mailing list
 Stripes-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/stripes-users

--
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311iu=/4140/ostg.clktrk___
Stripes-users mailing list
Stripes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/stripes-users


[Stripes-users] Github?

2014-06-03 Thread Janne Jalkanen

In fixing http://www.stripesframework.org/jira/browse/STS-919 I got a 
suggestion from Remi to make a pull request on github. However, I cannot find a 
reference to the official Stripes github project on stripesframework.org. In 
fact, I can only find links to Sourceforge, and even from the official SF page 
you get redirected back to stripesframework.org.

Is this a bug that should be fixed? Where is Stripes source code officially 
hosted now?

/Janne
--
Learn Graph Databases - Download FREE O'Reilly Book
Graph Databases is the definitive new guide to graph databases and their 
applications. Written by three acclaimed leaders in the field, 
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech
___
Stripes-users mailing list
Stripes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/stripes-users


Re: [Stripes-users] validation return url

2014-06-02 Thread Janne Jalkanen

Yup.

In your ActionBean, try something like this:

@Override
public Resolution handleValidationErrors( ValidationErrors errors ) throws 
Exception
{
return new ForwardResolution(“/MainForm?id=3);
}

/Janne

On 2 Jun 2014, at 04:23, Joaquin Valdez joaquinfval...@gmail.com wrote:

 Hello!
 
 Is it possible to control the return url when a validation error is triggered 
 by the following line:
 
 @Validate(required = true)
 private String customername;
 
 If I do not fill in customer name, it goes back to MainForm.action.  I would 
 like to adjust that so it goes back to MainForm.action?id=3
 
 Thank you
 Joaquin Valdez
 
 --
 Learn Graph Databases - Download FREE O'Reilly Book
 Graph Databases is the definitive new guide to graph databases and their 
 applications. Written by three acclaimed leaders in the field, 
 this first edition is now available. Download your free book today!
 http://p.sf.net/sfu/NeoTech___
 Stripes-users mailing list
 Stripes-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/stripes-users

--
Learn Graph Databases - Download FREE O'Reilly Book
Graph Databases is the definitive new guide to graph databases and their 
applications. Written by three acclaimed leaders in the field, 
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech___
Stripes-users mailing list
Stripes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/stripes-users


Re: [Stripes-users] StreamingResolution, byte[] and (char) 26

2014-05-24 Thread Janne Jalkanen

You’re right, this probably is not a Stripes issue, but the client does not 
like what you’re sending. It’s hard to say what’s going on without seeing the 
client code…  My guess is that the parser at the client end is not very 
permissive, and it’ll choke if you just have a wrong byte sequence.  

If you don’t have source code to the client (or access to its own log files), 
one possibility would be to get a known good byte array and compare it with 
whatever you’re sending back with Stripes, and just try to reverse-engineer the 
correct format (‘cos it sounds like the correct format is defined by the 
implementation, not the spec in this case).

Also, make sure that you don’t have any issues with networking by e.g. running 
the client and server on your local machine.

/Janne

On 24 May 2014, at 11:11 , Heather and Jon Turgeon 
tashiba40_evergr...@hotmail.com wrote:

 Hi, will add the try/catch. I think the issue is because char 26 is 
 traditionally EOF character. I need to include this character in the middle 
 of the byte array (the file to download). This seems to be causing the 
 
 ClientAbortException:  java.net.SocketException: Connection reset
 at 
 org.apache.catalina.connector.OutputBuffer.realWriteBytes(OutputBuffer.java:406)
 at org.apache.tomcat.util.buf.ByteChunk.append(ByteChunk.java:371)
 at 
 org.apache.catalina.connector.OutputBuffer.writeBytes(OutputBuffer.java:431)
 at org.apache.catalina.connector.OutputBuffer.write(OutputBuffer.java:419)
 at 
 org.apache.catalina.connector.CoyoteOutputStream.write(CoyoteOutputStream.java:91)
 at 
 org.apache.catalina.connector.CoyoteOutputStream.write(CoyoteOutputStream.java:84)
 at 
 org.apache.catalina.filters.ExpiresFilter$XServletOutputStream.write(ExpiresFilter.java:980)
 at 
 com.venturefarther.action.kap.MarkerKapDownloadActionBean$1.stream(MarkerKapDownloadActionBean.java:109)
 at 
 net.sourceforge.stripes.action.StreamingResolution.execute(StreamingResolution.java:240)
 at 
 net.sourceforge.stripes.controller.DispatcherHelper$7.intercept(DispatcherHelper.java:497)
 at 
 net.sourceforge.stripes.controller.ExecutionContext.proceed(ExecutionContext.java:158)
 at 
 net.sourceforge.stripes.controller.HttpCacheInterceptor.intercept(HttpCacheInterceptor.java:99)
 at 
 net.sourceforge.stripes.controller.ExecutionContext.proceed(ExecutionContext.java:155)
 at 
 net.sourceforge.stripes.controller.BeforeAfterMethodInterceptor.intercept(BeforeAfterMethodInterceptor.java:113)
 at 
 net.sourceforge.stripes.controller.ExecutionContext.proceed(ExecutionContext.java:155)
 at 
 net.sourceforge.stripes.controller.ExecutionContext.wrap(ExecutionContext.java:74)
 at 
 net.sourceforge.stripes.controller.DispatcherHelper.executeResolution(DispatcherHelper.java:491)
 at 
 net.sourceforge.stripes.controller.DispatcherServlet.executeResolution(DispatcherServlet.java:286)
 at 
 net.sourceforge.stripes.controller.DispatcherServlet.service(DispatcherServlet.java:170)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
 at 
 org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
 at 
 org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
 at 
 net.sourceforge.stripes.controller.StripesFilter.doFilter(StripesFilter.java:260)
 at 
 org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
 at 
 org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
 at 
 org.apache.catalina.filters.ExpiresFilter.doFilter(ExpiresFilter.java:1179)
 at 
 org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
 at 
 org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
 at 
 org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
 at 
 org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
 at 
 org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
 at 
 org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
 at 
 org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
 at 
 org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
 at 
 org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
 at 
 org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
 at 
 org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1008)
 at 
 org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
 at 
 org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310)
 at 
 

Re: [Stripes-users] Upload status

2014-05-19 Thread Janne Jalkanen

Something like this is probably the easiest way:

https://github.com/blueimp/jQuery-File-Upload

/Janne

On 19 May 2014, at 09:43, Heather and Jon Turgeon 
tashiba40_evergr...@hotmail.com wrote:

 Hi all, well I finally got my app deployed, now just waiting for the users to 
 pour in ;-)
 
 Anyway, one of the features that I would like to improve is the file upload 
 process. Right now I am using the File tag and the upload works well. What I 
 want to improve on my site is any kind of upload status percent, like when 
 you upload an image to Picasa. Is this possible and if so could you point me 
 in the right direction. Thanks.
 
 Jon
 
 www.venturefarther.com a website to share markers with cruising sailors.
 --
 Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
 Instantly run your Selenium tests across 300+ browser/OS combos.
 Get unparalleled scalability from the best Selenium testing platform available
 Simple to use. Nothing to install. Get started now for free.
 http://p.sf.net/sfu/SauceLabs___
 Stripes-users mailing list
 Stripes-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/stripes-users

--
Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos.
Get unparalleled scalability from the best Selenium testing platform available
Simple to use. Nothing to install. Get started now for free.
http://p.sf.net/sfu/SauceLabs___
Stripes-users mailing list
Stripes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/stripes-users


Re: [Stripes-users] switch to https

2013-04-19 Thread Janne Jalkanen

I just simply inherited StripesFormTag to provide my own SecureStripesFormTag 
which is smart enough to force SSL in form submission if it's not enabled 
before.  The code looks like this

public class SecureFormTag extends FormTag
{
@Override
protected String buildAction()
{
String action = super.buildAction();

return HttpUtil.httpsify(action);
}
}

where httpsify() just takes an action and returns it as a secure URL.  Note 
that you will need to be able to handle relative URLs when you do this. The 
good thing is that this works just like you would expect within Stripes.

/Janne

On Apr 19, 2013, at 19:30 , Joaquin Valdez joaquinfval...@gmail.com wrote:

 This is how I do it in an ActionBean:
 
   @DefaultHandler
   @DontValidate
   public Resolution form() {

   if (getContext().getRequest().isSecure()) {
 return new ForwardResolution(WELCOME);
   } else {
 return new RedirectResolution(https://www; + 
 getContext().getRootCookieDomain() + / 
 +getContext().getRequest().getContextPath(),false);
   }
   }
 
 -Joaquin
 
 
 On Apr 19, 2013, at 8:55 AM, Stone, Timothy tst...@barclaycardus.com 
 wrote:
 
 This seems to me to be a solved problem that is not directly a Stripes 
 problem or a problem needing to be found in a Stripes solution.
  
 1.   You can do this in Apache (not so much direct Tomcat, where Chris, 
 downthread, gives an application context solution)
 In your Directory, Location or VHost, require SSL:
 SSLRequireSSL # this will outright deny access with HTTPS. May not be what 
 you need.
 
 We actually force SSL in non-secure domains with a RewriteCond and Rule
 RewriteCond %{HTTPS} != “on”
 RewriteRule  ^/(.*)$ https://www.domain.com/$1
 
 2.   If you want to force HTTPS in a login, POST to HTTPS, e.g, form 
 action=”https://...”  method=”post” ..., this will force negotiation of the 
 secure channel before accidently leaking login information
 This technique was formerly discouraged, but in wide use today. It will also 
 solve the session state issue.
 
 Hope this helps,
 Tim
  
 From: Chris Cheshire [mailto:cheshira...@gmail.com] 
 Sent: Friday, April 19, 2013 11:35 AM
 To: Stripes Users List
 Subject: Re: [Stripes-users] switch to https
  
 I use essentially the same thing - the Tuckey URLRewrite servlet filter. 
 Unfortunately it breaks form posts which is why I was wondering whether 
 there is a way to build the url with https.
  
  
 
 On Fri, Apr 19, 2013 at 11:28 AM, Adam Stokar ajsto...@gmail.com wrote:
 I use a stripes interceptor.  If any request comes in that is supposed to be 
 secure, it will redirect to the https version.
  
 if(isSecure(request)  url.indexOf(https) != 0) {
 
 url = url.replace(http, https);
 
 return new RedirectResolution(url,false);
 
 }
 
  
 
 On Fri, Apr 19, 2013 at 11:22 AM, Chris Cheshire cheshira...@gmail.com 
 wrote:
 No, I want to know how to switch from http to https without using url 
 rewriting (apache, tomcat filter) if possible. I'm fine with everything 
 being https once the switch is made, I just need to know how to make the 
 switch when building links via stripes:link or stripes:form where possible.
  
 
 On Fri, Apr 19, 2013 at 10:18 AM, Adam Stokar ajsto...@gmail.com wrote:
 I had to deal with this a long time ago.  The best solution was to make all 
 pages use https.  When you switch from http to https, a new session id is 
 created and it complicates everything.  Is there a reason you need http?
  
 
 On Fri, Apr 19, 2013 at 10:13 AM, Chris Cheshire cheshira...@gmail.com 
 wrote:
 How do I tell a stripes:link or stripes:form that I want it to switch to 
 https? Eg. Start at a non-secure page and switch to https on login.
  
 Do I have to use url rewrite rules, or is there something in Stripes I can 
 use?
  
 Thanks
 
 Chris
  
 --
 Precog is a next-generation analytics platform capable of advanced
 analytics on semi-structured data. The platform includes APIs for building
 apps and a phenomenal toolset for data science. Developers can use
 our toolset for easy data analysis  visualization. Get a free account!
 http://www2.precog.com/precogplatform/slashdotnewsletter
 ___
 Stripes-users mailing list
 Stripes-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/stripes-users
 
  
 
 --
 Precog is a next-generation analytics platform capable of advanced
 analytics on semi-structured data. The platform includes APIs for building
 apps and a phenomenal toolset for data science. Developers can use
 our toolset for easy data analysis  visualization. Get a free account!
 http://www2.precog.com/precogplatform/slashdotnewsletter
 ___
 Stripes-users mailing list
 

Re: [Stripes-users] how to properly assign ActionBean to root url?

2012-12-29 Thread Janne Jalkanen

Can you post your web.xml config, please? My suspicion is that there may be a 
problem with the configuration.

/Janne

On Dec 29, 2012, at 21:40 , Noobmeter Admin ad...@noobmeter.com wrote:

 Yes, I'm using it. But it doesn't seem to help.
 
 Any other ideas? 
 
 Regards,
 John
 
 From: Janne Jalkanen Janne.Jalkanen@...
 Subject: Re: how to properly assign ActionBean to root url?
 Newsgroups: gmane.comp.java.stripes.user
 Date: 2012-12-29 15:03:41 GMT (4 hours and 16 minutes ago)
 
 
 You have to use the DynamicMappingFilter.
 
 http://stripes.sourceforge.net/docs/current/javadoc/net/sourceforge/stripes/controller/DynamicMappingFilter.html
 
 /Janne
 
 On Dec 29, 2012, at 12:50 , Noobmeter Admin 
 admin-ahxvawymexf54taoqty...@public.gmane.org wrote:
 
 I'm trying to display some dynamic information on the 
 http://www.mywebsite.com/ screen (so / URL) and it doesn't seem to work. 
 In this example the root() handler is called, but ${actionBean} in JSP is 
 empty.
 
 
 RootActionBean.java:
 
 at UrlBinding(/)
 public class RootActionBean extends BaseActionBean {
 at DefaultHandler
 public Resolution root() {
 return new ForwardResolution(index.jsp);
 }
 }
 
 index.jsp:
 
 % at page contentType=text/html; charset=UTF-8 % 
 
 % at taglib prefix=stripes 
 uri=http://stripes.sourceforge.net/stripes.tld; %
 
 stripes:layout-render name=/layout/default.jsp
 stripes:layout-component name=contents
 Context: ${actionBean.context}
 /stripes:layout-component
 /stripes:layout-render
 
 However, if I change  at UrlBinding(/) to  at UrlBinding(/asdf) then 
 for http://www.mywebsite.com/asdf everything works fine.
 
 I'm using Jetty.
 
 Any help will be appreciated!
 
 Regards,
 John
 
 --
 Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
 MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
 with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
 MVPs and experts. SALE $99.99 this month only -- learn more at:
 http://p.sf.net/sfu/learnmore_122912___
 Stripes-users mailing list
 Stripes-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/stripes-users

--
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. SALE $99.99 this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122912___
Stripes-users mailing list
Stripes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/stripes-users


Re: [Stripes-users] Ajax Form Validation

2012-09-03 Thread Janne Jalkanen

I use something like this from an AbstractApiActionBean

/**
 *  Normally Stripes turns validation errors into HTML, but since this is 
an API,
 *  we turn it into JSON.  Returns a JSON or JSONP resolution with a single
 *  field error which then contains a number of errors.
 */
@Override
public Resolution handleValidationErrors( ValidationErrors errors ) throws 
Exception
{
JSONObject obj = new JSONObject();

obj.put( error, constructErrorObject(errors) );

return getJSONResolution( obj );
}

where constructErrorObjects() just turns the errors into a JSON object, { 
field1: [error1,error2], field2: [error1, error2] }.

/Janne

On 2 Sep 2012, at 19:56, Gérald Quintana wrote:

 Hi,
 
 Stripes is very nice for Form validation thanks to annotations, and Stripes 
 is nice for Ajax request handling. But handling validation errors when a form 
 is submitted with Ajax is not immediate. A recent article about Spring MVC 
 awoke my desire to have something more efficient.
 http://blog.springsource.org/2012/08/29/integrating-spring-mvc-with-jquery-for-validation-rules/
 
 What's you approach for displaying errors when submitting a form using Ajax? 
 Returning page fragments? Returning error messages in JSON?
 
 Just to share: I tried something very similar to Spring blog, tell me what 
 you think.
 https://github.com/gquintana/stripes-jquery (then 
 AjaxCalculator.jsp/AjaxCalculatorAction).
 
 Cheers,
 Gérald
 --
 Live Security Virtual Conference
 Exclusive live event will cover all the ways today's security and 
 threat landscape has changed and how IT managers can respond. Discussions 
 will include endpoint security, mobile security and the latest in malware 
 threats. 
 http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/___
 Stripes-users mailing list
 Stripes-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/stripes-users

--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/___
Stripes-users mailing list
Stripes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/stripes-users


Re: [Stripes-users] Layout reuse like a component

2012-01-31 Thread Janne Jalkanen

Ditto.  We can't upgrade out of 1.5.3 :-/

(Can we please get the old layout code back as an option, please?)

/Janne

On 31 Jan 2012, at 15:38, Mike McNally wrote:

 Since 1.5.4, using nested layouts has been somewhat problematic. My
 site works in 1.5.3 but fails all over the place in any of the newer
 releases.
 
 On Tue, Jan 31, 2012 at 5:39 AM, Freddy Daoud xf2...@fastmail.fm wrote:
 Hi Moritz,
 
 Your code looks right to me. What error are you getting?
 
 Another way is to use a JSP .tag file:
 
 /tags/address.jsp:
 
 %@ tag body-content=scriptless %
 %@ attribute name=address required=true rtexprvalue=true
 type=com.example.model.Address %
 %@ include file=/jsp/taglibs.jsp %
 
 div${address.street}/div
 div${address.city}/div
 
 /jsp/taglibs.jsp:
 %-- stripes and JSP taglibs... --%
 %@ taglib prefix=yourPrefix tagdir=/tags %
 
 contact.jsp:
 
 h1Contact Sheet/h1
 div${actionBean.contact.name}/div
 yourPrefix:address=${actionBean.contact.address} /
 
 Then you can go ahead and add more .tag files to the /tags directory and
 use them with
 yourPrefix:name where name corresponds to the file name without the
 .jsp extension.
 
 Hope that helps.
 
 Cheers,
 Freddy
 http://www.fdaoud.com
 
 On Tue, Jan 31, 2012, at 10:13 AM, Moritz Petersen wrote:
 Hello everyone,
 
 maybe I'm missing something, but I have trouble doing the following:
 
 The idea is to define a piece of reusable JSP code, that can be
 embedded into other JSP pages. I thought it should be quite simple
 with Stripes' layout tags.
 
 Take an example: in some JSP pages I'd like to display address
 information, so I just want to implement that address view only once.
 
 contact.jsp:
 
 ...
 h1Contact Sheet/h1
 div${actionBean.contact.name}/div
 stripes:layout-render name=/layout/address.jsp
 address=${actionBean.contact.address} /
 ...
 
 address.jsp:
 
 ...
 stripes:layout-definition
   div${address.street}/div
   div${address.city}/div
   ...
 /stripes:layout-definition
 
 The idea is, to pass the address object to the reusable layout
 component and use it there.
 
 Is there any way to do this with Stripes? Any other recommendations?
 
 Thank you  regards,
 Moritz
 
 --
 Keep Your Developer Skills Current with LearnDevNow!
 The most comprehensive online learning library for Microsoft developers
 is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
 Metro Style Apps, more. Free future releases when you subscribe now!
 http://p.sf.net/sfu/learndevnow-d2d
 ___
 Stripes-users mailing list
 Stripes-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/stripes-users
 
 
 --
 Keep Your Developer Skills Current with LearnDevNow!
 The most comprehensive online learning library for Microsoft developers
 is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
 Metro Style Apps, more. Free future releases when you subscribe now!
 http://p.sf.net/sfu/learndevnow-d2d
 ___
 Stripes-users mailing list
 Stripes-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/stripes-users
 
 
 
 -- 
 Turtle, turtle, on the ground,
 Pink and shiny, turn around.
 
 --
 Keep Your Developer Skills Current with LearnDevNow!
 The most comprehensive online learning library for Microsoft developers
 is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
 Metro Style Apps, more. Free future releases when you subscribe now!
 http://p.sf.net/sfu/learndevnow-d2d
 ___
 Stripes-users mailing list
 Stripes-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/stripes-users


--
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
___
Stripes-users mailing list
Stripes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/stripes-users


Re: [Stripes-users] Layout reuse like a component

2012-01-31 Thread Janne Jalkanen

No, sorry. The reason is that our layout is getting so complicated that I 
cannot provide a simple test case for this, so the bug report would be pretty 
much useless.  It eez b0rken, no worky, plz fix isn't the kind of a bug 
report I'd like to receive myself... :-)

/Janne

On 31 Jan 2012, at 16:33, Ben Gunter wrote:

 I pleaded during the whole process of changing that code for people to test 
 it, and I didn't get much of a response. It has been well over a year since 
 it was finally released. Have either of you reported your problems via Jira? 
 (I just did a quick check and couldn't find any.)
 
 I have debated reverting the code. The problem is that when the new layout 
 code works, it fixes several other significant problems with the old layout 
 code that simply couldn't be fixed otherwise because of the way that code 
 worked. I'm considering reverting to the original and providing the streaming 
 version with a different URL.
 
 On Tue, Jan 31, 2012 at 8:47 AM, Janne Jalkanen janne.jalka...@ecyrd.com 
 wrote:
 
 Ditto.  We can't upgrade out of 1.5.3 :-/
 
 (Can we please get the old layout code back as an option, please?)
 
 /Janne
 
 On 31 Jan 2012, at 15:38, Mike McNally wrote:
 
  Since 1.5.4, using nested layouts has been somewhat problematic. My
  site works in 1.5.3 but fails all over the place in any of the newer
  releases.
 
  On Tue, Jan 31, 2012 at 5:39 AM, Freddy Daoud xf2...@fastmail.fm wrote:
  Hi Moritz,
 
  Your code looks right to me. What error are you getting?
 
  Another way is to use a JSP .tag file:
 
  /tags/address.jsp:
 
  %@ tag body-content=scriptless %
  %@ attribute name=address required=true rtexprvalue=true
  type=com.example.model.Address %
  %@ include file=/jsp/taglibs.jsp %
 
  div${address.street}/div
  div${address.city}/div
 
  /jsp/taglibs.jsp:
  %-- stripes and JSP taglibs... --%
  %@ taglib prefix=yourPrefix tagdir=/tags %
 
  contact.jsp:
 
  h1Contact Sheet/h1
  div${actionBean.contact.name}/div
  yourPrefix:address=${actionBean.contact.address} /
 
  Then you can go ahead and add more .tag files to the /tags directory and
  use them with
  yourPrefix:name where name corresponds to the file name without the
  .jsp extension.
 
  Hope that helps.
 
  Cheers,
  Freddy
  http://www.fdaoud.com
 
  On Tue, Jan 31, 2012, at 10:13 AM, Moritz Petersen wrote:
  Hello everyone,
 
  maybe I'm missing something, but I have trouble doing the following:
 
  The idea is to define a piece of reusable JSP code, that can be
  embedded into other JSP pages. I thought it should be quite simple
  with Stripes' layout tags.
 
  Take an example: in some JSP pages I'd like to display address
  information, so I just want to implement that address view only once.
 
  contact.jsp:
 
  ...
  h1Contact Sheet/h1
  div${actionBean.contact.name}/div
  stripes:layout-render name=/layout/address.jsp
  address=${actionBean.contact.address} /
  ...
 
  address.jsp:
 
  ...
  stripes:layout-definition
div${address.street}/div
div${address.city}/div
...
  /stripes:layout-definition
 
  The idea is, to pass the address object to the reusable layout
  component and use it there.
 
  Is there any way to do this with Stripes? Any other recommendations?
 
  Thank you  regards,
  Moritz
 
  --
  Keep Your Developer Skills Current with LearnDevNow!
  The most comprehensive online learning library for Microsoft developers
  is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
  Metro Style Apps, more. Free future releases when you subscribe now!
  http://p.sf.net/sfu/learndevnow-d2d
  ___
  Stripes-users mailing list
  Stripes-users@lists.sourceforge.net
  https://lists.sourceforge.net/lists/listinfo/stripes-users
 
 
  --
  Keep Your Developer Skills Current with LearnDevNow!
  The most comprehensive online learning library for Microsoft developers
  is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
  Metro Style Apps, more. Free future releases when you subscribe now!
  http://p.sf.net/sfu/learndevnow-d2d
  ___
  Stripes-users mailing list
  Stripes-users@lists.sourceforge.net
  https://lists.sourceforge.net/lists/listinfo/stripes-users
 
 
 
  --
  Turtle, turtle, on the ground,
  Pink and shiny, turn around.
 
  --
  Keep Your Developer Skills Current with LearnDevNow!
  The most comprehensive online learning library for Microsoft developers
  is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
  Metro Style Apps, more. Free future releases when you subscribe now!
  http://p.sf.net/sfu/learndevnow-d2d
  ___
  Stripes-users mailing list
  Stripes-users

Re: [Stripes-users] Code obfuscation

2011-11-25 Thread Janne Jalkanen

Um... Why would you obfuscate a web app? If an attacker has enough access to 
your server to read your JAR files, you've already got way worse problems than 
having the user decompile your app...

Anyway, Stripes uses Reflection quite heavily and depends on the method and 
field names to be the same at runtime. So probably obfuscation is breaking that 
somehow, so you'll just need to ensure that none of the critical field names 
are changed.  Also check that none of the class names you refer to in web.xml 
or in any config files are obfuscated.

/Janne

On 25 Nov 2011, at 10:26, Sylvain Brejeon wrote:

 Hi all,
 
 I'm trying to do some code obfuscation using http://proguard.sourceforge.net/.
 And pretty much all my classes are obfuscated except for a package where all 
 the Stripes related classes are (extensions and actionbeans).
 My webapp starts up normally. I don't see any errors in log files etc...
 My extensions seem to work. I've got an interceptor, an actionbeancontext and 
 a name resolver for removing .action for url bindings.
 I do have a common ActionBean class where the DefaultHandler resides.
 Without obfuscation everything is setup just fine and works.
 But with it, I see that strange problem where the requests all fall back on 
 the DefaultHandler instead of my events in my action beans.
 At this point I have no idea why it behaves like that.
 I would like to know if you guys have experimented something similar or have 
 some good pieces of advice.
 Thanks for your help
 Regards
 sbrejeon
 
 
 --
 All the data continuously generated in your IT infrastructure 
 contains a definitive record of customers, application performance, 
 security threats, fraudulent activity, and more. Splunk takes this 
 data and makes sense of it. IT sense. And common sense.
 http://p.sf.net/sfu/splunk-novd2d___
 Stripes-users mailing list
 Stripes-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/stripes-users

--
All the data continuously generated in your IT infrastructure 
contains a definitive record of customers, application performance, 
security threats, fraudulent activity, and more. Splunk takes this 
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d___
Stripes-users mailing list
Stripes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/stripes-users


Re: [Stripes-users] Code obfuscation

2011-11-25 Thread Janne Jalkanen

Make sure that your setters aren't mangled either, or your parameters won't be 
transmitted.

/Janne

On 25 Nov 2011, at 14:14, Sylvain Brejeon wrote:

 no need to be sorry mate.
 the two of you convinced me that it ought to be that the method names have 
 changed.
 of course it can't be otherwise. I probably misunderstood something in 
 proguard. I feel a bit stupid already.
 But thank you for pointing out the HandlesEvent annotation. So I'll still be 
 able to obfuscate the methods.
 I'll just keep field names and class names.
 I won't be able to check that before next monday. I'll keep you informed.
 Thank you very much
 Regards
 sbrejeon
 
 On Fri, Nov 25, 2011 at 9:46 PM, Iwao AVE haraw...@gmail.com wrote:
 You are right, the symptom doesn't fit...sorry.
 
 Another thought.
 Do you use @HandlesEvent annotation to declare event name explicitly?
 Because if you don't, obfuscation may change the event handler method
 name and it would break the event resolution.
 
 Regards,
 Iwao
 
 2011/11/25 Sylvain Brejeon sbrej...@daesim.com:
  @Janne
  Why would you obfuscate a web app?
  the web app will not be installed on our server but rather distributed to
  many companies. and we are in a beta/proof-of-concept/no-contract-yet phase
  where we need to release it to a few trusted partners and trusted
  beta-test customers and we would like a minimum of protection.
 
  ensure that none of the critical field names are changed
 
  I think I asked proguard to keep the ActionBeans and other Stripes classes
  intact. At least the class names are. But if it changed method names that
  would explain a lot indeed. I'll have to check that again. Thanks.
  @Iwao
  I saw the disappearing annotations issue in the troubleshooting section too.
  And I'm using the option. All my requests are falling back on my default
  handler annotated method
  so I think that the annotations are there.
  I'll keep looking
  Thank you both of you
  sbrejeon
 
 
  --
  All the data continuously generated in your IT infrastructure
  contains a definitive record of customers, application performance,
  security threats, fraudulent activity, and more. Splunk takes this
  data and makes sense of it. IT sense. And common sense.
  http://p.sf.net/sfu/splunk-novd2d
  ___
  Stripes-users mailing list
  Stripes-users@lists.sourceforge.net
  https://lists.sourceforge.net/lists/listinfo/stripes-users
 
 
 
 --
 All the data continuously generated in your IT infrastructure
 contains a definitive record of customers, application performance,
 security threats, fraudulent activity, and more. Splunk takes this
 data and makes sense of it. IT sense. And common sense.
 http://p.sf.net/sfu/splunk-novd2d
 ___
 Stripes-users mailing list
 Stripes-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/stripes-users
 
 --
 All the data continuously generated in your IT infrastructure 
 contains a definitive record of customers, application performance, 
 security threats, fraudulent activity, and more. Splunk takes this 
 data and makes sense of it. IT sense. And common sense.
 http://p.sf.net/sfu/splunk-novd2d___
 Stripes-users mailing list
 Stripes-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/stripes-users

--
All the data continuously generated in your IT infrastructure 
contains a definitive record of customers, application performance, 
security threats, fraudulent activity, and more. Splunk takes this 
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d___
Stripes-users mailing list
Stripes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/stripes-users


Re: [Stripes-users] Two way type conversion possible?

2011-11-13 Thread Janne Jalkanen

Date formatting is usually something that's done by the view component in a 
typical MVC model. I'm not sure that the Stripes ActionBean is the right place 
to solve this problem.

What we usually do is that we take the Date object up and until the view layer, 
then format it with JSTL on our JSP pages, e.g. 

 f:formatDate value=${user.registrationDate}/

If you find repeating yourself a lot, you could just create a special JSP tag 
for yourself. Or an EL function, if you're on a fairly recent spec level.

/Janne

On Nov 14, 2011, at 09:23 , ted_smith2...@comcast.net wrote:

 Hello:
 
 hi
 I am trying to create a custom date converter. but the the typeconverter api 
 only  allows one way, string - date
 I need to use the custom class to convert date back to string with special 
 logic for display. 
 The two way special conversion would only apply to the specific Date field.
 
 Using @Validate(converter=class)  only work one way, string - date
 I was expecting to have the single converter class to handle both 
 string - date   and date - string,  similar to other frameworks
 (I am actually converting from a different framework to stripes
 but stumbled on this issue, as the other framework has conversion method
 pair like  convertToString  and ConvertToObject.
 
 What should i do?
 
 Thanks in Advance.
 
 
 --
 RSA(R) Conference 2012
 Save $700 by Nov 18
 Register now
 http://p.sf.net/sfu/rsa-sfdev2dev1___
 Stripes-users mailing list
 Stripes-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/stripes-users

--
RSA(R) Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1___
Stripes-users mailing list
Stripes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/stripes-users


Re: [Stripes-users] What is the proper empty resolution for an ajax update?

2011-09-30 Thread Janne Jalkanen

Unfortunately not all Javascript frameworks like this. I've just been returning 
a StreamingResolution(application/json, {}); that seems to work across 
everything.  (JSONP requires then also the callback and a different MIME type.)

/Janne

On 30 Sep 2011, at 05:02, Freddy Daoud wrote:

 You could also return the 204 status code, which means success
 with No Content.
  
 Freddy
  
 On Friday, September 30, 2011 2:39 AM, Samuel Santos sama...@gmail.com 
 wrote:
 Are you expecting a JSON object?
 
 If so, you can return a JavaScriptResolution(null) or a 
 StreamingResolution(application/json, ).
 
 --
 Samuel Santos
 http://www.samaxes.com/
 
 
 On Fri, Sep 30, 2011 at 2:23 AM, fatefree fatef...@gmail.com wrote:
 
 Just curious, in the event of some ajax update which really supplies no
 response to the browser, what is the appropriate way to respond via a
 resolution? I have been returning null by default but firebug does not like
 that. Is there a specific status code I should return and perhaps
 encapsulate that with an EmptyResolution class?
 --
 View this message in context: 
 http://old.nabble.com/What-is-the-proper-empty-resolution-for-an-ajax-update--tp32553645p32553645.html
 Sent from the stripes-users mailing list archive at Nabble.com.
 
 
 --
 All of the data generated in your IT infrastructure is seriously valuable.
 Why? It contains a definitive record of application performance, security
 threats, fraudulent activity, and more. Splunk takes this data and makes
 sense of it. IT sense. And common sense.
 http://p.sf.net/sfu/splunk-d2dcopy2
 ___
 Stripes-users mailing list
 Stripes-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/stripes-users
 
 --
 All of the data generated in your IT infrastructure is seriously valuable.
 Why? It contains a definitive record of application performance, security
 threats, fraudulent activity, and more. Splunk takes this data and makes
 sense of it. IT sense. And common sense.
 http://p.sf.net/sfu/splunk-d2dcopy2
 ___
 Stripes-users mailing list
 Stripes-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/stripes-users
 
 
  
 --
 All of the data generated in your IT infrastructure is seriously valuable.
 Why? It contains a definitive record of application performance, security
 threats, fraudulent activity, and more. Splunk takes this data and makes
 sense of it. IT sense. And common sense.
 http://p.sf.net/sfu/splunk-d2dcopy2___
 Stripes-users mailing list
 Stripes-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/stripes-users

--
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security
threats, fraudulent activity, and more. Splunk takes this data and makes
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2dcopy2___
Stripes-users mailing list
Stripes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/stripes-users


Re: [Stripes-users] SCMWeb Runtime Exception - PHA - SAVOYM - QA

2011-06-09 Thread Janne Jalkanen

Yup. Just delete the contents of work, not work itself. 

/Janne

On 9 Jun 2011, at 15:56, Savoy, Melinda wrote:

 Thank you Janne and Ben.  If you guys don’t mind what is probably a stupid 
 question I would appreciate just a little more feedback. 
  
 Being new to Tomcat admin, I’d like to ask about the following.  In the 
 tomcat “work” directory I have a subdirectory called Catalina and within that 
 directory 2 more subdirectories called localhost and my app’s directory 
 called “scmis”.  I just want to confirm that I DO NOT delete the “work” 
 directory but only delete the contents of that directory which include the 
 subdirectories I’ve just identified?   Is that correct?
  
 Thank you again.   
  
  
  
 From: Ben Gunter [mailto:gunter...@gmail.com] 
 Sent: Thursday, June 09, 2011 7:44 AM
 To: Stripes Users List
 Subject: Re: [Stripes-users] SCMWeb Runtime Exception - PHA - SAVOYM - QA
  
 Yes, you need to clean up the cached compiled JSPs. There have been changes 
 in the 1.5.x series to the layout tags. Some of them now implement BodyTag 
 that did not before and vice versa.
  
 -Ben
 
 On Thu, Jun 9, 2011 at 12:53 AM, Janne Jalkanen janne.jalka...@ecyrd.com 
 wrote:
 
 Clean your servlet container compiled JSP pages. (e.g. empty the work 
 directory from $TOMCAT_HOME, other containers may differ) and ensure your 
 stripes.jar is not corrupted (jar tvf stripes-1.5.5.jar).
 
 I've seen this occasionally too, though only on dev systems. It's usually a 
 configuration/caching issue.
 
 /Janne
 
 On Jun 9, 2011, at 01:07 , Savoy, Melinda wrote:
 
  Sorry but I forgot to mention that we're running Stripes 1.5.5
 
  Thanks again.
 
  -Original Message-
  From: Savoy, Melinda
  Sent: Wednesday, June 08, 2011 5:06 PM
  To: 'Stripes Users List'
  Subject: FW: SCMWeb Runtime Exception - PHA - SAVOYM - QA
 
  We have a numerous web server regions where we run our Stripes web app. The 
  code that we have is identical across all our server regions (DEV, QA, UAT, 
  PROD).  Interesting enough just this afternoon, I started getting this 
  error in my QA region where I'm getting the following error:
 
  java.lang.NoSuchMethodError: 
  net.sourceforge.stripes.tag.layout.LayoutRenderTag.doAfterBody()I
at org.apache.jsp.index_jsp._jspService(index_jsp.java:263)
 
  We're getting this error as soon as we try to access our web site.
 
  The stack trace is directly below.
 
  Any suggestions on why this would be happening would be appreciated.  I'm 
  not sure why this would not be running in this server but running on all 
  our other web server regions.
 
  Thanks in advance for any direction/suggestions.
 
  -Original Message-
  From: SCMIS Application [mailto:nore...@texashealth.org]
  Sent: Wednesday, June 08, 2011 4:57 PM
  To: Savoy, Melinda; Burgoon, Ken
  Subject: SCMWeb Runtime Exception - PHA - SAVOYM - QA
 
 
  The SCMWeb Inventory/Purchasing system has encountered an ERROR.
 
  Login Account : SAVOYM
  Region: QA
  Entity: PHA
  Stack trace   : java.lang.NoSuchMethodError: 
  net.sourceforge.stripes.tag.layout.LayoutRenderTag.doAfterBody()I
at org.apache.jsp.index_jsp._jspService(index_jsp.java:263)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at 
  org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
at 
  org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at 
  org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at 
  org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at 
  net.sourceforge.stripes.controller.StripesFilter.doFilter(StripesFilter.java:247)
at 
  org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at 
  org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at root.servlet.HttpFilter.doFilter(HttpFilter.java:37)
at 
  org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at 
  org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at waffle.servlet.NegotiateSecurityFilter.doFilterPrincipal(Unknown 
  Source)
at waffle.servlet.NegotiateSecurityFilter.doFilter(Unknown Source)
at 
  org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at 
  org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at 
  org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233

Re: [Stripes-users] SCMWeb Runtime Exception - PHA - SAVOYM - QA

2011-06-08 Thread Janne Jalkanen

Clean your servlet container compiled JSP pages. (e.g. empty the work 
directory from $TOMCAT_HOME, other containers may differ) and ensure your 
stripes.jar is not corrupted (jar tvf stripes-1.5.5.jar).

I've seen this occasionally too, though only on dev systems. It's usually a 
configuration/caching issue.

/Janne

On Jun 9, 2011, at 01:07 , Savoy, Melinda wrote:

 Sorry but I forgot to mention that we're running Stripes 1.5.5
 
 Thanks again.
 
 -Original Message-
 From: Savoy, Melinda 
 Sent: Wednesday, June 08, 2011 5:06 PM
 To: 'Stripes Users List'
 Subject: FW: SCMWeb Runtime Exception - PHA - SAVOYM - QA
 
 We have a numerous web server regions where we run our Stripes web app. The 
 code that we have is identical across all our server regions (DEV, QA, UAT, 
 PROD).  Interesting enough just this afternoon, I started getting this error 
 in my QA region where I'm getting the following error:
 
 java.lang.NoSuchMethodError: 
 net.sourceforge.stripes.tag.layout.LayoutRenderTag.doAfterBody()I
   at org.apache.jsp.index_jsp._jspService(index_jsp.java:263)
 
 We're getting this error as soon as we try to access our web site.
 
 The stack trace is directly below.  
 
 Any suggestions on why this would be happening would be appreciated.  I'm not 
 sure why this would not be running in this server but running on all our 
 other web server regions.
 
 Thanks in advance for any direction/suggestions.
 
 -Original Message-
 From: SCMIS Application [mailto:nore...@texashealth.org] 
 Sent: Wednesday, June 08, 2011 4:57 PM
 To: Savoy, Melinda; Burgoon, Ken
 Subject: SCMWeb Runtime Exception - PHA - SAVOYM - QA
 
 
 The SCMWeb Inventory/Purchasing system has encountered an ERROR.
 
 Login Account : SAVOYM
 Region: QA
 Entity: PHA
 Stack trace   : java.lang.NoSuchMethodError: 
 net.sourceforge.stripes.tag.layout.LayoutRenderTag.doAfterBody()I
   at org.apache.jsp.index_jsp._jspService(index_jsp.java:263)
   at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
   at 
 org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
   at 
 org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
   at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
   at 
 org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
   at 
 org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
   at 
 net.sourceforge.stripes.controller.StripesFilter.doFilter(StripesFilter.java:247)
   at 
 org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
   at 
 org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
   at root.servlet.HttpFilter.doFilter(HttpFilter.java:37)
   at 
 org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
   at 
 org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
   at waffle.servlet.NegotiateSecurityFilter.doFilterPrincipal(Unknown 
 Source)
   at waffle.servlet.NegotiateSecurityFilter.doFilter(Unknown Source)
   at 
 org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
   at 
 org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
   at 
 org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
   at 
 org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
   at 
 org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
   at 
 org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
   at 
 org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
   at 
 org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
   at 
 org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:857)
   at 
 org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:565)
   at 
 org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1509)
   at java.lang.Thread.run(Thread.java:619)
 
 
 The information contained in this message and any attachments is intended 
 only for the use of the individual or entity to which it is addressed, and 
 may contain information that is PRIVILEGED, CONFIDENTIAL, and exempt from 
 disclosure under applicable law.  If you are not the intended recipient, you 
 are prohibited from copying, distributing, or using the information.  Please 
 contact the sender immediately by return e-mail and delete the original 
 message from your system.
 

Re: [Stripes-users] plugin strategies?

2011-04-20 Thread Janne Jalkanen
 As for the GIt conversion, I don't get it. We're not the Linux kernel. There 
 aren't zillions of patches pending to be applied every day. In fact, there 
 are pretty much zero patches. If folks want to make changes, and make a 
 difference, then make or find an issue on Jira, and submit a patch. There's 
 nothing in the toolset holding that up. When Ben throws up the white flag 
 because of the crushing load of source patches coming in to core instead of 
 just chatter on the ML, then maybe there's motivation to change to something 
 like Git.

I don't really care what Stripes uses (other than I have a deep dislike and 
fear of Maven, but I'm not the one who has to live with it ;-), but I think 
this is a misunderstanding of the power of Git. 

I don't use Git because I expect a lot of contributions. I use Git for all my 
own projects because of two reasons:

1) Local commits. You don't need IP connectivity to commit anything. This has 
the advantage that you can keep the workflow even while traveling or when the 
internet goes bad.
2) Easy branching and merging. It makes a lot of sense to always start a clean 
branch *from a stable root* when you're hacking on a feature. You can keep 
committing, tinker at will, and then finally merge the whole thing at the root, 
or just throw the branch away. This is especially valuable when multiple people 
work on the same tree (you get to keep the master stable and new features get 
merged in when they are stable(ish)), but it works really well when you're 
developing on your own too. I'm a bit ADHD when it comes to development, and I 
often try out different things. With SVN you need to keep multiple projects 
open, with Git you just switch between branches, cherry-pick changes, merge and 
branch.

In fact, whenever a project uses SVN, I just usually check it out as a Git 
project and use Git locally on it... Git has good SVN support, but a native Git 
project is always better.

Just my 2c.

/Janne
--
Benefiting from Server Virtualization: Beyond Initial Workload 
Consolidation -- Increasing the use of server virtualization is a top
priority.Virtualization can reduce costs, simplify management, and improve 
application availability and disaster protection. Learn more about boosting 
the value of server virtualization. http://p.sf.net/sfu/vmware-sfdev2dev
___
Stripes-users mailing list
Stripes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/stripes-users


Re: [Stripes-users] re quest/response scoping

2011-03-03 Thread Janne Jalkanen
 Again, I'm not attempting to prove that SpringMVC is better than Stripes,
 the question of interest is whether Stripes encourages bad practice from an
 OO point-of-view?

I suppose it depends on your definition of OO - I use subclassing in my 
ActionBeans so that I can share common parameters and validators efficiently. 
That is hard to do when your method arguments define the parameters.

Also, I could argue that it's a slightly better OO practice to have lots of 
small ActionBeans, rather than big ActionBeans that have multiple entry points. 
But it depends on what you think of as an Object in a web application sense, 
and how Model-centric your thinking is.

I don't really see either way as inherently bad practice.

/Janne
--
Free Software Download: Index, Search  Analyze Logs and other IT data in 
Real-Time with Splunk. Collect, index and harness all the fast moving IT data 
generated by your applications, servers and devices whether physical, virtual
or in the cloud. Deliver compliance at lower cost and gain new business 
insights. http://p.sf.net/sfu/splunk-dev2dev 
___
Stripes-users mailing list
Stripes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/stripes-users


Re: [Stripes-users] UTF8 from form to mySQL

2011-02-06 Thread Janne Jalkanen
 Basically, in addition to the other things I mentioned there indeed is one 
 Stripes configuration that I set... by creating a custom LocalePicker 
 subclass that picks the character encoding UTF-8... and dropping it the 
 configured Stripes extensions folder... the relevant code is as follows:

Ah, ok, thanks for the tip.

I still don't mind putting in the extra filter, since all my projects seem to 
have a ton of them anyway, and dropping in one extra line isn't much bother :-)

I imagine one could also put in a custom Interceptor, if we're in the process 
of listing different ways of enabling UTF-8 :-D

/Janne


--
The modern datacenter depends on network connectivity to access resources
and provide services. The best practices for maximizing a physical server's
connectivity to a physical network are well understood - see how these
rules translate into the virtual world? 
http://p.sf.net/sfu/oracle-sfdevnlfb
___
Stripes-users mailing list
Stripes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/stripes-users


Re: [Stripes-users] UTF8 from form to mySQL

2011-02-06 Thread Janne Jalkanen

It's easy to remember, fast, works across all containers and all frameworks. 
Not everyone has the luxury of working with a single framework, even one as 
awesome as Stripes.  It is not uncommon to have mixed code too, especially if 
you have a considerable array of ready-made servlets and filters to work from. 
Not everything needs to be always written from ground up using whichever 
framework happens to be the word-du-jour.

/Janne

On 7 Feb 2011, at 06:29, Nikolaos Giannopoulos wrote:

 Janne,
 
 Just curious why the need for the filter assuming all your requests go 
 through Stripes. Do you have other non-Stripe traffic or perhaps the filter 
 does other things as well. If not, the Stripes code is pretty clear... it 
 effectively invokes exactly what your filter does... just curious what the 
 benefit is... b/c I don't see the point and another filter... no matter how 
 marginal the code is... is going to impact performance / scalability / 
 resources unnecessarily... . No?
 
 Also, the OP wanted to know how to enable UTF-8 all the way to the DB... so 
 it wasn't how many ways you could do this... so again I don't see the point 
 about doing this in an interceptor... but sure if Stripes didn't have 
 built-in support... I would consider a filter or interceptor but the case is 
 moot IMO.
 
 Rather my point was about having missed including this in the list of things 
 I did to enable UTF-8 support in reply to the OP.
 
 Cheers,
 
 --Nikolaos
 
 
 
 Janne Jalkanen wrote:
 Basically, in addition to the other things I mentioned there indeed is one 
 Stripes configuration that I set... by creating a custom LocalePicker 
 subclass that picks the character encoding UTF-8... and dropping it the 
 configured Stripes extensions folder... the relevant code is as follows:

 
 Ah, ok, thanks for the tip.
 
 I still don't mind putting in the extra filter, since all my projects seem 
 to have a ton of them anyway, and dropping in one extra line isn't much 
 bother :-)
 
 I imagine one could also put in a custom Interceptor, if we're in the 
 process of listing different ways of enabling UTF-8 :-D
 
 /Janne
  


--
The modern datacenter depends on network connectivity to access resources
and provide services. The best practices for maximizing a physical server's
connectivity to a physical network are well understood - see how these
rules translate into the virtual world? 
http://p.sf.net/sfu/oracle-sfdevnlfb
___
Stripes-users mailing list
Stripes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/stripes-users


Re: [Stripes-users] UTF8 from form to mySQL

2011-02-05 Thread Janne Jalkanen
 Really???  A filter just to set character encoding???  Although I imagine it 
 would work isn't that a little sledge hammer-ish ;-)

I seem to recall it was the recommended practice.

 
 Why not just put the following at the top of each of your JSPs (or tweak as 
 necessary):
 %@ page language=java pageEncoding=UTF-8 
 contentType=text/html;charset=UTF-8 %
 
 That will ensure your web page supports UTF-8.

No, it will just ensure that it outputs UTF-8; it does not say anything about 
incoming request (which is what the request.setCharacterEncoding() does.)

 As far as Stripes is concerned you don't have to do anything for it to 
 support UTF-8... and Java retains all Strings in unicode so no issue there 
 either.

The problem stems from the fact that servlet spec says that the default input 
encoding is ISO-8859-1. Especially older browsers do not send the character 
encoding correctly, so you're better off declaring the input encoding 
explicitly.

Please see Servlet specification version 2.5 Section SRV.3.9.

/Janne

--
The modern datacenter depends on network connectivity to access resources
and provide services. The best practices for maximizing a physical server's
connectivity to a physical network are well understood - see how these
rules translate into the virtual world? 
http://p.sf.net/sfu/oracle-sfdevnlfb___
Stripes-users mailing list
Stripes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/stripes-users


Re: [Stripes-users] UTF8 from form to mySQL

2011-02-04 Thread Janne Jalkanen

Simple solution: declare the accept-charset value on all your forms to be 
UTF-8 (and *only* UTF-8), then put up a simple Filter in front of your chain 
which says request.setCharacterEncoding(UTF-8). This should ensure that you 
get full unicodes to the ActionBean, and then you only have to deal with your 
DB encodings.

Works for me well.

/Janne

On 4 Feb 2011, at 22:45, Daniil Sosonkin wrote:

 Hi there,
 
 So I'm sure there's someone out there who has met this problem and has found 
 a solution, therefore, let me ask the source. We are dealing with an 
 international web platform - many many languages. People submit forms in 
 different languages and it all stored in a mySQL database. Basically, I'm 
 having troubles getting UTF8 to work with said database. I have troubles at 
 all levels - stripes and database.
 
 Here's my set up:
- mySQL 5.1
- mysql-jdbc 5.1 (driver)
- tables - utf8
- LocalePicker is always forcing charset to UTF-8 in stripes
 
 Here's the problem:
- User enters some characters into the form (chinese, russian, hebrew)
- ActionBean sticks it into the database and sends email.
- Fields are declared as Strings and nothing is done to the values
- When sticking to the database it will contain -  as values
- The output from the database obviously doesn't work
- When printing submitted value on page from ${actionBean.field} it 
 displays junk
 
 I know that browsers send all forms to the servers in ISO-8859-1 encoding. In 
 the good old days, or with plain servlets, I would always have to convert 
 submitted values to UTF-8 with the following: new 
 String(rs.getString(1).getBytes(ISO-8859-1), UTF-8); From then on the 
 value is in UTF-8
 
 In Stripes, I think that the values come to ActionBeans in ISO-8859-1 since 
 StringTypeConverter doesn't do anything. That's fine, I wrote my own 
 converter for UTF using the logic from above. This solves the problem with 
 printing submitted value on the page ${actionBean.field}; but if the value is 
 still displayed in the form it is all grumbled as if it was ISO-8859-1 
 representation of UTF-8. That I don't understand.
 
 As for storing UTF8 into mySQL - well, if someone can help me out it would be 
 great since I can't get UTF8 string stored in the database without doing the 
 UTF8 to ISO-8859-1 and back conversion while keeping tables at latin1 I would 
 really appreciate it. The main question is Stripes.
 
 I hope this whole rambling makes sense and someone has had this problem 
 previously. Hopefully there was a solution.
 
 Sincerely,
 Daniil
 daniil.vcf--
 The modern datacenter depends on network connectivity to access resources
 and provide services. The best practices for maximizing a physical server's
 connectivity to a physical network are well understood - see how these
 rules translate into the virtual world? 
 http://p.sf.net/sfu/oracle-sfdevnlfb___
 Stripes-users mailing list
 Stripes-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/stripes-users


--
The modern datacenter depends on network connectivity to access resources
and provide services. The best practices for maximizing a physical server's
connectivity to a physical network are well understood - see how these
rules translate into the virtual world? 
http://p.sf.net/sfu/oracle-sfdevnlfb
___
Stripes-users mailing list
Stripes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/stripes-users


Re: [Stripes-users] HTTPS to HTTP switching

2011-01-31 Thread Janne Jalkanen
 1) Logging in.  The login action should be https so username and password are 
 encrypted, but once i pass the login, the first page the user sees does not 
 need to be secure, hence switching from https to http

And that's exactly when your site stops being secure, and the user session can 
be hijacked, and your site is compromised.  Facebook does login over https, yet 
the sessions can be hijacked. That's why they're rolling out the change...

Please *do* seriously consider using https all the way after the user has 
logged in. You have very few real reasons why you shouldn't - https is very 
cheap these days with SSL-terminating loadbalancers and plenty-of-CPU power for 
decryption anyway. You're otherwise creating a fairly easy-to-exploit security 
hole in your system... (unless, of course, you can ensure that nobody ever uses 
your system over WiFi.)

/Janne


--
Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
Finally, a world-class log management solution at an even better price-free!
Download using promo code Free_Logger_4_Dev2Dev. Offer expires 
February 28th, so secure your free ArcSight Logger TODAY! 
http://p.sf.net/sfu/arcsight-sfd2d
___
Stripes-users mailing list
Stripes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/stripes-users


Re: [Stripes-users] HTTPS to HTTP switching

2011-01-30 Thread Janne Jalkanen

I know this isn't particularly helpful, but if you do switch from https to http 
AND keep the same session identifier, you *do* have a need for encryption, and 
hence shouldn't be switching to http.

The reason for this is that session id hijacking is ridiculously easy these 
days, so having http and https mixed for the same domain is almost as good as 
not having https in the first place.  Check out Firesheep 
http://codebutler.com/firesheep?c=1. Running it on any nearby open WiFi network 
should get you a ton of Facebook logins in no time (of course, actually using 
them would probably be illegal, depending on your jurisdiction). You can even 
as an exercise script your own app into it and see how easy it is to collect 
the user sessions...

I'd say that that generating a new session ID is good design, not an issue ;-)

(Having said that, you could just use your own session tracking and your own 
cookie. ActionBeanContext is very helpful in that regard; or you could have a 
custom Filter to take care of it.)

/Janne

On 31 Jan 2011, at 02:42, Adam Stokar wrote:

 As many of you know, there is an issue when you switch from https to http due 
 to a new session variable being generated for the non-secure request.  Has 
 anyone found an easy way to handle this with Stripes?  I would like a way to 
 say a certain ActionBean should force https (like editting billing 
 information) and others should force http if there isn't a need for 
 encryption. 


--
Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
Finally, a world-class log management solution at an even better price-free!
Download using promo code Free_Logger_4_Dev2Dev. Offer expires 
February 28th, so secure your free ArcSight Logger TODAY! 
http://p.sf.net/sfu/arcsight-sfd2d
___
Stripes-users mailing list
Stripes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/stripes-users


Re: [Stripes-users] MockRoundTrip:: ActionBean Testing UrlBinding and ActionBeanContext

2011-01-24 Thread Janne Jalkanen

I'm using something like this to set up Stripes (JUnit 4, then use standard 
MockRoundtrip()). You should be able to replace the ActionBeanContext here
with whatever you like.

@BeforeClass
public static void mockUp()
{
MockServletContext context = new MockServletContext(test);

// Add the Stripes Filter
MapString,String stripesParams = new HashMapString,String();
stripesParams.put( ActionResolver.Packages, com.thinglink );
stripesParams.put( 
ActionResolver.Class,com.thinglink.site.util.web.WebInfNameBasedActionResolver
 );
stripesParams.put( 
ActionBeanContext.Class,com.thinglink.site.util.web.TLActionBeanContext );
stripesParams.put( 
ExceptionHandler.Class,com.thinglink.site.util.web.TLExceptionHandler );
stripesParams.put( Extension.Packages,com.thinglink.site );
stripesParams.put( LocalePicker.Locales,en,fi );

context.addFilter(StripesFilter.class, StripesFilter, stripesParams);

// Add the Stripes Dispatcher
context.setServlet(DispatcherServlet.class, StripesDispatcher, null);

m_context = context;
}

/Janne

On Jan 25, 2011, at 07:05 , Nikolaos Giannopoulos wrote:

 Hi,
 
 We have a typical superclass for our ActionBeans:
 
 public abstract class BaseActionBean implements ActionBean {
 ...
 protected MyActionBeanContext context;
 public final MyActionBeanContext getContext() {  return context;  }
 public final void setContext(ActionBeanContext context) {
 this.context = (MyActionBeanContext) context;
 }
 
 Now, when we write our TestNG tests we do:
...
MockRoundtrip trip = new MockRoundtrip(context, /share/add/0/-/, new 
 MockHttpSession(context));
MockHttpServletRequest request = trip.getRequest();
trip.execute();
 
 And everything works great... except I would like to set some values on the 
 ActionBean that Stripes finds and instantiates however it is unclear how I 
 would access the ActionBean context as trip.execute() creates the ActionBean, 
 sets the default context, and processes the event handler.  We obviously 
 would need to set values on the ActionBeanContext AFTER bean creation BUT 
 BEFORE event handler is processed e.g. set the logged in user on the 
 ActionBeanContext.
 
 Also it would be nice at times to replace the ActionBeanContext with a test 
 version as depicted in the Stripes Best Practices.
 
 Sure its trivial if you don't care about UrlBinding to simply create the 
 appropriate bean, set the custom context and pass it to MockRoundTrip however 
 that bypasses an important stage that we need to test and that is incoming 
 localized / canonical urls (in essence we are doing more end-to-end tests for 
 our action beans i.e. start with this URL and after execution end up with 
 these messages, errors, and destination URL).
 
 Has anyone done this before?  If not, anyone up to the challenge on how to 
 solve this?  
 
 Thanks,
 
 --Nikolaos
 --
 Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
 Finally, a world-class log management solution at an even better price-free!
 Download using promo code Free_Logger_4_Dev2Dev. Offer expires 
 February 28th, so secure your free ArcSight Logger TODAY! 
 http://p.sf.net/sfu/arcsight-sfd2d___
 Stripes-users mailing list
 Stripes-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/stripes-users

--
Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
Finally, a world-class log management solution at an even better price-free!
Download using promo code Free_Logger_4_Dev2Dev. Offer expires 
February 28th, so secure your free ArcSight Logger TODAY! 
http://p.sf.net/sfu/arcsight-sfd2d___
Stripes-users mailing list
Stripes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/stripes-users


Re: [Stripes-users] decode

2011-01-11 Thread Janne Jalkanen

BTW, this reminds me... If your Stripes app needs security, using Apache Shiro 
together with Stripes is a breeze.

http://www.ecyrd.com/ButtUgly/wiki/Main_blogentry_100910_1

/Janne

On 11 Jan 2011, at 00:12, Joaquin Valdez wrote:

 Hello!
 
 In the Stripes book there is an example of encoding a password to be stored 
 in the database:
 
 try {
MessageDigest md = MessageDigest.getInstance(SHA-1);
byte[] bytes = md.digest(password.getBytes());
ep = Base64.encodeBytes(bytes);
System.out.println(ep);
 
 
}
catch (NoSuchAlgorithmException exc) {
throw new IllegalArgumentException(exc);
}
 
 Does anyone have example code of how to decode the encrypted value from the 
 code above?
 
 Thank you!  I have tried to do this longer than I care to admit  :-)
 
 
 Joaquin Valdez
 joaquinfval...@gmail.com
 
 
 
 
 --
 Gaining the trust of online customers is vital for the success of any company
 that requires sensitive data to be transmitted over the Web.   Learn how to 
 best implement a security strategy that keeps consumers' information secure 
 and instills the confidence they need to proceed with transactions.
 http://p.sf.net/sfu/oracle-sfdevnl 
 ___
 Stripes-users mailing list
 Stripes-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/stripes-users


--
Gaining the trust of online customers is vital for the success of any company
that requires sensitive data to be transmitted over the Web.   Learn how to 
best implement a security strategy that keeps consumers' information secure 
and instills the confidence they need to proceed with transactions.
http://p.sf.net/sfu/oracle-sfdevnl 
___
Stripes-users mailing list
Stripes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/stripes-users


Re: [Stripes-users] Stripes 1.5.5 released

2011-01-04 Thread Janne Jalkanen

Thank you! Seems to solve all the weird-o layout issues I was having with 1.5.4 
that I never got around to debugging...

/Janne

On Jan 4, 2011, at 20:17 , Ben Gunter wrote:

 Stripes 1.5.5 is available for Download from Sourceforge. Maven users will 
 find it in the central repository.
 
 For information on what has changed and what you need to know before you 
 upgrade, see the Release Notes.
 
 Thanks to all who contributed to this release.
 
 -Ben
 --
 Learn how Oracle Real Application Clusters (RAC) One Node allows customers
 to consolidate database storage, standardize their database environment, and, 
 should the need arise, upgrade to a full multi-node Oracle RAC database 
 without downtime or disruption
 http://p.sf.net/sfu/oracle-sfdevnl___
 Stripes-users mailing list
 Stripes-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/stripes-users

--
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and, 
should the need arise, upgrade to a full multi-node Oracle RAC database 
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl___
Stripes-users mailing list
Stripes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/stripes-users


Re: [Stripes-users] UrlBinding to /

2010-12-29 Thread Janne Jalkanen
Folks,

to follow up on this, it seems that the simplest way to accomplish an 
URLBinding to / is to create an /index.jsp -file which has the following 
contents:

%@ page language=java contentType=text/html; charset=UTF-8
pageEncoding=ISO-8859-1%
%
//
//  We just simply redirect to the proper actionbean.
//

request.getRequestDispatcher( /action/mybean ).forward(request,response);
%

Also ensure that index.jsp is in your welcome-file-list.

There seems to be no more performance penalty on Tomcat 6, oddly enough. You'll 
just need to be careful that you have your Servlet Filters mapped properly in 
web.xml, since RequestDispatcher.forward() does not rerun the filter chain. 
(FWIW, I tried setting up REQUEST and FORWARD dispatchers for StripesFilter, 
but got very quickly into infinite loops, which were severely detrimental to 
the performance of my web site. So just map the filters you need properly for 
*.jsp and you should be fine.)

This change alone bumped my Yottaa score up by 10 notches compared to just 
blindly mapping action/mybean as a welcome-file. :-)

/Janne

On 29 Dec 2010, at 00:31, Janne Jalkanen wrote:

 Hi folks!
 
 I need to map the root of my site to a particular ActionBean. Now, the simple 
 way to do this is of course to use a welcome-file-list in web.xml (Tomcat 
 6.0.x):
 
 welcome-file-list
  welcome-fileaction/mybean/welcome-file
 /welcome-file-list
 
 but unfortunately this carries a fairly heavy performance penalty: compared 
 to accessing action/mybean directly, the performance on EC2 Large instances 
 is up to 100ms slower - and I'm seeing a definite bump in CPU usage as well 
 (about 5x of what I would use normally). On my local OSX box the difference 
 isn't that bad, but I'm still seeing it, especially the CPU usage. There's no 
 considerable IO.
 
 So it seems that the welcome-file solution is less than ideal in my 
 environment, and before I go and start ripping the guts out of it (or worse, 
 changing my production environment), I'm wondering if there's a simple and 
 clean way to resolve this the Stripes way. I see 
 http://stripesframework.org/jira/browse/STS-688 has some discussion.
 
 Would a custom Servlet Filter be the best solution here? If so, then how 
 would I invoke a particular ActionBean from it?
 
 (Here's the interesting part - it's slightly *faster* to have an index.jsp 
 redirecting with 302 to /action/mybean than have the /action/mybean as the 
 welcome-file. However, I want to steer away from redirects, since 1) I want 
 clean URLs, and 2) redirects can be quite bad for performance, especially on 
 mobile networks. And 3) it bothers me that this should really be faster than 
 have an extra redirect loop... I'm wondering if having an ActionBean as a 
 welcome-file somehow confuses Tomcat when the file does not exist physically.)
 
 /Janne


--
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and, 
should the need arise, upgrade to a full multi-node Oracle RAC database 
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl
___
Stripes-users mailing list
Stripes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/stripes-users


Re: [Stripes-users] UrlBinding to /

2010-12-29 Thread Janne Jalkanen

As Ben said, mapping to / isn't a good idea.  However, since I would assume 
that this is a fairly common case, I do support the idea of using  as a 
special sign for UrlBindings, as suggested on the bottom of STS-688.

As for performance, Stripes is nary a peep in my profiler. String manipulation 
and I/O are way more CPU-intensive than ActionBean binding and validation.  For 
example, I just run 32000 requests against my current test code, and no single 
Stripes method used more than 0.5% of CPU time. On class level, 
DefaultActionBeanPropertyBinder managed to use ~1%. On package level, all of 
Stripes uses about 6%. All other time I get to use on my app.  So it's a fair 
trade, IMO.

/Janne

On Dec 29, 2010, at 16:19 , Newman, John W wrote:

 Did you look at dynamic mapping filter at all?
 
 Leave your web.xml as is, just paste this in
 
   filter
   filter-nameDynamicMappingFilter/filter-name
   
 filter-classnet.sourceforge.stripes.controller.DynamicMappingFilter/filter-class
   /filter
   filter-mapping
   filter-nameDynamicMappingFilter/filter-name
   url-pattern/*/url-pattern
   dispatcherREQUEST/dispatcher
   dispatcherFORWARD/dispatcher
   dispatcherINCLUDE/dispatcher
   /filter-mapping
 
 And 
 @UrlBinding(/)
 public class Home extends AbstractActionBeanActionBeanContext  {
 
 should work fine.  Before DMF was added, I would do
 
   welcome-file-list
   welcome-fileHome.action/welcome-file
   /welcome-file-list
 
 And make an empty file named Home.action next to WEB-INF... there's a thread 
 on this in the list archives if you dig.  It worked, but I didn't measure 
 performance.  Really if we were to have a serious conversation about ways to 
 improve performance, it would be a very very long discussion, with a lot to 
 say about the overuse of reflection.
 
 -Original Message-
 From: Janne Jalkanen [mailto:janne.jalka...@ecyrd.com] 
 Sent: Wednesday, December 29, 2010 6:27 AM
 To: Stripes Users List
 Subject: Re: [Stripes-users] UrlBinding to /
 
 Folks,
 
 to follow up on this, it seems that the simplest way to accomplish an 
 URLBinding to / is to create an /index.jsp -file which has the following 
 contents:
 
 %@ page language=java contentType=text/html; charset=UTF-8
pageEncoding=ISO-8859-1%
 %
//
//  We just simply redirect to the proper actionbean.
//
 
request.getRequestDispatcher( /action/mybean 
 ).forward(request,response); %
 
 Also ensure that index.jsp is in your welcome-file-list.
 
 There seems to be no more performance penalty on Tomcat 6, oddly enough. 
 You'll just need to be careful that you have your Servlet Filters mapped 
 properly in web.xml, since RequestDispatcher.forward() does not rerun the 
 filter chain. (FWIW, I tried setting up REQUEST and FORWARD dispatchers for 
 StripesFilter, but got very quickly into infinite loops, which were severely 
 detrimental to the performance of my web site. So just map the filters you 
 need properly for *.jsp and you should be fine.)
 
 This change alone bumped my Yottaa score up by 10 notches compared to just 
 blindly mapping action/mybean as a welcome-file. :-)
 
 /Janne
 
 On 29 Dec 2010, at 00:31, Janne Jalkanen wrote:
 
 Hi folks!
 
 I need to map the root of my site to a particular ActionBean. Now, the 
 simple way to do this is of course to use a welcome-file-list in web.xml 
 (Tomcat 6.0.x):
 
 welcome-file-list
 welcome-fileaction/mybean/welcome-file
 /welcome-file-list
 
 but unfortunately this carries a fairly heavy performance penalty: compared 
 to accessing action/mybean directly, the performance on EC2 Large instances 
 is up to 100ms slower - and I'm seeing a definite bump in CPU usage as well 
 (about 5x of what I would use normally). On my local OSX box the difference 
 isn't that bad, but I'm still seeing it, especially the CPU usage. There's 
 no considerable IO.
 
 So it seems that the welcome-file solution is less than ideal in my 
 environment, and before I go and start ripping the guts out of it (or worse, 
 changing my production environment), I'm wondering if there's a simple and 
 clean way to resolve this the Stripes way. I see 
 http://stripesframework.org/jira/browse/STS-688 has some discussion.
 
 Would a custom Servlet Filter be the best solution here? If so, then how 
 would I invoke a particular ActionBean from it?
 
 (Here's the interesting part - it's slightly *faster* to have an 
 index.jsp redirecting with 302 to /action/mybean than have the 
 /action/mybean as the welcome-file. However, I want to steer away from 
 redirects, since 1) I want clean URLs, and 2) redirects can be quite 
 bad for performance, especially on mobile networks. And 3) it bothers 
 me that this should really be faster than have an extra redirect 
 loop... I'm wondering if having an ActionBean as a welcome-file 
 somehow confuses Tomcat when the file does not exist

Re: [Stripes-users] UrlBinding to /

2010-12-29 Thread Janne Jalkanen
D'oh!

Remnants of the previous response.sendRedirect().

Thanks for the help!

/Janne

On Dec 29, 2010, at 17:48 , Ben Gunter wrote:

 That's how I do it, except I use jsp:forward, like so:
 
 %@ page language=java contentType=text/html; charset=UTF-8 
 pageEncoding=ISO-8859-1%
 jsp:forward page=/action/mybean /
 
 BTW, the comment in your JSP says redirect instead of forward.
 
 -Ben
 
 On Wed, Dec 29, 2010 at 6:26 AM, Janne Jalkanen janne.jalka...@ecyrd.com 
 wrote:
 Folks,
 
 to follow up on this, it seems that the simplest way to accomplish an 
 URLBinding to / is to create an /index.jsp -file which has the following 
 contents:
 
 %@ page language=java contentType=text/html; charset=UTF-8
pageEncoding=ISO-8859-1%
 %
//
//  We just simply redirect to the proper actionbean.
//
 
request.getRequestDispatcher( /action/mybean ).forward(request,response);
 %
 
 Also ensure that index.jsp is in your welcome-file-list.
 
 There seems to be no more performance penalty on Tomcat 6, oddly enough. 
 You'll just need to be careful that you have your Servlet Filters mapped 
 properly in web.xml, since RequestDispatcher.forward() does not rerun the 
 filter chain. (FWIW, I tried setting up REQUEST and FORWARD dispatchers for 
 StripesFilter, but got very quickly into infinite loops, which were severely 
 detrimental to the performance of my web site. So just map the filters you 
 need properly for *.jsp and you should be fine.)
 
 This change alone bumped my Yottaa score up by 10 notches compared to just 
 blindly mapping action/mybean as a welcome-file. :-)
 
 /Janne
 
 On 29 Dec 2010, at 00:31, Janne Jalkanen wrote:
 
  Hi folks!
 
  I need to map the root of my site to a particular ActionBean. Now, the 
  simple way to do this is of course to use a welcome-file-list in web.xml 
  (Tomcat 6.0.x):
 
  welcome-file-list
   welcome-fileaction/mybean/welcome-file
  /welcome-file-list
 
  but unfortunately this carries a fairly heavy performance penalty: compared 
  to accessing action/mybean directly, the performance on EC2 Large instances 
  is up to 100ms slower - and I'm seeing a definite bump in CPU usage as well 
  (about 5x of what I would use normally). On my local OSX box the difference 
  isn't that bad, but I'm still seeing it, especially the CPU usage. There's 
  no considerable IO.
 
  So it seems that the welcome-file solution is less than ideal in my 
  environment, and before I go and start ripping the guts out of it (or 
  worse, changing my production environment), I'm wondering if there's a 
  simple and clean way to resolve this the Stripes way. I see 
  http://stripesframework.org/jira/browse/STS-688 has some discussion.
 
  Would a custom Servlet Filter be the best solution here? If so, then how 
  would I invoke a particular ActionBean from it?
 
  (Here's the interesting part - it's slightly *faster* to have an index.jsp 
  redirecting with 302 to /action/mybean than have the /action/mybean as the 
  welcome-file. However, I want to steer away from redirects, since 1) I want 
  clean URLs, and 2) redirects can be quite bad for performance, especially 
  on mobile networks. And 3) it bothers me that this should really be faster 
  than have an extra redirect loop... I'm wondering if having an ActionBean 
  as a welcome-file somehow confuses Tomcat when the file does not exist 
  physically.)
 
  /Janne
 
 
 --
 Learn how Oracle Real Application Clusters (RAC) One Node allows customers
 to consolidate database storage, standardize their database environment, and,
 should the need arise, upgrade to a full multi-node Oracle RAC database
 without downtime or disruption
 http://p.sf.net/sfu/oracle-sfdevnl
 ___
 Stripes-users mailing list
 Stripes-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/stripes-users
 
 --
 Learn how Oracle Real Application Clusters (RAC) One Node allows customers
 to consolidate database storage, standardize their database environment, and, 
 should the need arise, upgrade to a full multi-node Oracle RAC database 
 without downtime or disruption
 http://p.sf.net/sfu/oracle-sfdevnl___
 Stripes-users mailing list
 Stripes-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/stripes-users

--
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and, 
should the need arise, upgrade to a full multi-node Oracle RAC database 
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl___
Stripes-users mailing list
Stripes-users@lists.sourceforge.net
https

Re: [Stripes-users] Stripes' new streaming layout

2010-12-28 Thread Janne Jalkanen

OK guys, you got me excited. Is this documented somewhere and do I have to do 
anything to get it turned on? :-D

/Janne

On 23 Dec 2010, at 18:14, Ben Gunter wrote:

 Thank you so much for the positive feedback. I worked really hard to get that 
 done, and it's nice to know people are benefiting from it. The switch to 
 streaming hasn't been without its hiccups, but I think the benefits far 
 outweigh the problems that have been encountered.
 
 -Ben
 
 On Wed, Dec 22, 2010 at 9:24 AM, Daniil Sosonkin dan...@orbisfn.com wrote:
 To Stripes Developers,
 
 I'd like to take a moment to leave my warmest regards to the Stripes' new 
 streaming layout tags. The rewrite is truly something that had to be done 
 from the beginning. It makes web app behave like no other. I had no 
 complaints about Stripes before, but since the release of 1.5.3 its been 
 simple wonder running the framework. Our site is relatively small. We get 
 about 200 concurrent users. Nonetheless, performance gains are clearly 
 visible. Just some bullet points below:
 
* Faster perceived response time
* Memory usage has been stabilized without jumping up and down
* Reduced CPU usage (unexpected)
 
 The most important improvement is the perceived response time. I'm tracking 
 page load for every single JSP request all the time (my own pet peeve) and 
 there have been no changes there, but users get first bytes in the response 
 faster. I guess buffering is not always desired. Don't know if anyone has 
 felt the changes, but I've seen those only after installing new Stripes. And 
 a side effect of that is clearly visible to our international clients in 
 Asia. The content delivery is more instant.
 
 My thanks go out to all who contributed to this change. Its great to see 
 Stripes improve so much and looking forward to the bright future as well.
 
 Cheers,
 Daniil
 
 
 --
 Learn how Oracle Real Application Clusters (RAC) One Node allows customers
 to consolidate database storage, standardize their database environment, and, 
 should the need arise, upgrade to a full multi-node Oracle RAC database 
 without downtime or disruption
 http://p.sf.net/sfu/oracle-sfdevnl___
 Stripes-users mailing list
 Stripes-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/stripes-users

--
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and, 
should the need arise, upgrade to a full multi-node Oracle RAC database 
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl___
Stripes-users mailing list
Stripes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/stripes-users


[Stripes-users] UrlBinding to /

2010-12-28 Thread Janne Jalkanen
Hi folks!

I need to map the root of my site to a particular ActionBean. Now, the simple 
way to do this is of course to use a welcome-file-list in web.xml (Tomcat 
6.0.x):

welcome-file-list
  welcome-fileaction/mybean/welcome-file
/welcome-file-list

but unfortunately this carries a fairly heavy performance penalty: compared to 
accessing action/mybean directly, the performance on EC2 Large instances is up 
to 100ms slower - and I'm seeing a definite bump in CPU usage as well (about 5x 
of what I would use normally). On my local OSX box the difference isn't that 
bad, but I'm still seeing it, especially the CPU usage. There's no considerable 
IO.

So it seems that the welcome-file solution is less than ideal in my 
environment, and before I go and start ripping the guts out of it (or worse, 
changing my production environment), I'm wondering if there's a simple and 
clean way to resolve this the Stripes way. I see 
http://stripesframework.org/jira/browse/STS-688 has some discussion.

Would a custom Servlet Filter be the best solution here? If so, then how would 
I invoke a particular ActionBean from it?

(Here's the interesting part - it's slightly *faster* to have an index.jsp 
redirecting with 302 to /action/mybean than have the /action/mybean as the 
welcome-file. However, I want to steer away from redirects, since 1) I want 
clean URLs, and 2) redirects can be quite bad for performance, especially on 
mobile networks. And 3) it bothers me that this should really be faster than 
have an extra redirect loop... I'm wondering if having an ActionBean as a 
welcome-file somehow confuses Tomcat when the file does not exist physically.)

/Janne
--
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and, 
should the need arise, upgrade to a full multi-node Oracle RAC database 
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl
___
Stripes-users mailing list
Stripes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/stripes-users