Re: Error with chekboxlist

2015-10-17 Thread Jasper Rosenberg
I’ve seen this behavior a couple of times over the years, and I’m sorry that I 
can’t recall the exact issue when I’ve tracked it down, but basically something 
is null, probably either the “samples” list, or an element in that list.

-Jasper

> On Oct 17, 2015, at 10:23 AM, Lukasz Lenart  wrote:
> 
> Do you use that JSP outside of an action? Struts version? I've been
> testing with the latest SNAPSHOT and no such problem
> 
> 
> 2015-10-16 11:28 GMT+02:00 Yaragalla Muralidhar :
>> Hi ,
>> the following is the code in jsp.
>> 
>> 
>> 
>> samples is an arraylist of strings.
>> 
>> when i put the above tag i am getting the following error. Please help me
>> to rectify this.
>> 
>> 
>> Error on line 30, column 13 in template/simple/checkboxlist.ftl
>> stack.findValue('top') is undefined.
>> It cannot be assigned to itemKey
>> The problematic instruction:
>> --
>> ==> assignment: itemKey=stack.findValue('top') [on line 30, column 13 in
>> template/simple/checkboxlist.ftl]
>> in user-directive s.iterator [on line 25, column 1 in
>> template/simple/checkboxlist.ftl]
>> in include "/${parameters.templateDir}/simple/checkboxlist.ftl" [on line
>> 24, column 1 in template/xhtml/checkboxlist.ftl]
>> --
>> 
>> Java backtrace for programmers:
>> --
>> freemarker.core.InvalidReferenceException: Error on line 30, column 13 in
>> template/simple/checkboxlist.ftl
>> stack.findValue('top') is undefined.
>> It cannot be assigned to itemKey
>> at freemarker.core.Assignment.accept(Assignment.java:111)
>> at freemarker.core.Environment.visit(Environment.java:221)
>> at freemarker.core.IfBlock.accept(IfBlock.java:82)
>> at freemarker.core.Environment.visit(Environment.java:221)
>> at freemarker.core.MixedContent.accept(MixedContent.java:92)
>> at freemarker.core.Environment.visit(Environment.java:221)
>> at freemarker.core.Environment.visit(Environment.java:310)
>> at freemarker.core.UnifiedCall.accept(UnifiedCall.java:130)
>> at freemarker.core.Environment.visit(Environment.java:221)
>> at freemarker.core.IfBlock.accept(IfBlock.java:82)
>> at freemarker.core.Environment.visit(Environment.java:221)
>> 
>> 
>> 
>> 
>> *Thanks and Regards,*
>> Muralidhar Yaragalla.
>> 
>> *http://yaragalla.blogspot.in/ *
> 
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
> 


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



How to add a global interceptor

2015-10-13 Thread Jasper Rosenberg
Hi,


 
I work on a project with hundreds of struts actions manywith their own custom 
interceptor stacks specified.  


 
We have recently internationalized the site, and so I had aneed to add an i18n 
interceptor to the top of every action stack.  It would have been impractical 
(and difficultto enforce for future actions) to add the new interceptor to 
every actiondefinition.


 
My solution was to override the ActionProxyFactory to returnour own 
ActionInvocation, which in turn always prepends the i18n interceptor tothe 
interceptor stack during initialization. 


 
I submitted a patch to make this extension simpler: 
https://issues.apache.org/jira/browse/WW-4553


 
However, it was suggested in the comments for this JIRA thatthere might be 
alternative methods to achieve my goal and to ask on this emaillist.  Thanks in 
advance for any advice!


 
-Jasper



Re: How to add a global interceptor

2015-10-13 Thread Jasper Rosenberg
Thanks for the feedback!
To be clear, we do have a number of interceptor stacks that are shared and we 
follow a similar pattern to what you describe where we add additional 
interceptors where needed before or after a common stack.  There are places 
that we might be able to reduce even that pattern by switching to action 
mapping parameters, I will definitely revisit that.  
The real problem is simply that there are so many actions at this point that to 
make sure we didn't miss any outlier custom stacks, we would have to review 
each one.  We would then have to add a struts configuration validation step to 
make sure no one introduced a new stack missing the required one (which I 
suppose wouldn't be that big a deal since we already do other configuration 
checks in development mode in a DispatcherListener).  Definitely food for 
thought...
Thanks,Jasper
  From: Christoph Nenning <christoph.nenn...@lex-com.net>
 To: Struts Users Mailing List <user@struts.apache.org> 
 Sent: Tuesday, October 13, 2015 7:35 AM
 Subject: Re: How to add a global interceptor
   
