Re: [Stripes-users] is Stripes suitable?

2008-10-08 Thread Philip Constantinou

Stripes users -

I've been meaning to write up a more elaborate posting about our use  
of stripes but I wanted to give you another datapoint and more  
kudos to stripes.


My company, Evernote, has been using stripes for over a year -- I  
started using it after a number of successful smaller projects at a  
previous company. We're now serving over 450k registered users and  
over 25k requests per minute in a clustered set of servers.


We use stripes for our web, iphone web,  and web mobile user interface  
- stripes gave us a lot of model/controller code reuse. The framework  
is used in conjunction with Hibernate and also GWT for some of the  
more interactive interfaces.


Performance has never been an issue.
Stripes makes it easier to make more secure applications.
Stripes has helped me bring new junior non-java engineers up to speed  
very quickly - they are less likely to make errors that new Java  
servlet engineers make.
Stripes layout frameworks are remarkably simple and useful -- the best  
I've used. UI code reuse is effortless.
We continue to be impressed about how easy it is to extend stripes and  
also how well it plays with other tools (be it AJAX frameworks or tag  
libraries).
(Probably not as issue for you) but localization using stripes was  
very easy, even with some complex requirements.
The default UI widgets (especially error handling) are minimal but  
great and very configurable. They make creating well behaved forms the  
default.


My recommendation, if you're going to use Stripes, is to get one  
senior person to learn it from from top-to-bottom establishing the  
usage guidelines for the rest of the team. Stripes is incredibly hard  
to use if you use it wrong -- a few good examples are usually all you  
need but if folks head off in the wrong direction they can get  
frustrated quickly. Things like allowing multiple forms on a page are  
very easy to do and but also really frustrating if you don't know how  
to make it work.


This mailing list is great and the community is very responsive but I  
think it's essential to have a local champion.


Phil

On Oct 8, 2008, at 6:15 AM, ping lu wrote:


Motten, Jeppe, Chris,

thanks so much for your excellent point, they are very helpful to my  
evaluation process. I am trying to bring Stripes as a player into  
this project.


Cheers,

Lu


From: [EMAIL PROTECTED]
To: stripes-users@lists.sourceforge.net
Date: Tue, 7 Oct 2008 15:40:15 -0400
Subject: Re: [Stripes-users] is Stripes suitable?

Here's a casual performance comparison from a couple of years back  
that found Stripes to be significantly faster than WebWork/Struts 2  
primarily because of Struts 2's reliance on OGNL for binding. As far  
as I know, Spring MVC uses OGNL also.


I'm using Stripes in two production applications, one of which is  
running on a modest Linux server. The number of users has grown from  
tens to thousands, and the only scalability issues have been  
resolved in the persistence tier - Stripes contributes very little  
overhead to this app.


There's a list of some public sites built using Stripes here. One of  
the more notable ones is http://imagesource.cnn.com


I would suggest that you try porting a slice of one of your existing  
Spring MVC applications and doing your own comparison. You could use  
Apache JMeter to load-test a few use cases and measure response  
times as the number of users increase.


By the way, a lot of people (including me) are using Stripes along  
with other Spring services (transactions, persistence, URL security)  
and Stripes coexists happily with those.


Chris.

On Oct 7, 2008, at 12:47 PM, ping lu wrote:

Hi, Strips community,

Currently we are evaluating web framework for a very big enterprise  
project. Stripes seems to be the pick at this moment.


Though we still need more materials to support the decision (for  
politically correctness). Maybe your knowledge can easily help us  
out with some information:
1. Could you please list any relatively large scale enterprise  
applications used by Stripes?
2. what is the biggest advantage (or weakness) Stripes over Spring  
MVC (2.5 or plus) in particular? (since Spring MVC has already been  
used in our organization).


We especially concern about "request/response performance" and  
"scalability".


With those information, we may able to make our final decisions. Any  
help from you is greatly appreciated.


regards,

H. Lu

Stay up to date on your PC, the Web, and your mobile phone with  
Windows Live. See Now  
-
This SF.Net email is sponsored by the Moblin Your Move Developer's  
challenge
Build the coolest Linux based applications with Moblin SDK & win  
great prizes
Grand prize is a trip for two to an Open Source event anywhere in  
the world

