Re: Global Validation

2013-07-11 Thread Alireza Fattahi
Hi,

Well I mean is there a way which I can tell the validation frame work that all 
"required string"  validations should display this message 
 The ${TheFiledWhichFailed} must be a string 
And then I define:
 
    Username 
 
 
    Address 
 

So when the validation fails it generates: 
The username must be string.
The address must be string.
.


Or should I do it:
 
    Username 
    Username must be string. 
 

 
    Address 
    Address must be string. 
 

 

~Regards,
~~Alireza Fattahi



 From: Lukasz Lenart 
To: Struts Users Mailing List  
Sent: Wednesday, 10 July 2013, 16:47
Subject: Re: Global Validation
 

2013/7/10 Alireza Fattahi :
> Hi,
>
> Are there Global Validation  in struts 2 ?!

What you mean by that? Validations which affects each and every
action? If so, no.


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: Define the a property

2013-07-11 Thread Alireza Fattahi
Hi,

Sorry for sending the email directly, it was a mistake !

Any way, I expect that when this happens a warning message displayed to the 
developers not a full stack trace. 
You know, usually when you see this stack, it shows that something terribly bad 
happened !!


Do you know which interceptor creates this ?

 
~Regards,
~~Alireza Fattahi



 From: Lukasz Lenart 
To: Alireza Fattahi  
Sent: Wednesday, 10 July 2013, 16:43
Subject: Re: Define the a property
 

Could you ask such questions on the User Mailing List?

And this was introduced to warn developer about missing properties or
typo in properties. This warning is only emitted in devMode.


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

2013/7/10 Alireza Fattahi :
> Well, who make this?!
> I think it was preaperparam interceptor, can we update log4j in the way that
> ikt does not show these warning .
>
>
> ~Regards,
> ~~Alireza Fattahi
> 
> From: Lukasz Lenart 
> To: Alireza Fattahi 
> Sent: Wednesday, 10 July 2013, 13:51
> Subject: Re: Define the a property
>
> No, but you will get warning in devMode
>
> 2013/7/10 Alireza Fattahi :
>> Hi,
>>
>> Should we always define the a property in the action for all the textfiled
>> that we have in the form
>>
>> See below:
>>    
>>
>>
>> Error setting expression 'echo' with value ['Hello World!!!', ] - [unknown
>> location]
>>    at
>>
>> com.opensymphony.xwork2.ognl.OgnlValueStack.handleRuntimeException(OgnlValueStack.java:201)
>>    at
>>
>> com.opensymphony.xwork2.ognl.OgnlValueStack.setValue(OgnlValueStack.java:178)
>>    at
>>
>> com.opensymphony.xwork2.ognl.OgnlValueStack.setParameter(OgnlValueStack.java:152)
>>    at
>>
>> com.opensymphony.xwork2.interceptor.ParametersInterceptor.setParameters(ParametersInterceptor.java:329)
>>    at
>>
>> com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:241)
>>    at
>>
>> com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
>>    at
>>
>> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
>>    at
>>
>> com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:249)
>>    at
>>
>> com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
>>    at
>>
>> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
>>
>> ~Regards,
>> ~~Alireza Fattahi
>>
>>
>
>

Re: Define the a property

2013-07-11 Thread Lukasz Lenart
2013/7/11 Alireza Fattahi :
> Any way, I expect that when this happens a warning message displayed to the 
> developers not a full stack trace.
> You know, usually when you see this stack, it shows that something terribly 
> bad happened !!

Stacktraces are useful only for developers, could post the whole stacktrace?

> Do you know which interceptor creates this ?

ParametersInterceptor


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: Global Validation

2013-07-11 Thread Lukasz Lenart
Nope, but you can use expressions:

http://struts.apache.org/development/2.x/docs/validation.html#Validation-LocalizingandParameterizingMessages


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

