Re: LocaleProvder not unique

2017-03-13 Thread Lukasz Lenart
https://issues.apache.org/jira/browse/WW-4756

I know that this is for TextProvider but the same approach I can use
for LocaleProvider

2017-03-14 6:53 GMT+01:00 Lukasz Lenart :
> 2017-03-13 21:51 GMT+01:00 Christian Grobmeier :
>> OK, using component scan i had success with using DefaultLocaleProvider
>> as default in my applicationContext.xml:
>> > class="com.opensymphony.xwork2.DefaultLocaleProvider" primary="true" />
>>
>> (mind the primary)
>>
>> So far it makes halfway sense to me. A few tests fail still because they
>> access getText and do no receive a context. Digging into this
>
> Hmm... I think I see your point and this is somehow aligned with what
> I want to do with TextProvider layer. I mean, there is already a
> TextProviderFactory that is used to create custom TextProviders so I
> think I will used instead of TextProvider to inject as a dependency.
> This will allow to have TextProvider implemented by the ActionSupport
> and use TextProviderFactory as a dependency and there be type
> conflicts.
>
> Here is a first step to do so
> https://github.com/apache/struts/pull/121
>
> I will start another PR soon to replace TextProvider with
> TextProviderFactory, if you could test this approach it would be cool
> :)
>
>
> Regards
> --
> Łukasz
> + 48 606 323 122 http://www.lenart.org.pl/

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



Re: LocaleProvder not unique

2017-03-13 Thread Lukasz Lenart
2017-03-13 21:51 GMT+01:00 Christian Grobmeier :
> OK, using component scan i had success with using DefaultLocaleProvider
> as default in my applicationContext.xml:
>  class="com.opensymphony.xwork2.DefaultLocaleProvider" primary="true" />
>
> (mind the primary)
>
> So far it makes halfway sense to me. A few tests fail still because they
> access getText and do no receive a context. Digging into this

Hmm... I think I see your point and this is somehow aligned with what
I want to do with TextProvider layer. I mean, there is already a
TextProviderFactory that is used to create custom TextProviders so I
think I will used instead of TextProvider to inject as a dependency.
This will allow to have TextProvider implemented by the ActionSupport
and use TextProviderFactory as a dependency and there be type
conflicts.

Here is a first step to do so
https://github.com/apache/struts/pull/121

I will start another PR soon to replace TextProvider with
TextProviderFactory, if you could test this approach it would be cool
:)


Regards
-- 
Łukasz
+ 48 606 323 122 http://www.lenart.org.pl/

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



Re: Using tiles 2 with struts 1

2017-03-13 Thread Kokkodan Venu
This is very urgent

This is regarding a project upgrade where I need to stick with Struts 1 and I 
need Tiles 2 as the Spring framework is getting upgraded.

if you have already built the struts-tiles2-1.4.0-SNAPSHOT.jar can you pls send 
the same to me? I also have a very different upgrade here. I need to upgrade a 
project to Spring 4.1.x, Hibernate 4.3.x quartz2.2. the project use struts 1.in 
the upgrade specification, they are not mentioning anything about Struts 
upgrade. As we use tiles 1, its all a mess.

