Re: about Struts 2.0.9 portlet example ...

2007-10-22 Thread Guillaume Bilodeau
We will soon start a portal project and we're evaluating the technologies available to us. Is Struts2 support for portlets ready for primetime, or should we use something else until it's stabilized? Cheers, GB Nils-Helge Garli wrote: > > Hi! > > If you're thinking of the struts2-portlet appl

Re: about Struts 2.0.9 portlet example ...

2007-10-24 Thread Guillaume Bilodeau
in production > already. > > Nils-H > > On 10/23/07, Guillaume Bilodeau <[EMAIL PROTECTED]> wrote: >> >> We will soon start a portal project and we're evaluating the technologies >> available to us. Is Struts2 support for portlets ready for primetime

Mapping multiple enums to a nested object

2007-09-23 Thread Guillaume Bilodeau
Hi all, I'm quite new to Struts2 and so far I love what I see. Currently I'm having a problem trying to map a checkboxlist based on a set of enums to a model object nested in my action. Here's what I have now: JSP:

Re: Mapping multiple enums to a nested object

2007-09-23 Thread Guillaume Bilodeau
Looks like the JSP code doesn't show. Here it is: [s:form action="createSimpleFood.go" method="post" namespace="/nutrition"] [s:textfield key="food.name" name="model.name" /][br/] [s:select key="food.group" name="model.group" list="availableGroups" /]

Re: Mapping multiple enums to a nested object

2007-09-24 Thread Guillaume Bilodeau
wrote: > > Guillaume, > > I don't see a Food getter and setter on your action. > > Guillaume Bilodeau on 23/09/07 18:48, wrote: >> Hi all, >> >> I'm quite new to Struts2 and so far I love what I see. Currently I'm >> having >> a pro

Re: Mapping multiple enums to a nested object

2007-09-24 Thread Guillaume Bilodeau
Yes it was deliberate. I'm not sure I see the advantages of flattening my action *and* my request object, for now I'd rather keep this nested as it currently is. Of course I'll change my mind if given the right counter-arguments :) newton.dave wrote: > > --- Guill

Re: Mapping multiple enums to a nested object

2007-09-24 Thread Guillaume Bilodeau
value stack and that one could reference and bind parameters to nested objects in the JSP. Am I mistaken? Thanks for your help, GB newton.dave wrote: > > --- Guillaume Bilodeau <[EMAIL PROTECTED]> wrote: >> Yes it was deliberate. I'm not sure I see the >> advantages of

Re: Mapping multiple enums to a nested object

2007-09-24 Thread Guillaume Bilodeau
OGNL code to see exactly what's going on now. newton.dave wrote: > > Whoops! > > Guillaume Bilodeau wrote: >> 1- I'm using "food.name" as the text field key - not >> as its name - so a localized label will be shown > next >> to it. > > Y

Re: Mapping multiple enums to a nested object

2007-09-25 Thread Guillaume Bilodeau
the request object? Do I need to specify something else? Thanks, GB Guillaume Bilodeau wrote: > > Hey no problem, I'm kind of sluggish also :) It's true that I could use a > different method name to expose the nested object, it does bring some > confusion. > > Somehow

Re: Mapping multiple enums to a nested object

2007-09-25 Thread Guillaume Bilodeau
Yes I tried that, with no success unfortunately. Somehow we need to specify that: 1- selectedNutrients[] will need to be mapped to an array of Nutrients 2- each element of selectedNutrients[] must be mapped using EnumTypeConverter cilquirm wrote: > > Are enums type-converted automatically now?

Re: Mapping multiple enums to a nested object

2007-09-25 Thread Guillaume Bilodeau
> > If so, you might be able to use the EnumTypeConverter from the showcase > app, or roll your own based off it, which isn't that hard at all. > > org.apache.struts2.showcase.conversion.EnumTypeConverter > > hth, > -a > > > > Guillaume Bilo

Re: Mapping multiple enums to a nested object

2007-09-25 Thread Guillaume Bilodeau
e is a fairly good > starting point that should get you at least halfway. > > hth, > -a > > > Guillaume Bilodeau wrote: >> >> So you're saying that the showcase EnumTypeConverter isn't the same as >> the one provided in XWork2? >> >>

Setting default @ParentPackage value

2008-03-21 Thread Guillaume Bilodeau
Hi guys, I've spent some time migrating my Struts2 app configuration from struts.xml to annotations. So far so good, it's nice having configuration next to actual code. One thing that's bothering me is the fact that I need to put a @ParentPackage annotation on each action class for it to pick u

Re: Problem in ObjectFactory.buildResult? OGNLExceptions can halt setting of valid properties

2008-04-05 Thread Guillaume Bilodeau
Hi Aaron, I'm running into a similar problem - I'm using a ServletActionRedirectResult instead of the JSONResult. Were you able to work around this? It seems that it's been fixed in 2.1 (cf issue WW-2170) but it doesn't look like it will reach GA anytime soon. Cheers, GB Aaron Brown-4 wrote:

RE: interesting proxy + action chain issue

2008-04-10 Thread Guillaume Bilodeau
Hi Brad, Have you tried this: http://www.vitarara.org/cms/struts_2_cookbook/post_and_redirect I've used this for a while with good results, although recently I've stumbled on WW-2170 ( https://issues.apache.org/struts/browse/WW-2170 ). It seems to occur only when using annotations though. Chee

Re: S2 Textfield tag date formatting

