Re: [Stripes-users] View component inclusion
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 do that with the useActionBeanTag (s:useActionBean beanclass=test.TestUseActionBean event=view executeResolution=true alwaysExecuteEvent=true var=myAb/ with TestUseActionBean handler returning a ForwardResolution to test-uab.jsp) it avoids the main jsp rendering and only show the test-uab.jsp -- 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] View component inclusion
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 respond to HTTP requests, and you can server-side include it in any JSP using jsp:include : @UrlBinding(/myPartial.action) class MyAction implements ActionBean { String prop1; // and other props @DefaultHandler Resolution display() { return new ForwardResolution(/WEB-INF/my-partial-html.jsp); } } Via HTTP (outputs the fragment only) : http://.../myapp/myPartial.action?prop1=foobar Inside a .jsp : html ... divjsp:include page=/myPartial.action//div ... /html HTH Cheers Remi 2011/1/4 Jonathan jesuisjonat...@gmx.fr 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 do that with the useActionBeanTag (s:useActionBean beanclass=test.TestUseActionBean event=view executeResolution=true alwaysExecuteEvent=true var=myAb/ with TestUseActionBean handler returning a ForwardResolution to test-uab.jsp) it avoids the main jsp rendering and only show the test-uab.jsp -- 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] View component inclusion
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 on feedback from the mailing list I think there is no right way to do that. I think the use of the JSTL tag c:import/ is the closest answer to what I'm looking to do. An other solution : implementing a special include tag that wrap request to avoid conflicts between parameters and attributes of the main request and those of the include request. Thank you all for your help -- 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] View component inclusion
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 anyone else could keep guessing... apparently incorrectly... . --Nikolaos Jonathan wrote: 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 on feedback from the mailing list I think there is no right way to do that. I think the use of the JSTL tag c:import/ is the closest answer to what I'm looking to do. An other solution : implementing a special include tag that wrap request to avoid conflicts between parameters and attributes of the main request and those of the include request. Thank you all for your help -- 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] View component inclusion
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 the request/response cycle). So unless your main controller action (the one handling the incoming http request) is the same as the one you include in the view (that would be quite weird :P), and you access this main controller after inclusions (like ${actionBean.xyz}), I can't see an issue here. Am I missing something ? Cheers Remi 2011/1/4 Jonathan jesuisjonat...@gmx.fr 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 on feedback from the mailing list I think there is no right way to do that. I think the use of the JSTL tag c:import/ is the closest answer to what I'm looking to do. An other solution : implementing a special include tag that wrap request to avoid conflicts between parameters and attributes of the main request and those of the include request. Thank you all for your help -- 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] View component inclusion
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 ActionBean and you jsp:include a request to a different ActionBean, then ${actionBean} before the include is different from ${actionBean} after the include. -Ben On Tue, Jan 4, 2011 at 8:39 AM, VANKEISBELCK Remi r...@rvkb.com wrote: 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 the request/response cycle). So unless your main controller action (the one handling the incoming http request) is the same as the one you include in the view (that would be quite weird :P), and you access this main controller after inclusions (like ${actionBean.xyz}), I can't see an issue here. Am I missing something ? Cheers Remi 2011/1/4 Jonathan jesuisjonat...@gmx.fr 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 on feedback from the mailing list I think there is no right way to do that. I think the use of the JSTL tag c:import/ is the closest answer to what I'm looking to do. An other solution : implementing a special include tag that wrap request to avoid conflicts between parameters and attributes of the main request and those of the include request. Thank you all for your help -- 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] View component inclusion
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 behave as expected when including a Stripes action. I'm sure I've done this already without any problem... Cheers Remi 2011/1/4 Ben Gunter gunter...@gmail.com 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 ActionBean and you jsp:include a request to a different ActionBean, then ${actionBean} before the include is different from ${actionBean} after the include. -Ben On Tue, Jan 4, 2011 at 8:39 AM, VANKEISBELCK Remi r...@rvkb.com wrote: 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 the request/response cycle). So unless your main controller action (the one handling the incoming http request) is the same as the one you include in the view (that would be quite weird :P), and you access this main controller after inclusions (like ${actionBean.xyz}), I can't see an issue here. Am I missing something ? Cheers Remi 2011/1/4 Jonathan jesuisjonat...@gmx.fr 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 on feedback from the mailing list I think there is no right way to do that. I think the use of the JSTL tag c:import/ is the closest answer to what I'm looking to do. An other solution : implementing a special include tag that wrap request to avoid conflicts between parameters and attributes of the main request and those of the include request. Thank you all for your help -- 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] View component inclusion
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 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 behave as expected when including a Stripes action. I'm sure I've done this already without any problem... Cheers Remi 2011/1/4 Ben Gunter gunter...@gmail.com 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 ActionBean and you jsp:include a request to a different ActionBean, then ${actionBean} before the include is different from ${actionBean} after the include. -Ben On Tue, Jan 4, 2011 at 8:39 AM, VANKEISBELCK Remi r...@rvkb.com wrote: 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 the request/response cycle). So unless your main controller action (the one handling the incoming http request) is the same as the one you include in the view (that would be quite weird :P), and you access this main controller after inclusions (like ${actionBean.xyz}), I can't see an issue here. Am I missing something ? Cheers Remi 2011/1/4 Jonathan jesuisjonat...@gmx.fr 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 on feedback from the mailing list I think there is no right way to do that. I think the use of the JSTL tag c:import/ is the closest answer to what I'm looking to do. An other solution : implementing a special include tag that wrap request to avoid conflicts between parameters and attributes of the main request and those of the include request. Thank you all for your help -- 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] View component inclusion
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 list) it also doesn't work since the action bean is cached and the action bean keep the first line state. Example, the fallowing jsp as a pre-action bean search.ProjectSearchFormAction : s:form beanclass=search.ProjectSearchFormAction ol class=search-grid smart-grid c:forEach items=${actionBean.projects} var=project jsp:include beanclass=search.ProjectSearchItemViewAction event=view jsp:param name=projectId value=${project.entryId}/ /jsp:include /c:forEach /ol /s:form -- 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] View component inclusion
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 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 list) it also doesn't work since the action bean is cached and the action bean keep the first line state. Example, the fallowing jsp as a pre-action bean search.ProjectSearchFormAction : s:form beanclass=search.ProjectSearchFormAction ol class=search-grid smart-grid c:forEach items=${actionBean.projects} var=project jsp:include beanclass=search.ProjectSearchItemViewAction event=view jsp:param name=projectId value=${project.entryId}/ /jsp:include /c:forEach /ol /s:form -- 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] View component inclusion
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 getSearchFields() { // Make a call to loop through the projects and create // a collection of search fields } } Then, your JSP can look like this: s:form action=/ProjectSearch.action ol:class=search-grid smart-grid c:forEach items=${actionBean.searchFields} var=searchField jsp:include page=fieldfragment.jsp jsp:param name=projectId value=${searchField}/ /jsp:include /c:forEach /ol /s:form -- Rick On Tue, Jan 4, 2011 at 8:31 AM, Jonathan jesuisjonat...@gmx.fr wrote: 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 list) it also doesn't work since the action bean is cached and the action bean keep the first line state. Example, the fallowing jsp as a pre-action bean search.ProjectSearchFormAction : s:form beanclass=search.ProjectSearchFormAction ol class=search-grid smart-grid c:forEach items=${actionBean.projects} var=project jsp:include beanclass=search.ProjectSearchItemViewAction event=view jsp:param name=projectId value=${project.entryId}/ /jsp:include /c:forEach /ol /s:form -- 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] View component inclusion
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. -- 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] View component inclusion
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 reference that in the getSearchFields() method (or whatever the method is). -- Rick On Tue, Jan 4, 2011 at 9:49 AM, Jonathan jesuisjonat...@gmx.fr wrote: 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. -- 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] View component inclusion
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 means that I have a root action bean (with a view handler) that return ForwardResolution to a jsp and this jsp include the pagelet. -- 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] View component inclusion
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, Jan 3, 2011 at 8:53 AM, Jonathan jesuisjonat...@gmx.fr wrote: 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 means that I have a root action bean (with a view handler) that return ForwardResolution to a jsp and this jsp include the pagelet. -- 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] View component inclusion
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 for a simple jsp. I've coded a custom tag that can do that but it's not clean since I have to isolate the action bean from the parent one (event name, parameters ...) Something tells me that I'm doing something wrong, not in the Stripes mindset. So what's the solution, or how do you do this kind of thing? Thanks. Jonathan. -- 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] View component inclusion
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 times in IRC and I know there are a couple of ways to solve it. But it depends really on what exactly the component is... i.e. the use case. -- Rick On Sun, Jan 2, 2011 at 6:11 PM, Jonathan jesuisjonat...@gmx.fr wrote: 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 for a simple jsp. I've coded a custom tag that can do that but it's not clean since I have to isolate the action bean from the parent one (event name, parameters ...) Something tells me that I'm doing something wrong, not in the Stripes mindset. So what's the solution, or how do you do this kind of thing? Thanks. Jonathan. -- 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] View component inclusion
I'm working on something similar but not using a jsp. Basically, I implement my own resolution in the action bean and return the actionbean class after the action has been executed. maybe u will find it useful. public abstract class HSPage implements ActionBean, Resolution { public void execute( HttpServletRequest request, HttpServletResponse response ) throws Exception { //Do your custome logic and but you must write the response back the like this byte[] buffer = new byte[ 512 ]; try { ServletOutputStream out = response.getOutputStream(); int length = 0; while ( ( length = is.read( buffer ) ) != -1 ) { out.write( buffer, 0, length ); } } } } Then use it like this @UrlBinding(/hope.action) public class DirectPage extends HSPage { private DemoPerson person; @DefaultHandler public Resolution hello() { this.person = new DemoPerson(); person.setForename(Farouk); person.setSurname(Alhassan); person.setEmail(osbert252...@yahoo.com); DemoBook book = new DemoBook(); book.setAuthor(farouk A); book.setPublishingDate(new Date() ); ListDemoBook books = new ArrayListDemoBook(); books.add(book); person.setBooks(books); return this; } public DemoPerson getPerson() { return person; } public void setPerson(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, 2011, 1:02 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 times in IRC and I know there are a couple of ways to solve it. But it depends really on what exactly the component is... i.e. the use case. -- Rick On Sun, Jan 2, 2011 at 6:11 PM, Jonathan jesuisjonat...@gmx.fr wrote: 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 for a simple jsp. I've coded a custom tag that can do that but it's not clean since I have to isolate the action bean from the parent one (event name, parameters ...) Something tells me that I'm doing something wrong, not in the Stripes mindset. So what's the solution, or how do you do this kind of thing? Thanks. Jonathan. -- 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 -Inline Attachment Follows- -- 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 -Inline Attachment Follows- ___ 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