spread the word: a blogger's experience moving from WW to stripes

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

spread the word: a blogger's experience moving from WW to stripes

Renaud Bruyeron-2

Just saw this this morning:

http://javajmc.blogspot.com/2006/10/migrating-from-webwork-to-stripes-pt-1.html

  - Renaud


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users
Reply | Threaded
Open this post in threaded view
|

Re: spread the word: a blogger's experience moving from WW to stripes

Jeff C-2
Renaud Bruyeron <bruyeron@...> writes:

>
>
> Just saw this this morning:
>
> http://javajmc.blogspot.com/2006/10/migrating-from-webwork-to-stripes-pt-1.html
>
>   - Renaud
>


Hey,

I'm the blogger mentioned above.

If you have any recommendations based on my experience so far (things i could do
to make things better) please let me know!

Paul and I went back and forth in the comments, and in my last comment i had a
suggestion for something in liked better in webwork than in stripes..would be
cool if Stripes had the equivalent of the ww:text tag, so enable lookup of keys
in properties files that were named the same as the action (for instance
MyAction.java has a MyAction.properties). Does a feature like this go against
the "Stripes Way"?

So far..thats really the only thing i miss from webwork that stripes doesnt have
(that i know of). Though it does help that i have a Manning Webwork book to
explain the webwork tags..i havent yet found the documentation for the Stripes
custom tags..though i'm sure its there in the API or something.

thanks..
-jeff



-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users
Reply | Threaded
Open this post in threaded view
|

Re: spread the word: a blogger's experience moving from WW to stripes

Ben Gunter
Hi Jeff. I tried to comment on your blog, but the site timed out on me several times so I gave up. You wondered if Stripes provides some way to call methods on objects from a JSP. Not exactly, but if you need a method to execute when the view loads, you can do something like this:

<stripes:useActionBean var="actionBean" binding="/path/to/Bean.action" event="load" alwaysExecuteEvent="true" />

That will look for a method annotated with @HandlesEvent("load") and execute it. (That method could be declared to return void.) Coupled with EL's ability to access bean properties, that capability generally suffices.

The taglib docs are located here: http://stripes.sourceforge.net/docs/current/taglib/

-Ben

Jeff wrote:
Renaud Bruyeron [hidden email] writes:

  
Just saw this this morning:

http://javajmc.blogspot.com/2006/10/migrating-from-webwork-to-stripes-pt-1.html

  - Renaud

    


Hey,

I'm the blogger mentioned above.

If you have any recommendations based on my experience so far (things i could do
to make things better) please let me know!

Paul and I went back and forth in the comments, and in my last comment i had a
suggestion for something in liked better in webwork than in stripes..would be
cool if Stripes had the equivalent of the ww:text tag, so enable lookup of keys
in properties files that were named the same as the action (for instance
MyAction.java has a MyAction.properties). Does a feature like this go against
the "Stripes Way"?

So far..thats really the only thing i miss from webwork that stripes doesnt have
(that i know of). Though it does help that i have a Manning Webwork book to
explain the webwork tags..i havent yet found the documentation for the Stripes
custom tags..though i'm sure its there in the API or something.

thanks..
-jeff



-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users
  

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users
Reply | Threaded
Open this post in threaded view
|

Re: spread the word: a blogger's experience moving from WW to stripes

Tim Fennell-3
In reply to this post by Jeff C-2
Hey Jeff,

Paul and I went back and forth in the comments, and in my last comment i had a
suggestion for something in liked better in webwork than in stripes..would be
cool if Stripes had the equivalent of the ww:text tag, so enable lookup of keys
in properties files that were named the same as the action (for instance
MyAction.java has a MyAction.properties). Does a feature like this go against
the "Stripes Way"?
Interesting.  It's odd because I was thinking about this a while back and effectively got talked out of it by Patrick (the WW dev) because he felt that the properties-file-per-action was something of an anti-pattern!  I do agree that Stripes could probably use more than the two files, and infact it may make sense to drop the distinction between "field name" and "message" bundles.  I wonder though if it'd be better to simply support multiple bundles that are looked through sequentially, or some other kind of multi-bundle setup that isn't tied to the ActionBean class?

So far..thats really the only thing i miss from webwork that stripes doesnt have
(that i know of). Though it does help that i have a Manning Webwork book to
explain the webwork tags..i havent yet found the documentation for the Stripes
custom tags..though i'm sure its there in the API or something.
I see Ben has already sent along a link to the tag-doc.  If you're using an IDE, it's all in the TLD, so it *should* get pulled in much like javadoc...