2008-04-10 Thread Guillaume Bilodeau
That note about not using type conversion for dates probably has to do with the fact that dates can be formatted and so parsed using different patterns depending on different locales. If your code uses a fixed pattern such as yours, I suppose you can ignore this. So based on that, you can simply

RE: interesting proxy + action chain issue

2008-04-10 Thread Guillaume Bilodeau
:-) > > What I'm not sure how to do is to get the error messages into the > redirect url, and it seems like something you'd want often enough for it > to be built-in to ServletActionRedirectResult (or a class which extends > it). > > Brad Cupit > Louisiana State U

Validation result URL contains failed parameters

2008-04-10 Thread Guillaume Bilodeau
Hi guys, I'm using Struts 2.0.11 for a standard web application and using annotations all the way. I have the following action, with some fields and getters / setters omitted for brevity: @ParentPackage("default") @Results( { @Result(name = "input", type = ServletDispatcherResul

Re: Does Struts 2 support clustering?

2008-04-11 Thread Guillaume Bilodeau
I suggest you have a look at the source code for the org.apache.struts2.dispatcher.SessionMap, this is what gets injected to your SessionAware action. As you'll see it's simply a class that implements the java.util.Map interface and wraps a HttpSession. Calls to the get, put and remove methods a

Re: Does Struts 2 support clustering?

2008-04-11 Thread Guillaume Bilodeau
quest, clearing the session, and invalidating the session, right? Also, is the serialVersionUID in fact the same thing as the sessionId? Guillaume Bilodeau wrote: > > I suggest you have a look at the source code for the > org.apache.struts2.dispatcher.SessionMap, this is what

Re: Validation result URL contains failed parameters

2008-04-11 Thread Guillaume Bilodeau
*sigh* I confused the s:form method attribute and used it to specify the method to call on the action, not the HTTP form submit method. Everything's working now. Definitely not my brightest moment. Thanks a bunch, GB Laurie Harper wrote: > > Guillaume Bilodeau wrote: >> Hi

Re: how do i make the tomcat server send a 403 Forbidden response in JSP and in Struts?

2008-04-12 Thread Guillaume Bilodeau
HttpServletResponse.SC_FORBIDDEN is an int value, it should compile. Another option is to use Acegi to manage application security. It allows you to restrict access to URL patterns and/or object methods using user roles. Taking this road is not a trivial undertaking though. http://www.acegisec

Re: [S2] Matching string validator

2008-04-14 Thread Guillaume Bilodeau
Sure, you can use an ExpressionValidator annotation with an OGNL expression like this: @ExpressionValidator(expression = "password1.equals(password2)", ...) Cheers, GB Kelly.Graus wrote: > > Hello, > > Does struts 2 have a built in validator that will allow me to make sure > two fields match

Re: ServletRedirectActionResult - is there a way to set parameters?

2008-04-17 Thread Guillaume Bilodeau
Hi Alex, You can declare your different interceptor stacks in different packages and then declare the parent package on the action like this: @ParentPackage("packageWithEmptyStack") public class FooAction ... Aside from bug WW-2170 and the repeated use of the @ParentPackage annotation, I prefer

Re: Is there such a thing as flash in S2?

2008-04-17 Thread Guillaume Bilodeau
Hi Ian, First let me congratulate you on your Struts2 book, I honestly think it's one of the best technical books I've read in a while: it's thorough, practical and tackles every day issues. Kudos to you! About that WebWork flash interceptor, it seems to me that it's not that useful. AFAICT it

RE: Is there such a thing as flash in S2?

2008-04-17 Thread Guillaume Bilodeau
I'm aware of the chain result but I'd prefer to stick to the redirect result. This hypothetical flash result could list the properties that should survive the redirect, so I think we would avoid the problem with the CGLIB proxy. I'll investigate writing such a result / interceptor pair. I suppo

Re: S2 ognl-2.6.11.jar source code

2008-04-24 Thread Guillaume Bilodeau
http://mirrors.ibiblio.org/pub/mirrors/maven2/opensymphony/ognl/2.6.11/ It took me a while to find it too :) Cheers, GB Greg Lindholm wrote: > > Can someone tell me where to find the source for ognl-2.6.11.jar? > > I've looked on www.ognl.org but it only goes up to 2.6.9. > > I've looked on

RE: Is there such a thing as flash in S2?

2008-04-24 Thread Guillaume Bilodeau
Hi guys, I have just developed a FlashResult / FlashInterceptor pair - turns out it wasn't that difficult. I couldn't give it much testing (for the moment the only use case in my application that requires flash scope is showing success messages following a redirect) but for what it's worth it se

Re: Redirect-action parameters via POST

2008-04-25 Thread Guillaume Bilodeau
The use case you're describing would be best implemented using flash scope. Your options include: . use the Scope plugin (http://cwiki.apache.org/S2PLUGINS/scope-plugin.html) . implement the scope yourself using a result / interceptor pair as discussed in this forum (http://www.nabble.com/Is-the

Re: Redirect-action parameters via POST

2008-04-25 Thread Guillaume Bilodeau
If you do insist on sending those parameters via POST, you could use a ServletDispatcherResult (the default one) to a JSP with a form populated with values from the action and have the form submit when the page is loaded, either through a or a JS library like jQuery. Cheers, GB Guillaume

RE: Is there such a thing as flash in S2?

2008-06-05 Thread Guillaume Bilodeau
Great! I'm glad it worked fine. I'll merge your documentation additions as soon as I have a moment, thanks for providing them. I like your idea of generating multiple flash map IDs, it seems like a good solution would make the implementation more flexible. Feel free to modify the code and uplo