2013/7/11 Alireza Fattahi :
> Hi,
>
> Well I mean is there a way which I can tell the validation frame work that 
> all "required string"  validations should display this message
>  The ${TheFiledWhichFailed} must be a string 
> And then I define:
> 
> Username
> 
> 
> Address
> 
>
> So when the validation fails it generates:
> The username must be string.
> The address must be string.
> .
>
>
> Or should I do it:
> 
> Username
> Username must be string.
> 
>
> 
> Address
> Address must be string.
> 
>
>
>
> ~Regards,
> ~~Alireza Fattahi
>
>
> 
>  From: Lukasz Lenart 
> To: Struts Users Mailing List 
> Sent: Wednesday, 10 July 2013, 16:47
> Subject: Re: Global Validation
>
>
> 2013/7/10 Alireza Fattahi :
>> Hi,
>>
>> Are there Global Validation  in struts 2 ?!
>
> What you mean by that? Validations which affects each and every
> action? If so, no.
>
>
> 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: Using Two Parent Pakages!!

2013-07-11 Thread Alireza Fattahi
Hi,

The json plug in has a package json-default and the "json" result type is 
defined in this package.


To use this result type you should do some thing like:

1- Make a new package and extend it 
 

2- Copy and past the   in my package


3- Make this package the parent package.

 
My question is:
If the struts finds the result-type "json",in struts2-json-plugin.jar , why 
doesn't it make this result-type available to all actions ? Why should I 
address struts where this result type is defined ?



~Regards,
~~Alireza Fattahi



 From: Alireza Fattahi 
To: Struts Users Mailing List  
Sent: Wednesday, 10 July 2013, 10:50
Subject: Re: Using Two Parent Pakages!!
 


Hi,

So I define some thing like

 

   

 
Is it possible that I say the struts that this the default package for all 
packages ?!


~Regards,
~~Alireza Fattahi



 From: Lukasz Lenart 
To: Struts Users Mailing List ; Alireza Fattahi 
 
Sent: Wednesday, 10 July 2013, 10:27
Subject: Re: Using Two Parent Pakages!!
 

2013/7/10
 Alireza Fattahi :
> Thanks !
>
> I found a code 
> here:http://struts.apache.org/release/2.0.x/docs/zero-configuration.html
>
>
> @ParentPackage({"my-parent-package1, my-parent-package2"}) package 
> com.mycompany.myapp.actions import org.apache.struts2.config.ParentPackage;
>
>
> Can I do it ?!

Right, you can extend from more than one package



http://struts.apache.org/release/2.0.x/docs/package-configuration.html


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 Two Parent Pakages!!

2013-07-11 Thread Lukasz Lenart
2013/7/11 Alireza Fattahi :
> If the struts finds the result-type "json",in struts2-json-plugin.jar , why 
> doesn't it make this result-type available to all actions ? Why should I 
> address struts where this result type is defined ?

Results are defined per package, actions are defined per package.


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: Possible client side validation bug in Struts 2.3.15

2013-07-11 Thread Bruno Klava
Issue created: https://issues.apache.org/jira/browse/WW-4139


On Wed, Jul 10, 2013 at 6:18 AM, Lukasz Lenart wrote:

> 2013/7/10 Lukasz Lenart :
> > 2013/7/5 Bruno Klava :
> >> As far as I can tell, this difference is due to changes made
> >> in org.apache.struts2.components.Form.getValidators(String name)
> >
> > I would say that now is ok and previously it was a bug ;-) But you are
> > right, that breaks backward compatibility
>
> Could you register an issue with link to the example?
>
>
> Thanks in advance
> --
> Ł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
>
>


-- 
Bruno Klava


Re: Possible client side validation bug in Struts 2.3.15

2013-07-11 Thread Lukasz Lenart
Solved, please check with the latest build ... hm ... ale the build are gone :\

https://builds.apache.org/view/S-Z/view/Struts/


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

2013/7/11 Bruno Klava :
> Issue created: https://issues.apache.org/jira/browse/WW-4139
>
>
> On Wed, Jul 10, 2013 at 6:18 AM, Lukasz Lenart wrote:
>
>> 2013/7/10 Lukasz Lenart :
>> > 2013/7/5 Bruno Klava :
>> >> As far as I can tell, this difference is due to changes made
>> >> in org.apache.struts2.components.Form.getValidators(String name)
>> >
>> > I would say that now is ok and previously it was a bug ;-) But you are
>> > right, that breaks backward compatibility
>>
>> Could you register an issue with link to the example?
>>
>>
>> Thanks in advance
>> --
>> Ł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
>>
>>
>
>
> --
> Bruno Klava

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