http://moblin-contest.org/redirect.php?banner_id=100&url=/___
Stripes-users mailing list
Stripes-use

Re: [Stripes-users] is Stripes suitable?

2008-10-08 Thread Philip Constantinou


On Oct 8, 2008, at 8:27 AM, Chris Herron wrote:


On Oct 8, 2008, at 10:07 AM, Philip Constantinou wrote:


Stripes is incredibly hard to use if you use it wrong



I hope that doesn't scare anybody off! ;) There are some best- 
practices to follow that will help make things easier, but I think  
that any difficulties developers might run into are relatively easy  
to fix. When I say 'relatively', I mean in comparison to other  
frameworks. Your IDE can refactor Stripes code more easily because  
there's less config-forced indirection and more type-safety.


When choosing patterns for implementing Stripes in your own app, one  
big thing I would suggest to newcomers is to skip the BugZooky  
example (which needs to be updated) and instead go with Freddy  
Daoud's book.


You're absolutely right. The BugZooky example set a few of our folks  
off in the wrong direction and created a bit of internal resentment  
about Stripes that's been a bit hard to overcome.


Aside from BugZooky, the documentation very usable and clear. If you  
do the obvious/easy thing, everything works great.


I haven't found any anti-patterns, instead, I like to say, if it's not  
easy then you're not doing it right.





Philip, if you get around to doing a more detailed posting, I'd be  
interested to hear any Stripes anti-patterns you've gathered.


Chris.




-
This SF.Net email is sponsored by the Moblin Your Move Developer's  
challenge
Build the coolest Linux based applications with Moblin SDK & win  
great prizes
Grand prize is a trip for two to an Open Source event anywhere in  
the world

http://moblin-contest.org/redirect.php?banner_id=100&url=/___
Stripes-users mailing list
Stripes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/stripes-users


Philip Constantinou
CIO
Evernote Corp.
[EMAIL PROTECTED]
415-692-4876

-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/___
Stripes-users mailing list
Stripes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/stripes-users


Re: [Stripes-users] Chart Libraries

2008-12-01 Thread Philip Constantinou
One other option is Google Charts:

http://code.google.com/apis/chart/

I haven't done more than a few experiments but it's produced good  
results.


On Dec 1, 2008, at 7:55 AM, Evgeny Shepelyuk wrote:

> Hello guyz
>
> +1 on this approach :)
>
>> Hi Ross,
>>
>> I am currently using JFreeChart+JCommon and it is working well.
>> You don't even need a plugin, you can just return a  
>> StreamingResolution
>> and use:
>>
>> JFreeChart chart = ...;
>> ChartUtilities.writeChartAsPNG(response.getOutputStream(), chart,  
>> width,
>> height);
>>
>> in the public void stream(HttpServletResponse response) method.
>>
>> Hope that helps.
>>
>> Cheers,
>> Freddy
>> http://www.stripesbook.com
>>
>> On Mon, 1 Dec 2008 10:11:29 -0500, "Ross Sargant"
>> <[EMAIL PROTECTED]>
>> said:
>>> Hi,
>>>  My question is not specifically stripes related but I was  
>>> wondering if
>>>  any
>>> stripes developers have any experience
>>> with charting libraries. I have taken a look but there are so many
>>> available
>>> I'm not sure where to start.
>>> Cewolf/JFreeChart looks like an easy starting pointing but cewolf  
>>> looks
>>> like
>>> a dead project with no recent updates.
>>>
>>> I'm using a custom jetty+spring+stripes "container" (no java EE). My
>>> views
>>> are plain vanilla JSP pages using the stripes tag library (including
>>> layout
>>> tags). I'm looking for a solution that would fit into that  
>>> environment
>>> without signficant changes.
>>>
>>> Appreciate any assistance you can provide.
>>>
>>>
>>> Ross Sargant
>>>
>>> TVR Communications LLC
>>> Software Engineer
>>> 3275 W Hillsboro Blvd,Suite 300,Deerfield Beach, Florida,33442
>>>
>>> http://www.tvrc.com
>>>
>>> p: 954-571-2017 x2108
>>>
>>> email: [EMAIL PROTECTED]
>>
>> -
>> This SF.Net email is sponsored by the Moblin Your Move Developer's
>> challenge
>> Build the coolest Linux based applications with Moblin SDK & win  
>> great
>> prizes
>> Grand prize is a trip for two to an Open Source event anywhere in the
>> world
>> http://moblin-contest.org/redirect.php?banner_id=100&url=/
>
>
>
> -- 
> Написано в почтовом клиенте браузера  
> Opera: http://www.opera.com/mail/
>
>
> -
> This SF.Net email is sponsored by the Moblin Your Move Developer's  
> challenge
> Build the coolest Linux based applications with Moblin SDK & win  
> great prizes
> Grand prize is a trip for two to an Open Source event anywhere in  
> the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> ___
> Stripes-users mailing list
> Stripes-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/stripes-users