> From: Jasper Rosenberg <jasper_rosenb...@yahoo.com.INVALID>
> To: "user@struts.apache.org" <user@struts.apache.org>, 
> Date: 13.10.2015 13:26
> Subject: How to add a global interceptor
> 
> Hi,
> 
> 
>  
> I work on a project with hundreds of struts actions manywith their 
> own custom interceptor stacks specified.  
> 

Having actions with own interceptor stacks is quite special. Usually 
people have hundreds of actions but just a few interceptor stacks. And the 
few stacks are not created by copy-paste but by overriding configuration 
parameters and adding interceptors at the beginning or end of the stack.




> 
>  
> We have recently internationalized the site, and so I had aneed to 
> add an i18n interceptor to the top of every action stack.  It would 
> have been impractical (and difficultto enforce for future actions) 
> to add the new interceptor to every actiondefinition.
> 
> 
>  
> My solution was to override the ActionProxyFactory to returnour own 
> ActionInvocation, which in turn always prepends the i18n interceptor
> tothe interceptor stack during initialization. 
> 

In your case that sounds alright.


What are the reasons that you need so many different interceptor stacks?


Regards,
Christoph

This Email was scanned by Sophos Anti Virus


  

Re: How to add a global interceptor

2015-10-13 Thread Jasper Rosenberg
No need for pity :)  It really hasn't really much maintenance overhead to this 
point.  Needing to do a change to all stacks is really the only case where I've 
seen it be problem.  Still, we have been pretty conservative in trying to keep 
our interceptor stacks thin.  It is probably worth the minor overhead of having 
more unused interceptors to allow more sharing of stacks.  Always more tech 
debt to work on!
-Jasper
  From: Christoph Nenning <christoph.nenn...@lex-com.net>
 To: Struts Users Mailing List <user@struts.apache.org> 
 Sent: Tuesday, October 13, 2015 8:13 AM
 Subject: Re: How to add a global interceptor
   
> From: Jasper Rosenberg <jasper_rosenb...@yahoo.com.INVALID>
> To: Struts Users Mailing List <user@struts.apache.org>, 
> Date: 13.10.2015 14:01
> Subject: Re: How to add a global interceptor
> 
> Thanks for the feedback!
> To be clear, we do have a number of interceptor stacks that are 
> shared and we follow a similar pattern to what you describe where we
> add additional interceptors where needed before or after a common 
> stack.  There are places that we might be able to reduce even that 
> pattern by switching to action mapping parameters, I will definitely
> revisit that.  
> The real problem is simply that there are so many actions at this 
> point that to make sure we didn't miss any outlier custom stacks, we
> would have to review each one.  We would then have to add a struts 
> configuration validation step to make sure no one introduced a new 
> stack missing the required one (which I suppose wouldn't be that big
> a deal since we already do other configuration checks in development
> mode in a DispatcherListener).  Definitely food for thought...
> Thanks,Jasper


Well, keeping so many stacks around surely is maintenance hell. And 
changing these stacks additonally in code does not make it better ;)



But as I said before: In your case I don't have a better idea.



Regards,
Christoph






>      From: Christoph Nenning <christoph.nenn...@lex-com.net>
>  To: Struts Users Mailing List <user@struts.apache.org> 
>  Sent: Tuesday, October 13, 2015 7:35 AM
>  Subject: Re: How to add a global interceptor
> 
> > From: Jasper Rosenberg <jasper_rosenb...@yahoo.com.INVALID>
> > To: "user@struts.apache.org" <user@struts.apache.org>, 
> > Date: 13.10.2015 13:26
> > Subject: How to add a global interceptor
> > 
> > Hi,
> > 
> > 
> >  
> > I work on a project with hundreds of struts actions manywith their 
> > own custom interceptor stacks specified.  
> > 
> 
> Having actions with own interceptor stacks is quite special. Usually 
> people have hundreds of actions but just a few interceptor stacks. And 
the 
> few stacks are not created by copy-paste but by overriding configuration 

> parameters and adding interceptors at the beginning or end of the stack.
> 
> 
> 
> 
> > 
> >  
> > We have recently internationalized the site, and so I had aneed to 
> > add an i18n interceptor to the top of every action stack.  It would 
> > have been impractical (and difficultto enforce for future actions) 
> > to add the new interceptor to every actiondefinition.
> > 
> > 
> >  
> > My solution was to override the ActionProxyFactory to returnour own 
> > ActionInvocation, which in turn always prepends the i18n interceptor
> > tothe interceptor stack during initialization. 
> > 
> 
> In your case that sounds alright.
> 
> 
> What are the reasons that you need so many different interceptor stacks?
> 
> 
> Regards,
> Christoph
> 
> This Email was scanned by Sophos Anti Virus
> 
> 
> 

This Email was scanned by Sophos Anti Virus