One other way to solve your getQueryString(String excludeParams) problem that I can think of would (though it's not as compact as simply being able to pass params to a function) would be to do something like:
    <c:set target="actionBean" property="excludeParams" value="x,y,x"/>
    <a href="/foo?${actionBean.queryString}">bar</a>

It's definitely more verbose, but I think it should do what you want....

-t

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users
Reply | Threaded
Open this post in threaded view
|

Re: spread the word: a blogger's experience moving from WW to stripes

paul.barry
In reply to this post by Jeff C-2
For the ww:text tag, there is no stripes equivalent.  The <fmt:message
key="whatever"/> tag works fine.  There are no per-action properties
files, a.k.a MyAction.properties, everything just goes into
StripesResources.properties.  So yes, that's not the stripes way.
Does this bother you?  Personally, I never saw the need for having a
properties file for each action.

Here's the link to the taglib docs, there's a link on that page to the
tlddoc, which is very helpful.

http://www.mc4j.org/confluence/display/stripes/Tag+Library+Doc

On 10/18/06, Jeff <[hidden email]> wrote:

> Renaud Bruyeron <bruyeron@...> writes:
>
> >
> >
> > Just saw this this morning:
> >
> > http://javajmc.blogspot.com/2006/10/migrating-from-webwork-to-stripes-pt-1.html
> >
> >   - Renaud
> >
>
>
> Hey,
>
> I'm the blogger mentioned above.
>
> If you have any recommendations based on my experience so far (things i could do
> to make things better) please let me know!
>
> Paul and I went back and forth in the comments, and in my last comment i had a
> suggestion for something in liked better in webwork than in stripes..would be
> cool if Stripes had the equivalent of the ww:text tag, so enable lookup of keys
> in properties files that were named the same as the action (for instance
> MyAction.java has a MyAction.properties). Does a feature like this go against
> the "Stripes Way"?
>
> So far..thats really the only thing i miss from webwork that stripes doesnt have
> (that i know of). Though it does help that i have a Manning Webwork book to
> explain the webwork tags..i havent yet found the documentation for the Stripes
> custom tags..though i'm sure its there in the API or something.
>
> thanks..
> -jeff
>
>
>
> -------------------------------------------------------------------------
> Using Tomcat but need to do more? Need to support web services, security?
> Get stuff done quickly with pre-integrated technology to make your job easier
> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> _______________________________________________
> Stripes-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/stripes-users
>

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users
Reply | Threaded
Open this post in threaded view
|

Re: spread the word: a blogger's experience moving from WW to stripes

Jeff C-2
In reply to this post by Tim Fennell-3
Tim Fennell <tfenne@...> writes:

>
> Hey Jeff,
>
> Interesting.  It's odd because I was thinking about this a while back and
>effectively got talked out of it by Patrick (the WW dev) because he felt
>that the properties-file-per-action was something of an anti-pattern!  
>I do agree that Stripes could probably use more than the two files, and
>infact it may make sense to drop the distinction between "field name" and
> "message" bundles.  I wonder though if it'd be better to simply support
>multiple bundles that are looked through sequentially, or some other kind
> of multi-bundle setup that isn't tied to the ActionBean class?
>
Tim..interesting. I could also be talked out of the properties file per action
idea..the multi-bundle idea would be cool..then we could organize the properties
files however we want ( i could have one for urls, one for form stuff, one for
error messages). Another reason this is handy, is that i have a properties file
that the app relies on, but that the operations group has control over. Things
like backend server urls and stuff that they dont want me changing..so that
file happens to be read only on the servers and cant be overwritten).

> One other way to solve your getQueryString(String excludeParams) problem that
>I can think of would (though it's not as compact as simply being able to
>pass params to a function) would be to do something like:
>     <c:set target="actionBean" property="excludeParams" value="x,y,x"/>
>     <a href="/foo?${actionBean.queryString}">bar</a>
>
> It's definitely more verbose, but I think it should do what you want....
>
> -t
>
Interesting...would that still work if i needed to generate multiple
queryStrings per page (to answer my question, it seems like it should)?
I have a page that links to many dynamic pages, so the exclude params are
different. I could try that and see if it works..right now i have this
custom tag lib call:
<c:set var="searchQueryString"
value="${fgUtils:getQueryString(pageContext.request,
'locId,locType,sp.searchTerm,pager.offset')}"/>

Since the method call is a static helper, i have to pass the request object
to it.

Finally..one last question. I see that you wrap the request object, which
caused this to fail ${pageContext.request.requestUrl}. I thought I would
still be able to get access to http request methods, but the jsp compiler
said no because the requestUrl method wasnt in the wrapper. Since
you extend the http request class..i dont see what that didnt work.

thanks for all the great help all!
-jeff


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users
Reply | Threaded
Open this post in threaded view
|

Re: spread the word: a blogger's experience moving from WW to stripes