-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
___
Stripes-users mailing list
Stripes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/stripes-users


Re: [Stripes-users] File Download in Stripes

2008-12-09 Thread Philip Constantinou
Did you try:

> return new StreamingResolution("audio/mp3", );


looks like you're not providing a valid mime type.

On Dec 9, 2008, at 10:28 AM, arnab_ghosh wrote:

>
> Hi All,
>
> I am trying to implement file download in Stripes. Presently I am  
> generating
> a FileInputStream from the File URI in ActionBean.
> I have set the response header for content disposition.
> I am returning this fileinputstream wrapped in a Streaming  
> Resolution as:
>
> return new StreamingResolution("mpeg3", );
>
> But the browser is unable to generate the download window.
>
> Can you please help?
>
> Regards
> Arnab
> -- 
> View this message in context: 
> http://www.nabble.com/File-Download-in-Stripes-tp20919742p20919742.html
> Sent from the stripes-users mailing list archive at Nabble.com.
>
>
> --
> SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas,  
> Nevada.
> The future of the web can't happen without you.  Join us at MIX09 to  
> help
> pave the way to the Next Web now. Learn more and register at
> http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
> ___
> Stripes-users mailing list
> Stripes-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/stripes-users


--
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you.  Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
___
Stripes-users mailing list
Stripes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/stripes-users


[Stripes-users] posting to SSL

2009-01-23 Thread Philip Constantinou
Hey folks -

Are there any best practices out there for dealing with switching the  
browser between HTTP and HTTPs. I'd added some subclasses of  
stripes:for, stripes:link and  RedirectResolution that take a  
secure=true/false parameter but the 1.5 upgrade seems to break them a  
little in some cases.

Anyone else have a good way of dealing with this?

The typical usage example is, I want my log in and change password  
forms to submit over SSL no matter what (as long as the server  
supports SSL), but want the rest of the URL's to be root relative.

Thanks -
Phil




--
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
___
Stripes-users mailing list
Stripes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/stripes-users


Re: [Stripes-users] posting to SSL

2009-01-24 Thread Philip Constantinou
Hi Karsten -
Thanks, this looks really nicely done.

Our requirements are slightly more, eh, exotic. (Our use of SSL is  
something our user pay for, so we configure it by a setting in the  
context.)

I'm not sure that's something everyone would want, but you may want to  
consider the SSL settings to be a runtime configuration option.

Anyway, great stuff.

On Jan 24, 2009, at 5:38 AM, Karsten Strunk wrote:

> Hi,
>
> There's nothing like this right now in the official release, but I'd
> appreciate it for the next Stripes version.
>
> In the meantime have a look here:
>
>http://www.stripesframework.org/jira/browse/STS-239
>
> Bye
>
> Karsten
>
> Philip Constantinou schrieb:
>> Hey folks -
>>
>> Are there any best practices out there for dealing with switching the
>> browser between HTTP and HTTPs. I'd added some subclasses of
>> stripes:for, stripes:link and  RedirectResolution that take a
>> secure=true/false parameter but the 1.5 upgrade seems to break them a
>> little in some cases.
>>
>> Anyone else have a good way of dealing with this?
>>
>> The typical usage example is, I want my log in and change password
>> forms to submit over SSL no matter what (as long as the server
>> supports SSL), but want the rest of the URL's to be root relative.
>>
>> Thanks -
>> Phil
>>
>>
>>
>>
>> --
>> This SF.net email is sponsored by:
>> SourcForge Community
>> SourceForge wants to tell your story.
>> http://p.sf.net/sfu/sf-spreadtheword
>> ___
>> Stripes-users mailing list
>> Stripes-users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/stripes-users
>>
>
>
> --
> This SF.net email is sponsored by:
> SourcForge Community
> SourceForge wants to tell your story.
> http://p.sf.net/sfu/sf-spreadtheword
> ___
> Stripes-users mailing list
> Stripes-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/stripes-users


--
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
___
Stripes-users mailing list
Stripes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/stripes-users


Re: [Stripes-users] Passing Stripes name to JS

2009-03-20 Thread Philip Constantinou
One other way that I've done this (for more complex Javascript data  
structures) is to use the JSON libraries with a JSTL function. It's  
nice and general.


Create a JSTL function object like this:
  public static final String json(String key, Object value) {
JSONObject json = new JSONObject();
json.put(key, value);
return json.toString();
  }


tld:
 
json
com.evernote.web.tag.EFunctions

  boolean json(java.lang.String, java.lang.Object)

  

and then in the JSP:

  var gSearch = ${e:json('search',actionBean.search)}.search;


On Mar 20, 2009, at 11:17 AM, AK wrote:


AK  writes:

On IRC, Aaron helped clean this up for me:

onclick="cal17.select(document.forms[0].elements["item.dateFound"],
   
'anchor17','MM/dd/');return false;"

The other thing that was suggested is not using document.forms[0]  
since this
onclick would not work if another form was added to the top of this  
one.  As

such, I added an 'id' to my form:



And then reference that within the onclick:



onclick 
="calPop.select(document.getElementById('AddItemForm').elements
['item.dateFound'],'anchor_item_dateFound','MMM dd, '); return  
false;"


A futher follow-up:

Rather than having an ID on the form, I'm just putting an id into  
the s:text

element:



And then just referencing the element via the id:

onclick="calPop.select(document.getElementById('item-date'),
'anchor_item_dateFound','MMM dd, '); return false;"


--
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM)  
are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly  
and
easily build your RIAs with Flex Builder, the Eclipse(TM)based  
development

software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
___
Stripes-users mailing list
Stripes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/stripes-users


--
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com___
Stripes-users mailing list
Stripes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/stripes-users


Re: [Stripes-users] Reading a properties file

2009-03-31 Thread Philip Constantinou
Apache Commons configurations:

http://commons.apache.org/configuration/howto_properties.html

Is a really nice set of libraries that is a bit better than just using  
java.util.Properties. It's abstraction also makes it easier to change  
your mind about where you're putting your properties.

If I remember correctly the reason for the URL is a legacy from the  
old applet days.

It's no better than using the InputStream.


On Mar 31, 2009, at 6:09 PM, AK wrote:

> On IRC I got the following suggestion for reading a properties file:
>
> URL aURL = getClass().getClassLoader().getResource("myApp.properties")
>
> The other suggestion I found online was:
>
> InputStream inStream =  
> this.getClass().getClassLoader().getResourceAsStream
> ("myApp.properties");
>
> Is there a preference or advantage of one way over the other?
>
>
> --
> ___
> 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] Accessing StripesResources.properties within the action bean

2009-04-01 Thread Philip Constantinou

This is what I do:

String defaultName = StripesFilter.getConfiguration()
.getLocalizationBundleFactory().getFormFieldBundle(
getContext().getLocale()).getString("defaultName");

getContext().getLocale() returns the locale based on the browser  
settings.



On Apr 1, 2009, at 12:21 AM, Richard Hauswald wrote:


Hello List,
how can I try to translate a word using the stripes i18n stuff? It's
important that I use the proper translation file, so if the user tells
he wants the stuff in english, I need to use the english translation,
if he wants it in german, the german one. I know how do do the normal
stuff inside my jsp and how to setup the i18n stuff. It's working like
charm. For those who are interested in details:
I get a List of TopLists from a web service. Each TopList contains a
List of LocalizableMessages. These Messages have a key and an object[]
for params. This worked well until the feature request came in to
translate the param as well. Now I want to pre check for each
parameter of my topList if there is an existing translation and if so,
just replace the original param with the translated one.
Thanks for you time,
Richard

--
___
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


[Stripes-users] Good design patterns for multiple presentation layers with Stripes

2009-04-28 Thread Philip Constantinou
Hey folks -

I'm was wondering if anyone has come up with an elegant solutions to  
handle multiple presentation layers with stripes. We have a web and  
mobile web versions of our application (sometimes a JSON version too).  
Many of the functions, login, forgot password, etc. take the same  
parameters, use the same validation but dispatch to different JSP's.

The best approach we've found is creating abstract ActionBean which  
manages validation, interaction with domain objects and persistence  
layers. The subclasses generally just implement abstract events  
handlers that return resolution to the correct JSP. The JSP's  
stripes:form/useBean refer to the concrete classes.

This works ok, anyone got a better pattern?


--
Register Now & Save for Velocity, the Web Performance & Operations 
Conference from O'Reilly Media. Velocity features a full day of 
expert-led, hands-on workshops and two days of sessions from industry 
leaders in dedicated Performance & Operations tracks. Use code vel09scf 
and Save an extra 15% before 5/3. http://p.sf.net/sfu/velocityconf
___
Stripes-users mailing list
Stripes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/stripes-users


Re: [Stripes-users] accessing action bean context from outside of an action

2009-05-23 Thread Philip Constantinou
We do similar stuff by adding these helper methods to our  
ActionBeanContext subclass. Your tag should have enough information  
from the page context to call getOrMakeContext(...).




  /**
   * If an  My context has already been set, this will grab it,  
otherwise

   * this will make a new context.
   */
  public static MyActionBeanContext getOrMakeContext(
  HttpServletRequest httpRequest, HttpServletResponse httpResponse,
  ServletContext servletContext) {
MyActionBeanContext context = MyActionBeanContext
.getContext(httpRequest);
if (context == null) {
  context = new MyActionBeanContext();
  context.setRequest(httpRequest);
  context.setResponse(httpResponse);
  context.setServletContext(servletContext);
}
return context;
  }

  /**
   * Retrieves the global context associated with the provideed  
request, or null

   * if none is set.
   */
  public static MyActionBeanContext getContext(ServletRequest  
request) {

return (MyActionBeanContext) request
.getAttribute(My_CONTEXT_REQUEST_ATTRIBUTE);
  }


  @Override
  public void setRequest(HttpServletRequest request) {
super.setRequest(request);
if (getContext(request) == null) {
  request.setAttribute(My_CONTEXT_REQUEST_ATTRIBUTE, this);
}
  }



On May 23, 2009, at 3:45 PM, Mike McNally wrote:


On Sat, 23 May 2009 14:44:27 -0700
Chris Cheshire  wrote:


I have quite a few convenience methods in my action bean context
subclass (eg. that wrap getting init parameters for the web
application) that I want to access from a tag handler class. I can  
get
the servlet context and then get the params from that, but the  
methods

in the action bean context are more...convenient. Is there any way to
get access to this instance from a tag handler class?


I think that a common way to do this is to either subclass the context
class such that the instances put themselves in a ThreadLocal and
provide a public static access method, or to have an interceptor
do that for the stock class.

--
--
Mike McNally 

--
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT
is a gathering of tech-side developers & brand creativity  
professionals. Meet

the minds behind Google Creative Lab, Visual Complexity, Processing, &
iPhoneDevCamp asthey present alongside digital heavyweights like  
Barbarian

Group, R/GA, & Big Spaceship. http://www.creativitycat.com
___
Stripes-users mailing list
Stripes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/stripes-users