As we use the spring 4.1, now, we will need to upgrade the tiles1 to tiles2. I 
tried to checkout the SNAPSHOT project from apache svn 
(http://svn.apache.org/repos/asf/struts/struts1/trunk). But 1.4.0-SNAPSHOT is 
not available in mvn store anymore. So I'm looking for a ready built 
struts-tiles2-1.4.0-SNAPSHOT.jar. Can anyone help me?

Thank You
Venu
venugopala...@yahoo.com


This e-mail, including any attachments, may constitute a Federal record or 
other Government property that is intended only for the addressed individuals. 
This message may also contain information that is sensitive, confidential, or 
otherwise protected from disclosure under applicable law. If you are not a 
named addressee you must not disseminate, distribute or copy this e-mail. If 
you have received this e-mail in error, please notify the sender immediately 
and delete this e-mail from your system.


RE: Struts 1.x and Strtus2.x With Tiles 2.x

2017-03-13 Thread Kokkodan Venu
This is very urgent !

This is regarding a project upgrade where I need to stick with Struts 1 and I 
need Tiles 2 as the Spring framework is getting upgraded.

if you have already built the struts-tiles2-1.4.0-SNAPSHOT.jar can you pls send 
the same to me? I also have a very different upgrade here. I need to upgrade a 
project to Spring 4.1.x, Hibernate 4.3.x quartz2.2. the project use struts 1.in 
the upgrade specification, they are not mentioning anything about Struts 
upgrade. As we use tiles 1, its all a mess.

As we use the spring 4.1, now, we will need to upgrade the tiles1 to tiles2. I 
tried to checkout the SNAPSHOT project from apache svn 
(http://svn.apache.org/repos/asf/struts/struts1/trunk). But 1.4.0-SNAPSHOT is 
not available in mvn store anymore. So I'm looking for a ready built 
struts-tiles2-1.4.0-SNAPSHOT.jar. Can anyone help me?

Venu
venugopala...@yahoo.com


This e-mail, including any attachments, may constitute a Federal record or 
other Government property that is intended only for the addressed individuals. 
This message may also contain information that is sensitive, confidential, or 
otherwise protected from disclosure under applicable law. If you are not a 
named addressee you must not disseminate, distribute or copy this e-mail. If 
you have received this e-mail in error, please notify the sender immediately 
and delete this e-mail from your system.


Re: LocaleProvder not unique

2017-03-13 Thread Christian Grobmeier
OK, using component scan i had success with using DefaultLocaleProvider
as default in my applicationContext.xml:


(mind the primary)

So far it makes halfway sense to me. A few tests fail still because they
access getText and do no receive a context. Digging into this

On Mon, Mar 13, 2017, at 20:44, Christian Grobmeier wrote:
> 
> 
> On Mon, Mar 13, 2017, at 19:08, Lukasz Lenart wrote:
> > 2017-03-13 19:03 GMT+01:00 Christian Grobmeier :
> > > Wether @Service was right or not, I need to somehow tell Spring how to
> > > find my beans (i.e. @Component).
> > > I can understand Springs confusion, when it realizes every Action is a
> > > LocaleProvider.
> > >
> > > Is there any best practice?
> > 
> > Struts will delegate creation of any object to Spring, if Spring fails
> > it will fall back to Struts ObjectFactory to create the object. So as
> > far I know, Spring should be able create an object from a class with
> > default constructor implemented.
> 
> Sure, but if you use the Spring component scanner, we are back to the
> problem I was running into earlier. Because if I am not having an
> annotation, it's not picked up by Spring, but by Struts, which returns
> it to Spring. Standard testing is very difficult.
> 
> 
> > 
> > 
> > Regards
> > -- 
> > Łukasz
> > + 48 606 323 122 http://www.lenart.org.pl/
> > 
> > -
> > 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
> 

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



Re: LocaleProvder not unique

2017-03-13 Thread Christian Grobmeier


On Mon, Mar 13, 2017, at 19:08, Lukasz Lenart wrote:
> 2017-03-13 19:03 GMT+01:00 Christian Grobmeier :
> > Wether @Service was right or not, I need to somehow tell Spring how to
> > find my beans (i.e. @Component).
> > I can understand Springs confusion, when it realizes every Action is a
> > LocaleProvider.
> >
> > Is there any best practice?
> 
> Struts will delegate creation of any object to Spring, if Spring fails
> it will fall back to Struts ObjectFactory to create the object. So as
> far I know, Spring should be able create an object from a class with
> default constructor implemented.

Sure, but if you use the Spring component scanner, we are back to the
problem I was running into earlier. Because if I am not having an
annotation, it's not picked up by Spring, but by Struts, which returns
it to Spring. Standard testing is very difficult.


> 
> 
> Regards
> -- 
> Łukasz
> + 48 606 323 122 http://www.lenart.org.pl/
> 
> -
> 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



Re: LocaleProvder not unique

2017-03-13 Thread Lukasz Lenart
2017-03-13 19:03 GMT+01:00 Christian Grobmeier :
> Sorry, one more thing.
>
> With removing the @Service annotation I delegated the instantiation of
> the Actions to Struts as the Spring component scanner will not find my
> Bean no more. Struts - to my knowledge - will somehow create the bean
> using Spring too.
>
> The problem to use the applicationContext outside the web environment, i
> .e. test cases.
>
> Wether @Service was right or not, I need to somehow tell Spring how to
> find my beans (i.e. @Component).
> I can understand Springs confusion, when it realizes every Action is a
> LocaleProvider.
>
> Is there any best practice?

Struts will delegate creation of any object to Spring, if Spring fails
it will fall back to Struts ObjectFactory to create the object. So as
far I know, Spring should be able create an object from a class with
default constructor implemented.


Regards
-- 
Łukasz
+ 48 606 323 122 http://www.lenart.org.pl/

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



Re: LocaleProvder not unique

2017-03-13 Thread Christian Grobmeier
Sorry, one more thing.

With removing the @Service annotation I delegated the instantiation of
the Actions to Struts as the Spring component scanner will not find my
Bean no more. Struts - to my knowledge - will somehow create the bean
using Spring too.

The problem to use the applicationContext outside the web environment, i
.e. test cases.

Wether @Service was right or not, I need to somehow tell Spring how to
find my beans (i.e. @Component).
I can understand Springs confusion, when it realizes every Action is a 
LocaleProvider. 

Is there any best practice?

On Mon, Mar 13, 2017, at 18:29, Christian Grobmeier wrote:
> 
> 
> On Mon, Mar 13, 2017, at 18:26, Lukasz Lenart wrote:
> > 2017-03-13 17:55 GMT+01:00 Christian Grobmeier :
> > > Removing @Service helped. In addition I had to remove the remaining
> > > Actions from applicationContext.xml (I am in the middle of a
> > > transition).
> > >
> > > It's kind a weird, because it worked with the previous version of
> > > Struts. Was there a change in the injection behavior? I am glad I know
> > > about @Service yet, but still, I would love to know.
> > 
> > No, it isn't related to an injection mechanism, I mean there was no
> > change as far I know. Basically defining actions as services is a bad
> > idea - actions should be clients for services not to provide them. As
> > ActionSupport implements LocaleProvider by default it means it can be
> > injected in any bean that requires it (e.g. I18NInterceptor).
> > 
> > I am not sure why it worked before, LocaleProvider is there for a bit
> > and it's used in few places but since 2.5.5 is also used in the
> > interceptor https://issues.apache.org/jira/browse/WW-4677 - maybe
> > that's the case.
> 
> Got it, thank you a lot. 
> 
> Christian
> 
> > 
> > 
> > Regards
> > -- 
> > Łukasz
> > + 48 606 323 122 http://www.lenart.org.pl/
> > 
> > -
> > 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
> 

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



Re: LocaleProvder not unique

2017-03-13 Thread Christian Grobmeier


On Mon, Mar 13, 2017, at 18:26, Lukasz Lenart wrote:
> 2017-03-13 17:55 GMT+01:00 Christian Grobmeier :
> > Removing @Service helped. In addition I had to remove the remaining
> > Actions from applicationContext.xml (I am in the middle of a
> > transition).
> >
> > It's kind a weird, because it worked with the previous version of
> > Struts. Was there a change in the injection behavior? I am glad I know
> > about @Service yet, but still, I would love to know.
> 
> No, it isn't related to an injection mechanism, I mean there was no
> change as far I know. Basically defining actions as services is a bad
> idea - actions should be clients for services not to provide them. As
> ActionSupport implements LocaleProvider by default it means it can be
> injected in any bean that requires it (e.g. I18NInterceptor).
> 
> I am not sure why it worked before, LocaleProvider is there for a bit
> and it's used in few places but since 2.5.5 is also used in the
> interceptor https://issues.apache.org/jira/browse/WW-4677 - maybe
> that's the case.

Got it, thank you a lot. 

Christian

> 
> 
> Regards
> -- 
> Łukasz
> + 48 606 323 122 http://www.lenart.org.pl/
> 
> -
> 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



Re: LocaleProvder not unique

2017-03-13 Thread Lukasz Lenart
2017-03-13 17:55 GMT+01:00 Christian Grobmeier :
> Removing @Service helped. In addition I had to remove the remaining
> Actions from applicationContext.xml (I am in the middle of a
> transition).
>
> It's kind a weird, because it worked with the previous version of
> Struts. Was there a change in the injection behavior? I am glad I know
> about @Service yet, but still, I would love to know.

No, it isn't related to an injection mechanism, I mean there was no
change as far I know. Basically defining actions as services is a bad
idea - actions should be clients for services not to provide them. As
ActionSupport implements LocaleProvider by default it means it can be
injected in any bean that requires it (e.g. I18NInterceptor).

I am not sure why it worked before, LocaleProvider is there for a bit
and it's used in few places but since 2.5.5 is also used in the
interceptor https://issues.apache.org/jira/browse/WW-4677 - maybe
that's the case.


Regards
-- 
Łukasz
+ 48 606 323 122 http://www.lenart.org.pl/

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



Re: LocaleProvder not unique

2017-03-13 Thread Christian Grobmeier
Removing @Service helped. In addition I had to remove the remaining
Actions from applicationContext.xml (I am in the middle of a
transition).

It's kind a weird, because it worked with the previous version of
Struts. Was there a change in the injection behavior? I am glad I know
about @Service yet, but still, I would love to know.

Thanks Lukasz!

On Mon, Mar 13, 2017, at 16:44, Christian Grobmeier wrote:
> 
> 
> On Mon, Mar 13, 2017, at 16:31, Lukasz Lenart wrote:
> > 2017-03-13 16:25 GMT+01:00 Christian Grobmeier :
> > > @Service
> > > @Scope(value = ConfigurableBeanFactory.SCOPE_PROTOTYPE)
> > > public class EmptyAction extends AbstractAction {
> > 
> > Looks like you have turned each action in a bean. Can you drop
> > @Service annotation? It's not needed, you should use @Service only for
> > services that you want to inject into actions.
> 
> I can try that.
> 
> For the record, I just found out 2.5.5 is the first version of Struts
> where my code stopped working. It's still working with 2.5.2
> 
> > 
> > 
> > Regards
> > -- 
> > Łukasz
> > + 48 606 323 122 http://www.lenart.org.pl/
> > 
> > -
> > 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
> 

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



Re: LocaleProvder not unique

2017-03-13 Thread Christian Grobmeier


On Mon, Mar 13, 2017, at 16:31, Lukasz Lenart wrote:
> 2017-03-13 16:25 GMT+01:00 Christian Grobmeier :
> > @Service
> > @Scope(value = ConfigurableBeanFactory.SCOPE_PROTOTYPE)
> > public class EmptyAction extends AbstractAction {
> 
> Looks like you have turned each action in a bean. Can you drop
> @Service annotation? It's not needed, you should use @Service only for
> services that you want to inject into actions.

I can try that.

For the record, I just found out 2.5.5 is the first version of Struts
where my code stopped working. It's still working with 2.5.2

> 
> 
> Regards
> -- 
> Łukasz
> + 48 606 323 122 http://www.lenart.org.pl/
> 
> -
> 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



Re: LocaleProvder not unique

2017-03-13 Thread Lukasz Lenart
2017-03-13 16:25 GMT+01:00 Christian Grobmeier :
> Sure.
>
> I use annotations, i. e.:
>
> @Service
> @Scope(value = ConfigurableBeanFactory.SCOPE_PROTOTYPE)
> public class EmptyAction extends AbstractAction {

Looks like you have turned each action in a bean. Can you drop
@Service annotation? It's not needed, you should use @Service only for
services that you want to inject into actions.


Regards
-- 
Łukasz
+ 48 606 323 122 http://www.lenart.org.pl/

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



Re: Request exceeded allowed size limit! Max size allowed is: 2,097,152

2017-03-13 Thread Emi

I'm not sure, but I think the tomcat configuration is case sensitive.
Can you please try "maxPostSize" instead of "maxpostsize" in your connector
config?
Have updated to the following and succeeded this time (struts2: most 
recent version).


(1) server.xml
 Change to maxPostSize
(2) struts.xml
   
   
   
Thanks a lot for the help!



struts.xml






  
  
 9000
  

  
  application/pdf
  fileInputStream
  atta
chment;filename="${filename}"
  1024
   
   .

tomcat7 server.xml:






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



Re: LocaleProvder not unique

2017-03-13 Thread Christian Grobmeier
Sure.

I use annotations, i. e.:

@Service
@Scope(value = ConfigurableBeanFactory.SCOPE_PROTOTYPE)
public class EmptyAction extends AbstractAction {

(AbstractAction  extends ActionSupport)

In applicationContext:




I have used my own stack with:

-

The action config is still xml. like:


/jsp/mysite.jsp


It worked with 2.5.1, but no more with 2.5.10.1.
Spring version is 4.1.6.RELEASE

Thanks Lukasz!

Christian


On Mon, Mar 13, 2017, at 16:12, Lukasz Lenart wrote:
> 2017-03-13 16:02 GMT+01:00 Christian Grobmeier :
> > Hello all,
> >
> > I trying to upgrade my Struts app from 2.5.1 to 2.5.10.1.
> >
> > I saw there are some changes in I18nInterceptor like that:
> > https://github.com/apache/struts/commit/ea92e95461386f1ddfda37bb09ec170b8e306ae7#diff-f9eff9d34d35d47f349c7fa0531e51bdR130
> >
> > My actions extend from ActionSupport, which is implementing
> > LocaleProvider.
> > I am also using Spring for DI.
> >
> > Unfortunately I now get this exception when starting the container:
> >
> >  SpringObjectFactory- Error building bean
> > org.springframework.beans.factory.UnsatisfiedDependencyException: Error
> > creating bean with name
> > 'org.apache.struts2.interceptor.I18nInterceptor': Unsatisfied dependency
> > expressed through bean property 'localeProvider': : No qualifying bean
> > of type [com.opensymphony.xwork2.LocaleProvider] is defined: expected
> > single matching bean but found 95: emptyAction, ...
> >
> > It lists all my actions and it seems as Spring would try to instantiate
> > I18nInterceptor after my actions.
> >
> > Does anybody else experience that or got an idea how to improve my code?
> 
> This is strange, can you share how did you setup your actions in
> struts.xml?
> 
> 
> Regards
> -- 
> Łukasz
> + 48 606 323 122 http://www.lenart.org.pl/
> 
> -
> 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



Re: LocaleProvder not unique

2017-03-13 Thread Lukasz Lenart
2017-03-13 16:02 GMT+01:00 Christian Grobmeier :
> Hello all,
>
> I trying to upgrade my Struts app from 2.5.1 to 2.5.10.1.
>
> I saw there are some changes in I18nInterceptor like that:
> https://github.com/apache/struts/commit/ea92e95461386f1ddfda37bb09ec170b8e306ae7#diff-f9eff9d34d35d47f349c7fa0531e51bdR130
>
> My actions extend from ActionSupport, which is implementing
> LocaleProvider.
> I am also using Spring for DI.
>
> Unfortunately I now get this exception when starting the container:
>
>  SpringObjectFactory- Error building bean
> org.springframework.beans.factory.UnsatisfiedDependencyException: Error
> creating bean with name
> 'org.apache.struts2.interceptor.I18nInterceptor': Unsatisfied dependency
> expressed through bean property 'localeProvider': : No qualifying bean
> of type [com.opensymphony.xwork2.LocaleProvider] is defined: expected
> single matching bean but found 95: emptyAction, ...
>
> It lists all my actions and it seems as Spring would try to instantiate
> I18nInterceptor after my actions.
>
> Does anybody else experience that or got an idea how to improve my code?

This is strange, can you share how did you setup your actions in struts.xml?


Regards
-- 
Łukasz
+ 48 606 323 122 http://www.lenart.org.pl/

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



Re: Request exceeded allowed size limit! Max size allowed is: 2,097,152

2017-03-13 Thread Johannes Geppert
I'm not sure, but I think the tomcat configuration is case sensitive.
Can you please try "maxPostSize" instead of "maxpostsize" in your connector
config?

Best Regards

Johannes

#
web: http://www.jgeppert.com
twitter: http://twitter.com/jogep


2017-03-13 15:57 GMT+01:00 Emi :

> Hello,
>
> Tried to upload file, and always got the following errors:
>
> Request exceeded allowed size limit! Max size allowed is: 2,097,152 but
> request was: 2,463,633!
>
>
>
> May I know where I missed the steps please?
>
> struts.xml
> 
>
> strict-method-invocation="false">
>
>
>  class="ProcessActionUploadPdf">
>  
>  
> 9000
>  
>
>  
>  application/pdf
>  fileInputStream
>  atta
> chment;filename="${filename}"
>  1024
>   
>   .
>
> tomcat7 server.xml:
> redirectPort="8443"
>maxpostsize="9000">
>
> Thanks a lot!
>
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>


LocaleProvder not unique

2017-03-13 Thread Christian Grobmeier
Hello all,

I trying to upgrade my Struts app from 2.5.1 to 2.5.10.1.

I saw there are some changes in I18nInterceptor like that:
https://github.com/apache/struts/commit/ea92e95461386f1ddfda37bb09ec170b8e306ae7#diff-f9eff9d34d35d47f349c7fa0531e51bdR130

My actions extend from ActionSupport, which is implementing
LocaleProvider.
I am also using Spring for DI.

Unfortunately I now get this exception when starting the container:

 SpringObjectFactory- Error building bean
org.springframework.beans.factory.UnsatisfiedDependencyException: Error
creating bean with name
'org.apache.struts2.interceptor.I18nInterceptor': Unsatisfied dependency
expressed through bean property 'localeProvider': : No qualifying bean
of type [com.opensymphony.xwork2.LocaleProvider] is defined: expected
single matching bean but found 95: emptyAction, ...

It lists all my actions and it seems as Spring would try to instantiate
I18nInterceptor after my actions.

Does anybody else experience that or got an idea how to improve my code?

Thanks

Christian

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



Re: Request exceeded allowed size limit! Max size allowed is: 2,097,152

2017-03-13 Thread Adam Brin
what version of struts are you using?  There was a bug for a version that
limited the size, I believe.

On Mon, Mar 13, 2017 at 7:57 AM, Emi  wrote:

> Hello,
>
> Tried to upload file, and always got the following errors:
>
> Request exceeded allowed size limit! Max size allowed is: 2,097,152 but
> request was: 2,463,633!
>
>
>
> May I know where I missed the steps please?
>
> struts.xml
> 
>
> strict-method-invocation="false">
>
>
>  class="ProcessActionUploadPdf">
>  
>  
> 9000
>  
>
>  
>  application/pdf
>  fileInputStream
>  atta
> chment;filename="${filename}"
>  1024
>   
>   .
>
> tomcat7 server.xml:
> redirectPort="8443"
>maxpostsize="9000">
>
> Thanks a lot!
>
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>


-- 
_
Adam Brin
Director of Technology, Digital Antiquity
480.965.1278


Request exceeded allowed size limit! Max size allowed is: 2,097,152

2017-03-13 Thread Emi

Hello,

Tried to upload file, and always got the following errors:

Request exceeded allowed size limit! Max size allowed is: 2,097,152 but 
request was: 2,463,633!




May I know where I missed the steps please?

struts.xml

   
   extends="security-fix" strict-method-invocation="false">

   

class="ProcessActionUploadPdf">

 
 
9000
 

 
 application/pdf
 fileInputStream
 name="contentDisposition">attachment;filename="${filename}"

 1024
  
  .

tomcat7 server.xml:


Thanks a lot!


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



Re: OGNL expressions in headers and parameters

2017-03-13 Thread Paweł Wielgus
Hi Thomás,
aren't you testing old voulnerable version?

If so, try the new one.


--
Pozdrawiam,
Paweł Wielgus.
tel: +48 604 603 546


2017-03-13 10:54 GMT+01:00 Tamás Barta :
> Lukasz, I don't write it to blame you. I very appreciate your work.
>
> I just write to this list because it seems to me that these OGNL
> expressions are evaluated before my code is executed and I wonder if it can
> be disabled anyhow.
> Can I turn off these auto-evaluated thinks if I don't need them at all? You
> wrote that it is my code which initiates this, but I don't think so.
>
> On Mon, Mar 13, 2017 at 10:48 AM, Lukasz Lenart 
> wrote:
>
>> 2017-03-13 10:43 GMT+01:00 Tamás Barta :
>> > Interesting, I don't do such things. I write down the stack trace from
>> > where it is executed (in 2.5.2).
>> > This is the interesting part, there is no my code there.
>> >
>> > StrutsPrepareAndExecuteFilter:100   // boolean
>> handled
>> > = execute.executeStaticResourceRequest(request, response);
>> > ->
>> > ExecuteOperations:59
>> >  // StaticContentLoader staticResourceLoader =
>> > dispatcher.getContainer().getInstance(StaticContentLoader.class);
>> > ->
>> > Dispatcher:897   //
>> > Configuration config = mgr.getConfiguration();
>> > ->
>> > ConfigurationManager:73
>> > // conditionalReload();
>> > ->
>> > OgnlValueStackFactory:64
>> > // container.inject(stack);
>> > ...
>> >
>> > I tried this test script and put breakpoint in
>> > OgnlUtil.getExcludedClasses():
>> > https://packetstormsecurity.com/files/141494/S2-45-poc.py.txt
>>
>> but this is a vulnerability, a bug which was already fixed. We also
>> are developers that make mistakes.
>>
>>
>> Regards
>> --
>> Łukasz
>> + 48 606 323 122 http://www.lenart.org.pl/
>>
>> -
>> 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



Re: OGNL expressions in headers and parameters

2017-03-13 Thread Lukasz Lenart
2017-03-13 10:54 GMT+01:00 Tamás Barta :
> Lukasz, I don't write it to blame you. I very appreciate your work.
>
> I just write to this list because it seems to me that these OGNL
> expressions are evaluated before my code is executed and I wonder if it can
> be disabled anyhow.
> Can I turn off these auto-evaluated thinks if I don't need them at all? You
> wrote that it is my code which initiates this, but I don't think so.

Not sure what do you mean by the "auto-evaluated" - each expression to
be evaluated must be passed to an interpreter first (e.g. OGNL) so
there is no such thing like auto-evaluation of everything.

OGNL is used to convert incoming params and apply them onto your
actions (request param as a String -> OGNL -> an Object of given
type). You can pass an expression via such param e.g. %{'a' +
'b'} and it won't be evaluated, it will be applied literally as a
String.

The problem is when someone takes value of such param and passes it to
evaluator e.g. getText("%{'a' + 'b'}", "%{'a' + 'b'}")
- then the evaluation happens - but this a developer mistake not
"auto-evaluation".


Regards
-- 
Łukasz
+ 48 606 323 122 http://www.lenart.org.pl/

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



Re: OGNL expressions in headers and parameters

2017-03-13 Thread Tamás Barta
Lukasz, I don't write it to blame you. I very appreciate your work.

I just write to this list because it seems to me that these OGNL
expressions are evaluated before my code is executed and I wonder if it can
be disabled anyhow.
Can I turn off these auto-evaluated thinks if I don't need them at all? You
wrote that it is my code which initiates this, but I don't think so.

On Mon, Mar 13, 2017 at 10:48 AM, Lukasz Lenart 
wrote:

> 2017-03-13 10:43 GMT+01:00 Tamás Barta :
> > Interesting, I don't do such things. I write down the stack trace from
> > where it is executed (in 2.5.2).
> > This is the interesting part, there is no my code there.
> >
> > StrutsPrepareAndExecuteFilter:100   // boolean
> handled
> > = execute.executeStaticResourceRequest(request, response);
> > ->
> > ExecuteOperations:59
> >  // StaticContentLoader staticResourceLoader =
> > dispatcher.getContainer().getInstance(StaticContentLoader.class);
> > ->
> > Dispatcher:897   //
> > Configuration config = mgr.getConfiguration();
> > ->
> > ConfigurationManager:73
> > // conditionalReload();
> > ->
> > OgnlValueStackFactory:64
> > // container.inject(stack);
> > ...
> >
> > I tried this test script and put breakpoint in
> > OgnlUtil.getExcludedClasses():
> > https://packetstormsecurity.com/files/141494/S2-45-poc.py.txt
>
> but this is a vulnerability, a bug which was already fixed. We also
> are developers that make mistakes.
>
>
> Regards
> --
> Łukasz
> + 48 606 323 122 http://www.lenart.org.pl/
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>


Re: OGNL expressions in headers and parameters

2017-03-13 Thread Lukasz Lenart
2017-03-13 10:43 GMT+01:00 Tamás Barta :
> Interesting, I don't do such things. I write down the stack trace from
> where it is executed (in 2.5.2).
> This is the interesting part, there is no my code there.
>
> StrutsPrepareAndExecuteFilter:100   // boolean handled
> = execute.executeStaticResourceRequest(request, response);
> ->
> ExecuteOperations:59
>  // StaticContentLoader staticResourceLoader =
> dispatcher.getContainer().getInstance(StaticContentLoader.class);
> ->
> Dispatcher:897   //
> Configuration config = mgr.getConfiguration();
> ->
> ConfigurationManager:73
> // conditionalReload();
> ->
> OgnlValueStackFactory:64
> // container.inject(stack);
> ...
>
> I tried this test script and put breakpoint in
> OgnlUtil.getExcludedClasses():
> https://packetstormsecurity.com/files/141494/S2-45-poc.py.txt

but this is a vulnerability, a bug which was already fixed. We also
are developers that make mistakes.


Regards
-- 
Łukasz
+ 48 606 323 122 http://www.lenart.org.pl/

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



Re: OGNL expressions in headers and parameters

2017-03-13 Thread Tamás Barta
Interesting, I don't do such things. I write down the stack trace from
where it is executed (in 2.5.2).
This is the interesting part, there is no my code there.

StrutsPrepareAndExecuteFilter:100   // boolean handled
= execute.executeStaticResourceRequest(request, response);
->
ExecuteOperations:59
 // StaticContentLoader staticResourceLoader =
dispatcher.getContainer().getInstance(StaticContentLoader.class);
->
Dispatcher:897   //
Configuration config = mgr.getConfiguration();
->
ConfigurationManager:73
// conditionalReload();
->
OgnlValueStackFactory:64
// container.inject(stack);
...

I tried this test script and put breakpoint in
OgnlUtil.getExcludedClasses():
https://packetstormsecurity.com/files/141494/S2-45-poc.py.txt

On Mon, Mar 13, 2017 at 10:11 AM, Lukasz Lenart 
wrote:

> 2017-03-13 9:50 GMT+01:00 Tamás Barta :
> > I mean I never want a http header or parameter be handled as OGNL
> > expression and got evaluated. I would like it to be retrieved as it is.
> For
> > security purpose.
>
> As I said, Struts doesn't evaluate incoming params as OGNL
> expressions, but when you use such param in a JSP, it will be
> evaluated.
>
> 
>
> The same can happen in ActionSupport#getText() but this is out of
> Struts control.
>
>
> Regards
> --
> Łukasz
> + 48 606 323 122 http://www.lenart.org.pl/
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>


Re: OGNL expressions in headers and parameters

2017-03-13 Thread Lukasz Lenart
2017-03-13 9:50 GMT+01:00 Tamás Barta :
> I mean I never want a http header or parameter be handled as OGNL
> expression and got evaluated. I would like it to be retrieved as it is. For
> security purpose.

As I said, Struts doesn't evaluate incoming params as OGNL
expressions, but when you use such param in a JSP, it will be
evaluated.



The same can happen in ActionSupport#getText() but this is out of
Struts control.


Regards
-- 
Łukasz
+ 48 606 323 122 http://www.lenart.org.pl/

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



Re: New releases

2017-03-13 Thread Tamás Barta
Thanks

On Mon, Mar 13, 2017 at 9:42 AM, Lukasz Lenart 
wrote:

> 2017-03-13 9:40 GMT+01:00 Tamás Barta :
> > Hi,
> >
> > Is there any easy way to receive notification about new releases only.
> > Especially I'm interested in security fixes. I can't see such mailing
> list.
>
> You can subscribe to announcement list [1], then you will get only
> announcements [2] about new releases
>
> [1] http://struts.apache.org/mail.html
> [2] http://markmail.org/search/?q=struts#query:struts%20list%
> 3Aorg.apache.struts.announcements%20order%3Adate-
> backward+page:1+state:facets
>
>
> Regards
> --
> Łukasz
> + 48 606 323 122 http://www.lenart.org.pl/
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>


Re: issue with getting current date using date tag in latest struts 2.3.3X

2017-03-13 Thread Christoph Nenning
The security mechanism mentioned by Lukasz was added in mid 2014. Before 
that it was possible to use new in OGNL expressions.

Regards,
Christoph



Vishal Jhagadiawala  schrieb am 11.03.2017 
00:16:03:

> From: Vishal Jhagadiawala 
> To: Struts Users Mailing List , 
> Date: 11.03.2017 00:21
> Subject: Re: issue with getting current date using date tag in 
> latest struts 2.3.3X
> 
> Hi Dave,
> it was working find from earlier version, here is the discussion 
> thread from coderanch. 
> formatDate & i18nInteceptor (Struts forum at Coderanch)
> 
> 
> | 
> | 
> | 
> |   ||
> 
>|
> 
>   |
> | 
> |   | 
>  formatDate & i18nInt...
>  In my tiles to display the date on the header of each page I am 
> using 
> >
> > it shows no value in the UI page.
> > Question: was there usage of OGNL expression changed in latest version 
of
> > struts2. eg. 2.3.30,  the above usage works without issue in Struts2 
2.2.1
> > any help would be appreciated.
> >
> > Regards,
> > Vishal
> 
> 
> 
> 
> -- 
> e: davelnew...@gmail.com
> m: 908-380-8699
> s: davelnewton_skype
> t: @dave_newton 
> b: Bucky Bits 
> g: davelnewton 
> so: Dave Newton 
> 
> 
> 

This Email was scanned by Sophos Anti Virus


Re: OGNL expressions in headers and parameters

2017-03-13 Thread Tamás Barta
I mean I never want a http header or parameter be handled as OGNL
expression and got evaluated. I would like it to be retrieved as it is. For
security purpose.

On Mon, Mar 13, 2017 at 9:44 AM, Lukasz Lenart 
wrote:

> 2017-03-13 9:41 GMT+01:00 Tamás Barta :
> > Hi,
> >
> > Is there any way to disable evaluating OGNL expressions in HTTP headers
> and
> > request parameters?
>
> There is no direct evaluation of request parameters nor headers. The
> problem is that those values are often used by developers in JSPs or
> in some other places and then the evaluation happens.
>
>
> Regards
> --
> Łukasz
> + 48 606 323 122 http://www.lenart.org.pl/
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>


Re: Struts 2.3.28 and Tiles issue

2017-03-13 Thread Christoph Nenning
Thanks for reporting back. I've added a notice about it to migration 
guide.


This is the original wiki page, struts web page is generated from it:
https://cwiki.apache.org/confluence/display/WW/Struts+2.3+to+2.5+migration

Regards,
Christoph



> From: Paweł Wielgus 
> To: Struts Users Mailing List , 
> Date: 11.03.2017 22:16
> Subject: Re: Struts 2.3.28 and Tiles issue
> 
> Hi all,
> i've upgraded Struts to latest versions (2.3 and 2.5)
> and i was forced to solve this issue.
> 
> Well, the hardest bug to find is non-existent one :-|
> 
> All i needed to do, was to remove work directory from tomcat.
> 
> All is working like expected.
> 
> Someone gave this solution on stackoverflow:
> 
> http://stackoverflow.com/a/40407427/6801998
> 
> 
> --
> Pozdrawiam,
> Paweł Wielgus.
> tel: +48 604 603 546
> 
> 
> 2016-04-22 9:33 GMT+02:00 Christoph Nenning 
:
> >> From: Paweł Wielgus 
> >> To: Struts Users Mailing List ,
> >> Date: 21.04.2016 00:16
> >> Subject: Struts 2.3.28 and Tiles issue
> >>
> >> Hi all,
> >> i've upgraded struts-core and all the dependencies to 2.3.28,
> >> along with that came new tiles libraries.
> >>
> >> And a problem:
> >>
> >> SEVERE: Servlet.service() for servlet jsp threw exception
> >> java.lang.ClassCastException:
> >> org.apache.tiles.jsp.taglib.InsertDefinitionTag cannot be cast to
> >> javax.servlet.jsp.tagext.Tag
> >
> >
> > Sounds like you have a jsp-api.jar packaged in your app. Can you 
please
> > check that?
> >
> >
> > Regards,
> > Christoph
> >
> >
> >
> >
> >
> >> at 
org.apache.jasper.runtime.TagHandlerPool.get(TagHandlerPool.java:126)
> >> at
> >>
> > 
> 
org.apache.jsp.WEB_002dINF.pages.admin.run_002dscript_jsp._jspx_meth_tiles_005finsertDefinition_005f0
> >> (run_002dscript_jsp.java:102)
> >> at
> >> org.apache.jsp.WEB_002dINF.pages.admin.run_002dscript_jsp._jspService
> >> (run_002dscript_jsp.java:81)
> >> at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
> >> at javax.servlet.http.HttpServlet.service(HttpServlet.java:723)
> >> at org.apache.jasper.servlet.JspServletWrapper.service
> >> (JspServletWrapper.java:388)
> >> at
> > 
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
> >> at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
> >> at javax.servlet.http.HttpServlet.service(HttpServlet.java:723)
> >> at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
> >> (ApplicationFilterChain.java:290)
> >> at org.apache.catalina.core.ApplicationFilterChain.doFilter
> >> (ApplicationFilterChain.java:206)
> >> at org.apache.catalina.core.ApplicationDispatcher.invoke
> >> (ApplicationDispatcher.java:646)
> >> at org.apache.catalina.core.ApplicationDispatcher.processRequest
> >> (ApplicationDispatcher.java:436)
> >> at org.apache.catalina.core.ApplicationDispatcher.doForward
> >> (ApplicationDispatcher.java:374)
> >> at org.apache.catalina.core.ApplicationDispatcher.forward
> >> (ApplicationDispatcher.java:302)
> >> at org.apache.struts2.dispatcher.ServletDispatcherResult.doExecute
> >> (ServletDispatcherResult.java:164)
> >> at org.apache.struts2.dispatcher.StrutsResultSupport.execute
> >> (StrutsResultSupport.java:191)
> >> at com.opensymphony.xwork2.DefaultActionInvocation.executeResult
> >> (DefaultActionInvocation.java:372)
> >> at com.opensymphony.xwork2.DefaultActionInvocation.invoke
> >> (DefaultActionInvocation.java:276)
> >> at
> >>
> > 
com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept
> >> (DefaultWorkflowInterceptor.java:168)
> >> at
> >> com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept
> >> (MethodFilterInterceptor.java:98)
> >> at com.opensymphony.xwork2.DefaultActionInvocation.invoke
> >> (DefaultActionInvocation.java:245)
> >> at
> >> com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept
> >> (ValidationInterceptor.java:265)
> >> at
> >>
> > 
> 
org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept
> >> (AnnotationValidationInterceptor.java:76)
> >> at
> >> com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept
> >> (MethodFilterInterceptor.java:98)
> >> at com.opensymphony.xwork2.DefaultActionInvocation.invoke
> >> (DefaultActionInvocation.java:245)
> >> at
> >> 
com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept
> >> (ConversionErrorInterceptor.java:138)
> >> at com.opensymphony.xwork2.DefaultActionInvocation.invoke
> >> (DefaultActionInvocation.java:245)
> >> at
> >> com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept
> >> (ParametersInterceptor.java:229)
> >> at
> >> com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept
> >> (MethodFilterInterceptor.java:98)
> >> at com.opensymphony.xwork2.DefaultActionInvocation.invoke
> >> (DefaultActionInvocation.java:245)
> >> at
> >> 

Re: OGNL expressions in headers and parameters

2017-03-13 Thread Lukasz Lenart
2017-03-13 9:41 GMT+01:00 Tamás Barta :
> Hi,
>
> Is there any way to disable evaluating OGNL expressions in HTTP headers and
> request parameters?

There is no direct evaluation of request parameters nor headers. The
problem is that those values are often used by developers in JSPs or
in some other places and then the evaluation happens.


Regards
-- 
Łukasz
+ 48 606 323 122 http://www.lenart.org.pl/

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



Re: New releases

2017-03-13 Thread Lukasz Lenart
2017-03-13 9:40 GMT+01:00 Tamás Barta :
> Hi,
>
> Is there any easy way to receive notification about new releases only.
> Especially I'm interested in security fixes. I can't see such mailing list.

You can subscribe to announcement list [1], then you will get only
announcements [2] about new releases

[1] http://struts.apache.org/mail.html
[2] 
http://markmail.org/search/?q=struts#query:struts%20list%3Aorg.apache.struts.announcements%20order%3Adate-backward+page:1+state:facets


Regards
-- 
Łukasz
+ 48 606 323 122 http://www.lenart.org.pl/

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



OGNL expressions in headers and parameters

2017-03-13 Thread Tamás Barta
Hi,

Is there any way to disable evaluating OGNL expressions in HTTP headers and
request parameters?

Thanks,
Tamás


New releases

2017-03-13 Thread Tamás Barta
Hi,

Is there any easy way to receive notification about new releases only.
Especially I'm interested in security fixes. I can't see such mailing list.

Thanks,
Tamás