paul.barry
Since I use a preAction for all of my jsp pages (I don't understand
the best practice of "Prefer <stripes:useActionBean ... /> over
pre-actions", but that's a different argument), I would have my action
bean do this:

public String getSearchQueryString() {
    return getContext().getQueryString("locId,locType,sp.searchTerm,pager.offset");
}

my BaseActionBeanContext would contain the getQueryString method that
knows how to get the URL and remove the unwanted parameters).  Then,
in the JSP page, you simply do this:

${actionBean.searchQueryString}

If the getSearchQueryString method is re-used on several pages, you
could move that into the context so that it could be re-used without
duplicating it everywhere.

Also, I would probably use a List<String> or String[] instead of a
comma-separated string, to make the getQueryString method cleaner.


On 10/18/06, Jeff <[hidden email]> wrote:

> Tim Fennell <tfenne@...> writes:
>
> >
> > Hey Jeff,
> >
> > Interesting.  It's odd because I was thinking about this a while back and
> >effectively got talked out of it by Patrick (the WW dev) because he felt
> >that the properties-file-per-action was something of an anti-pattern!
> >I do agree that Stripes could probably use more than the two files, and
> >infact it may make sense to drop the distinction between "field name" and
> > "message" bundles.  I wonder though if it'd be better to simply support
> >multiple bundles that are looked through sequentially, or some other kind
> > of multi-bundle setup that isn't tied to the ActionBean class?
> >
> Tim..interesting. I could also be talked out of the properties file per action
> idea..the multi-bundle idea would be cool..then we could organize the properties
> files however we want ( i could have one for urls, one for form stuff, one for
> error messages). Another reason this is handy, is that i have a properties file
> that the app relies on, but that the operations group has control over. Things
> like backend server urls and stuff that they dont want me changing..so that
> file happens to be read only on the servers and cant be overwritten).
>
> > One other way to solve your getQueryString(String excludeParams) problem that
> >I can think of would (though it's not as compact as simply being able to
> >pass params to a function) would be to do something like:
> >     <c:set target="actionBean" property="excludeParams" value="x,y,x"/>
> >     <a href="/foo?${actionBean.queryString}">bar</a>
> >
> > It's definitely more verbose, but I think it should do what you want....
> >
> > -t
> >
> Interesting...would that still work if i needed to generate multiple
> queryStrings per page (to answer my question, it seems like it should)?
> I have a page that links to many dynamic pages, so the exclude params are
> different. I could try that and see if it works..right now i have this
> custom tag lib call:
> <c:set var="searchQueryString"
> value="${fgUtils:getQueryString(pageContext.request,
> 'locId,locType,sp.searchTerm,pager.offset')}"/>
>
> Since the method call is a static helper, i have to pass the request object
> to it.
>
> Finally..one last question. I see that you wrap the request object, which
> caused this to fail ${pageContext.request.requestUrl}. I thought I would
> still be able to get access to http request methods, but the jsp compiler
> said no because the requestUrl method wasnt in the wrapper. Since
> you extend the http request class..i dont see what that didnt work.
>
> thanks for all the great help all!
> -jeff
>
>
> -------------------------------------------------------------------------
> Using Tomcat but need to do more? Need to support web services, security?
> Get stuff done quickly with pre-integrated technology to make your job easier
> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> _______________________________________________
> Stripes-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/stripes-users
>

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users
Reply | Threaded
Open this post in threaded view
|

Re: spread the word: a blogger's experience moving from WW to stripes

Tim Fennell-3
In reply to this post by Jeff C-2
> Interesting...would that still work if i needed to generate multiple
> queryStrings per page (to answer my question, it seems like it  
> should)?
I think it should too...there's no reason you can't reset the exclude  
parameters each time...

> Finally..one last question. I see that you wrap the request object,  
> which
> caused this to fail ${pageContext.request.requestUrl}. I thought I  
> would
> still be able to get access to http request methods, but the jsp  
> compiler
> said no because the requestUrl method wasnt in the wrapper. Since
> you extend the http request class..i dont see what that didnt work.
Wrapping the request shouldn't have any affect here because the  
wrapper *has* to implement HttpServletRequest.  Is it possible that  
this is a typo?  Taking a quick look it seems like the valid  
properties are 'requestURI' and 'requestURL', with the last three  
chars all upper case...

-t

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users
Reply | Threaded
Open this post in threaded view
|

Re: spread the word: a blogger's experience moving from WW to stripes

Jeff C-2
Tim Fennell <tfenne@...> writes:

> Wrapping the request shouldn't have any affect here because the  
> wrapper *has* to implement HttpServletRequest.  Is it possible that  
> this is a typo?  Taking a quick look it seems like the valid  
> properties are 'requestURI' and 'requestURL', with the last three  
> chars all upper case...
>
> -t
>
Good grief..i bet it was a typo. What a dolt! I looked through the javadoc and
saw that you extended the right class, which is why i was so confused. I guess
the JSTL stuff had me rattled :)

thanks again all..i really like what i see in Stripes.

-jeff


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users
Reply | Threaded
Open this post in threaded view
|

Re: spread the word: a blogger's experience moving from WW to stripes

Renaud Bruyeron-2
In reply to this post by Tim Fennell-3
Tim Fennell wrote:

> Hey Jeff,
>
>> Paul and I went back and forth in the comments, and in my last comment
>> i had a
>> suggestion for something in liked better in webwork than in
>> stripes..would be
>> cool if Stripes had the equivalent of the ww:text tag, so enable
>> lookup of keys
>> in properties files that were named the same as the action (for instance
>> MyAction.java has a MyAction.properties). Does a feature like this go
>> against
>> the "Stripes Way"?
> Interesting.  It's odd because I was thinking about this a while back
> and effectively got talked out of it by Patrick (the WW dev) because he
> felt that the properties-file-per-action was something of an
> anti-pattern!  I do agree that Stripes could probably use more than the
> two files, and infact it may make sense to drop the distinction between
> "field name" and "message" bundles.  I wonder though if it'd be better
> to simply support multiple bundles that are looked through sequentially,
> or some other kind of multi-bundle setup that isn't tied to the
> ActionBean class?

I am a fan of Spring's MessageSource abstraction, especially the
reloadable flavour which is very handy during development. It also
supports the multi-bundle feature you are after.
It should be easy enough to code up a LocalizationBundleFactory that
locates a
org.springframework.context.support.MessageSourceResourceBundle from a
spring context, for example.

  - Renaud


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users
Reply | Threaded
Open this post in threaded view
|

Re: spread the word: a blogger's experience moving from WW to stripes

Rasmus Monnerup
In reply to this post by Tim Fennell-3
Hi Tim and all,

I am a big fan of Stripes and I think it is very easy to override the
parts of Stripes that I want to customize, but as it is now I don't think
Stripes is so flexible in the case where you would like to override
localized text, for instance in ScopedLocalizableError and the
functionality the LocalizationUtility.

I am currently working on a website where I not only have to handle
multiple languages but also have to handle different tones/flavors in
the language, so I have to override the ScopedLocalizableError and
LocalizationUtility to prefix the bundle keys.

I have submitted a proposal for a LocalizableTextFactory (STS-249) in
Jira, which I think is a good solution for developers who like to
customize Stripes localized text handling.

Thanks for a good framework,

/Rasmus


On 18/10/06, Tim Fennell <[hidden email]> wrote:

> Hey Jeff,
>
>
>
> Paul and I went back and forth in the comments, and in my last comment i had
> a
> suggestion for something in liked better in webwork than in stripes..would
> be
> cool if Stripes had the equivalent of the ww:text tag, so enable lookup of
> keys
> in properties files that were named the same as the action (for instance
> MyAction.java has a MyAction.properties). Does a feature like this go
> against
> the "Stripes Way"?
> Interesting.  It's odd because I was thinking about this a while back and
> effectively got talked out of it by Patrick (the WW dev) because he felt
> that the properties-file-per-action was something of an anti-pattern!  I do
> agree that Stripes could probably use more than the two files, and infact it
> may make sense to drop the distinction between "field name" and "message"
> bundles.  I wonder though if it'd be better to simply support multiple
> bundles that are looked through sequentially, or some other kind of
> multi-bundle setup that isn't tied to the ActionBean class?
>
>
> So far..thats really the only thing i miss from webwork that stripes doesnt
> have
> (that i know of). Though it does help that i have a Manning Webwork book to
> explain the webwork tags..i havent yet found the documentation for the
> Stripes
> custom tags..though i'm sure its there in the API or something.I see Ben has
> already sent along a link to the tag-doc.  If you're using an IDE, it's all
> in the TLD, so it *should* get pulled in much like javadoc...
>
> One other way to solve your getQueryString(String excludeParams) problem
> that I can think of would (though it's not as compact as simply being able
> to pass params to a function) would be to do something like:
>     <c:set target="actionBean" property="excludeParams" value="x,y,x"/>
>     <a href="/foo?${actionBean.queryString}">bar</a>
>
> It's definitely more verbose, but I think it should do what you want....
>
> -t
> -------------------------------------------------------------------------
> Using Tomcat but need to do more? Need to support web services, security?
> Get stuff done quickly with pre-integrated technology to make your job
> easier
> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
>
> _______________________________________________
> Stripes-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/stripes-users
>
>
>

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users