--
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT
is a gathering of tech-side developers & brand creativity professionals. Meet
the minds behind Google Creative Lab, Visual Complexity, Processing, & 
iPhoneDevCamp asthey present alongside digital heavyweights like Barbarian
Group, R/GA, & Big Spaceship. http://www.creativitycat.com ___
Stripes-users mailing list
Stripes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/stripes-users


[Stripes-users] XSS?

2009-07-20 Thread Philip Constantinou
Hey folks -
I'd like to see if I'm missing something regarding Stripe's XSS support.

I had (falsely) assumed that the stripes:form tag's addition of:
   

would protected against XSS requests because it would sign form  
submissions.
Is there anyway to explicitly take advantage of this for validating  
the source of form submissions?
Or do I need to look at this:
http://stripesframework.org/display/stripes/XSS+filter
Thanks -
Phil

--
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time, 
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize  
details at: http://p.sf.net/sfu/Challenge
___
Stripes-users mailing list
Stripes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/stripes-users


Re: [Stripes-users] Prefered Resolution to serve a zip file ?

2009-08-24 Thread Philip Constantinou
If you have the zip file in RAM you can construct a  
ByteArrayInputStream();


something like this:

  byte a[]= "foo".getBytes();
  ByteArrayInputStream i = new ByteArrayInputStream(a);
  return new StreamingResolution("application/zip", i);

If the file is static and stored within the web app, you may just be  
able to make a ForwardResolution() assuming the mime type is mapped.


The documentation provides a nice example showing to really stream the  
content using an inner class:


http://stripes.sourceforge.net/docs/current/javadoc/net/sourceforge/stripes/action/StreamingResolution.html

return new StreamingResolution("text/xml") {
public void stream(HttpServletResponse response) throws Exception {
response.getOutputStream().write(...);
}
}.setFilename("your-filename.xml");


In this case, you can write the bytes of the zip file using:
response.getOutputStream().write(...);

On Aug 24, 2009, at 2:11 PM, Laurent Perez wrote:


Hi

I need to serve a zip file directly from a returning Resolution
(redirecting to the generated zip file is not an option).
The zip file is not big, a few KB.

I've played with the StreamingResolution, but I still can't manage to
get it right : the content type is of course "application/zip", but
what's the best option for the second argument : should I be using an
InputStream or a Reader ?

Thanks for any input
:)

laurent

--
http://in-pocket.blogspot.com";>http://in-pocket.blogspot.com
- Mobile world, technology and more

--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008  
30-Day
trial. Simplify your report design, integration and deployment - and  
focus on

what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
___
Stripes-users mailing list
Stripes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/stripes-users


--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july___
Stripes-users mailing list
Stripes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/stripes-users


[Stripes-users] Localization and MessageFormat

2009-09-29 Thread Philip Constantinou
Hey folks -

I'm trying to get a better understanding of how the StripesResources  
file works. I've been using it for a while but I've recently run into  
the problem with the ' character.

Looking through the code hasn't been very helpful.

Here's the problem. In my StripesResources.properties file I have (for  
example):

foo1=Foo's
foo2=Foo''s
foo3=Foo\'s

In my JSP's I have:






The page returns:

Foo's
Foo''s
Foo's

This kinda makes sense but I see that the Stripes SimpleMessage class  
implementation is supposed to use:
http://java.sun.com/j2se/1.5.0/docs/api/java/text/MessageFormat.html

The reason this is a problem is we're trying to share a translation  
memory database between Stripes and GWT and it seems like the strings  
are represented differently.

Any idea why the StripesResources.properties doesn't following the  
standard MessageFormat format conventions where:

foo2=Foo''s
should be printed like:

Foo's

Thanks in advance.

Phil


--
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
___
Stripes-users mailing list
Stripes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/stripes-users


Re: [Stripes-users] Localization and MessageFormat

2009-09-30 Thread Philip Constantinou
Thanks Freddy -
So I'm still trying to figure out what all the rules are and when i  
use: ' vs ''

  USE  '
 USE  ''

  -- USE  '
 -- '' USE ''

Is that right? Blurg


On Sep 30, 2009, at 9:31 AM, Freddy Daoud wrote:

> Hi Philip,
>
>> In my JSP's I have:
>>
>> 
>> 
>> 
>>
>> The page returns:
>>
>> Foo's
>> Foo''s
>> Foo's
>>
>> This kinda makes sense but I see that the Stripes SimpleMessage class
>> implementation is supposed to use:
>> http://java.sun.com/j2se/1.5.0/docs/api/java/text/MessageFormat.html
>>
>> Any idea why the StripesResources.properties doesn't following the
>> standard MessageFormat format conventions where:
>>
>> foo2=Foo''s
>> should be printed like:
>>
>> Foo's
>
> Well, you are right, SimpleMessage uses MessageFormat and thus will
> print Foo''s as Foo's. But you are not using SimpleMessage here!
> You are using the fmt:message tag, which is part of the JSTL and
> is not related to SimpleMessage (nor Stripes, in fact).
>
> So, indeed you'll need to espace ' with '' for Stripes information
> and error messages. But fmt:message does not use MessageFormat
> unless you specify parameters with nested fmt:param.
>
> Hope that helps.
>
> Cheers,
> Freddy
> http://www.stripesbook.com
>
> --
> Come build with us! The BlackBerry® Developer Conference in SF, CA
> is the only developer event you need to attend this year. Jumpstart  
> your
> developing skills, take BlackBerry mobile applications to market and  
> stay
> ahead of the curve. Join us from November 9-12, 2009. Register  
> now!
> http://p.sf.net/sfu/devconf
> ___
> Stripes-users mailing list
> Stripes-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/stripes-users


--
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
___
Stripes-users mailing list
Stripes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/stripes-users


Re: [Stripes-users] Feature Request for label selection

2009-11-26 Thread Philip Constantinou
Hey Simon -
You've got lots of options... one would be to just use HTML:

"/>

This will invoke the same event but set the value to be the localization string 
passed in by the JSTL localization tag.

There's nothing too magical about the stripes:submit tag. 

You could even use: 




On Nov 26, 2009, at 12:06 AM, Simon Keen wrote:

> 
> I am building a multi-national system and localisation is very important.  I
> admit to only using stripes for about 8 months and may have missed something
> so please advise me if I am doing something wrong.  Hwoever, I find the
> overlaoded use of the 'name' attribute in some tags gets in the way.
> 
> For example in stripse:submit the name attribute controls the event that
> will invoked and the localisation lookup.  This causes problems when you
> want 2 or more buttons that invoke the same event but because of different
> parameters being set will actually cause different effects on the subsequent
> page.
> 
> For example, assume I have a form that contains information about a
> department.  I wish to have 2 buttons that will call a newDetails event to
> display a blank form.  In one case the do not set the parent department id
> to that of the current department's parent ( create a sibling) and in
> another case the parent dept id is set to the department currently displayed
> (ie create a child dept).
> 
> This could be easily achieved with:
> 
> 
>...
>   
>   
> 
> 
> 
>...
>   
>   
> 
> 
> This would all work well, including the transferring the value by setting
> and property that has not getter and actually sets the parentDept property
> via the setter setNewParentDept except the two buttons can not be given
> different labels as the resource lookup (fixed labels are no good) has no
> way of resolving them differently.  It would be great to have another option
> in the tags that enables a lookup key as another labeling option, a bit like
> the for and name attributes in s:label.
> -- 
> View this message in context: 
> http://old.nabble.com/Feature-Request-for-label-selection-tp26525265p26525265.html
> Sent from the stripes-users mailing list archive at Nabble.com.
> 
> 
> --
> Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
> trial. Simplify your report design, integration and deployment - and focus on 
> what you do best, core application coding. Discover what's new with
> Crystal Reports now.  http://p.sf.net/sfu/bobj-july
> ___
> Stripes-users mailing list
> Stripes-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/stripes-users


--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
___
Stripes-users mailing list
Stripes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/stripes-users


Re: [Stripes-users] Stripes and GWT

2010-10-25 Thread Philip Constantinou
Evernote (4.7+ million users to date) uses both GWT and Stripes in our web app. 
We basically use them as two totally independent components -- they don't 
interact at all aside from using Stripes to generate the page that references 
the GWT resources.

