Re: [Stripes-users] View component inclusion

2011-01-04 Thread Jonathan
Hello. Yes you're right its a kind of useActionBean but as written in the best practices wiki page (http://www.stripesframework.org/display/stripes/Best+Practices) Prefer pre-actions over stripes:useActionBean ... /. What I want to do is to include the pre-action forward resolution in a jsp. If I

Re: [Stripes-users] View component inclusion

2011-01-04 Thread VANKEISBELCK Remi
Hi, Correct if I'm wrong, you have action beans that generate page fragments (as HTML I guess), that you want to be able to invoke over HTTP (AJAX update), and also as parts of a more global page ? If yes, I guess that what you need is just a regular action that generates the fragment : it'll

Re: [Stripes-users] View component inclusion

2011-01-04 Thread Jonathan
This seems to be the solution to first order, but Stripes keeps some informations in the request (the action bean, the name of the event) that prevents this method to function (event name conflict in some cases, impossible to make multiple inclusions of same action bean since it's cached). Based

Re: [Stripes-users] View component inclusion

2011-01-04 Thread Nikolaos Giannopoulos
Jonothan, Without sufficient code its really hard to figure out what you are looking for and then you say this and that won't work. Why don't you provide the actual code you have - as complete as possible - and then I imagine people can help you. Because as it stands Farouk, Remi, Ben and

Re: [Stripes-users] View component inclusion

2011-01-04 Thread VANKEISBELCK Remi
Not sure I understand. You say you can't do this : my.jsp : html jsp:include page=/partial.action/ jsp:include page=/partial.action/ /html ? I think I've done this already... strange. As you say, Stripes does bind stuff to the request, but each include is isolated (it behaves like a full

Re: [Stripes-users] View component inclusion

2011-01-04 Thread Ben Gunter
I think what Jonathan is saying is correct, though I've never personally been troubled by it. Stripes stuffs the current ActionBean -- the one that is handling the request -- into request scope under the key actionBean. (Of course you know that.) So if you're in a JSP that was forwarded from an

Re: [Stripes-users] View component inclusion

2011-01-04 Thread VANKEISBELCK Remi
Yeah sure, but it can be solved easily by storing the variable before inclusion, ans using this in the main page. You should have no problems inside the fragments, as Stripes will override the request atrribute when executing the included event. I was more wondering if the jsp:include didn't

Re: [Stripes-users] View component inclusion

2011-01-04 Thread VANKEISBELCK Remi
And btw the various actions are also stored using the class name if I remember well... so you can find your beans in the request scope when you have more than one. Cheers Remi 2011/1/4 VANKEISBELCK Remi r...@rvkb.com Yeah sure, but it can be solved easily by storing the variable before

Re: [Stripes-users] View component inclusion

2011-01-04 Thread Jonathan
The jsp:include works for simple case but if one of the main action bean parameters has the same name that a parameter of the included action bean there is a collision (for example an parameters named entryId). Another problem, if you use the inclusion in a loop (for example to render a line of a

Re: [Stripes-users] View component inclusion

2011-01-04 Thread Rick Grashel
Jonathan, Can you tell us exactly what ProjectSearchItemViewAction is? Is this just creating a list of form fields that can be searched? If so, then there are other ways to solve this problem. Thanks. -- Rick On Tue, Jan 4, 2011 at 8:31 AM, Jonathan jesuisjonat...@gmx.fr wrote: The

Re: [Stripes-users] View component inclusion

2011-01-04 Thread Rick Grashel
Jonathan, I think what you need here is a single pre-action that will set up everything your search form needs. For example: public class ProjectSearchAction { public Resolution doPreSearch() { return new ForwardResolution( /my_search_page.jsp ); } public Collection String

Re: [Stripes-users] View component inclusion

2011-01-04 Thread Jonathan
Yes it works. But I can not reuse the logic in getSearchFields() if I need it for other pages (for the sake of modularizing presentation). I need to duplicate the code or creating a class that hold the code and delegate to it but it can be considered as the lesser of two evils.

Re: [Stripes-users] View component inclusion

2011-01-04 Thread Rick Grashel
You can always create an ActionBean superclass if you want to re-use that logic in other action beans (this is probably the best approach). Or... if abstracting the logic into a superclass is not appropriate then you could easily create a simple view helper class (which has the logic) and

Re: [Stripes-users] View component inclusion

2011-01-03 Thread Jonathan
Hello. Thanks for you response. I'm using kind of page pieces (call it pagelets, composed of an action bean and e jsp) that ca be loaded by Ajax or server side if javascript is not enabled. For example, a widget of most viewed related contents on the right side of the page (like on Youtube). It

Re: [Stripes-users] View component inclusion

2011-01-03 Thread Ben Gunter
I'm not totally clear on what it is you're looking for, but it seems like you might find the stripes:useActionBean tag useful. http://stripes.sourceforge.net/docs/current/taglib/stripes/useActionBean.html http://stripes.sourceforge.net/docs/current/taglib/stripes/useActionBean.html -Ben On Mon,

[Stripes-users] View component inclusion

2011-01-02 Thread Jonathan
Hello. I'm using Stripes for 3 years now and I never answered this question : What is the good way to include a view component (stripes action bean) into a jsp ?, in other words : how to make a layout-definition with a action bean. I often need it to reuse presentation logic that is too complex

Re: [Stripes-users] View component inclusion

2011-01-02 Thread Rick Grashel
Jonathan, What is the logic that you are trying to include? A lot of times, you can just use Helper objects or what not and just use a plain-old jsp:useBean. Especially if the logic provided is fairly static or non-stateful. What is the kind of view component? We've talked about this a few

Re: [Stripes-users] View component inclusion

2011-01-02 Thread farouk alhassan
(DemoPerson person) {     this.person = person;     } } --- On Mon, 3/1/11, Rick Grashel rgras...@gmail.com wrote: From: Rick Grashel rgras...@gmail.com Subject: Re: [Stripes-users] View component inclusion To: Stripes Users List stripes-users@lists.sourceforge.net Date: Monday, 3 January