We haven't had any problems but generally they are two totally different 
approaches. Stripes generally assumes that the page reloads and GWT assumes 
that all the communications happens from a single page.

We've used Stripes for all the registration, account management and commerce 
operations and GWT for the more dynamic UI elements. We also use Stripes for 
the mobile web (ie. non-Javascript) UI's.

If we need to add some dynamic behavior (like checking if a username is taken 
or other real time client side validation) to the stripes pages we use jQuery 
and just return JSONObjects as a Resolution.

Architecturally we have a service layer that both GWT and the Stripes action 
beans call into. 

This seems to work fine, no regrets but we haven't put a lot of thought into 
integrating the two technologies.

On Oct 24, 2010, at 9:54 PM, farouk alhassan wrote:

> Hi all,
> Is it possible to use Stripes with GWT smoothly in the same project. If so 
> what are some of the  gothas and work arounds one should anticipate in this 
> aproach.
> 
> If its not possible, what is the recommended approach to using a native 
> component framework with stripes?
> 
> Regards
> Farouk A
> 
> --
> Nokia and AT&T present the 2010 Calling All Innovators-North America contest
> Create new apps & games for the Nokia N8 for consumers in  U.S. and Canada
> $10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
> Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store 
> http://p.sf.net/sfu/nokia-dev2dev___
> Stripes-users mailing list
> Stripes-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/stripes-users

--
Nokia and AT&T present the 2010 Calling All Innovators-North America contest
Create new apps & games for the Nokia N8 for consumers in  U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store 
http://p.sf.net/sfu/nokia-dev2dev___
Stripes-users mailing list
Stripes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/stripes-users


Re: [Stripes-users] Anyway to Redirect to an external page?

2011-01-21 Thread Philip Constantinou
In your example you're changing the host name in the URL (not the path). This 
really can only be done using a "redirect" (technically an HTTP response code 
303 or 301) since the client is essentially talking to a different host. In 
your LoginAction class you'll want a method that looks like this:

public Resolution login() {
return   new 
RedirectResolution("https://subdomain1.mydomain.com/userHome.action";); 
}

"re-writing", made famous by the apache mod_rewrite, has the ability to do 
"Forwards" which are processed within the HTTP server without negotiation with 
the browser and "Redirects" which are processed by the browser. Forwards 
(available in Stripes using ForwardResolution) are particularly good at 
directing a request to a JSP presentation components.

Using a RedirectResolution on a successful login is a best practice. It makes 
the application behave more predictably if the user reloads the 
"UserHome.action" page after submitting the login. Generally speaking, it's 
always good to follow a "POST" request with a redirect.

Much of the behavior of mod_rewrite can be emulated by Java Servlet filters and 
operates independently of Stripes.
http://tomcat.apache.org/tomcat-4.1-doc/servletapi/javax/servlet/Filter.html

Stripes has lots of great utilities for managing redirects and forwards. Look 
at the implementation of the Resolution interface for the details.

On Jan 21, 2011, at 8:19 PM, Joaquin Valdez rote:

> Seems to me that would be more a function of the webserver than the app.  Am 
> I wrong?
> 
> 
> On Jan 21, 2011, at 8:01 PM, Yee wrote:
> 
>> To be more specific- what I need to do is not redirecting to another 'place',
>> but to rewrite the url.
>> 
>> So the request could be: https://www.mydomain.com/login.action
>> 
>> After the user login I need to rewrite the url to become:
>> https://subdomain1.mydomain.com/userHome.action,
>> https://subdomain2.mydomain.com/userHome.action etc.
>> 
>> The url looks different, but it is the same action bean at the server.
>> 
>> 
>> 
>> 
>> --
>> 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
> 
> Joaquin Valdez
> joaquinfval...@gmail.com
> 
> 
> 
> 
> --
> 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] UTF8 from form to mySQL

2011-02-04 Thread Philip Constantinou
Daniil --

We're doing all the same stuff and haven't encountered any problems. Here's a 
few tidbits from our configuration.


In our mySQL connector we use:
  



In the tomcat container new add:

nano $CATALINA_HOME/conf/server.xml:
 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
> --
> 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