You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Nguyen Xuan Son <ya...@gmail.com> on 2009/11/29 17:13:28 UTC

validation xml file

Dear all
I have these in the LoginAction-validation.xml file
<validators>
<field name="txtName">
<field-validator type="requiredstring">
<param name="trim">false</param>
<message>error</message>
</field-validator>
</field>
 <field name="txtPass">
<field-validator type="requiredstring">
<param name="trim">false</param>
<message>error</message>
</field-validator>
</field>
</validators>

but it seems that even there is a error it still continue to implement the
LoginAction.java file
what should i do if i want it stop implementing the LoginAction.java
whenever there is any error appear
thank you very much

-- 
=======================================================================
Ritsumeikan University, Asia JinZai Project
Master of Information Science
Nguyen Xuan Son

Add       : Japan, Shiga-Ken, Kusatsu-Shi, Kasayama 3choume 1-18 ShiteiHaimu
Rien, Room 103
Tel/Fax  : 81-(0)90-3976 2246
Email    : nr0003xx@ed.ritsumei.ac.jp
Mobile   : 81-(0)90-3976 2246          URL  : http://www.ritsumei.jp
=======================================================================

Re: validation xml file

Posted by Nguyen Xuan Son <ya...@gmail.com>.
Dear denis
i've attached the struts.xml file with this email
the problem is when i dont input any information
the system doesnt stop immediatly at LoginAction-validation.xml file but
also implement LoginAction.java file
thus the system check everything even it is not necessary
it might make the system slower

thank you very much

2009/11/30 Denis Cabasson <de...@gmail.com>

> Everything seems to be looking good.
>
> Is your validation xml file in the same package as your action? Are you
> using the defaultStack interceptor stack?
>
> If you leave txtName or txtPass empty, are you still proceeding to
> C0002_Home.jsp?
>
> Something must not be in place, because your example seems simple enough
> and definitely should be working. I tried at my place, and everything's
> working fine, so you must have some misconfiguration somewhere.
>
> Can you share more of your code? What is your complete struts.xml?
>
> Good luck!
>
> Denis.
>
> Nguyen Xuan Son a écrit :
>
>> I think i have it. here is the detail
>>
>> <action name="login" class="com.baibai.action.LoginAction">
>> <result name="success">C0002_Home.jsp</result>
>> <result name="input">login.jsp</result>
>> </action>
>>
>> Here is the HTML tag for the submit button
>> <input type="image" alt="Login" border="0" src="images/login_btn_arr.gif"
>> width="26" height="26" style="cursor:hand">
>>
>> Please tell me what should i correct?
>> thank you very much
>>
>> 2009/11/30 Denis Cabasson <denis.cabasson@gmail.com <mailto:
>> denis.cabasson@gmail.com>>
>>
>>
>>    Do you have a result named "input" tied to your LoginAction? What
>>    is it?
>>
>>    Denis.
>>
>>    Nguyen Xuan Son a écrit :
>>
>>        Dear all
>>        I have these in the LoginAction-validation.xml file
>>        <validators>
>>        <field name="txtName">
>>        <field-validator type="requiredstring">
>>        <param name="trim">false</param>
>>        <message>error</message>
>>        </field-validator>
>>        </field>
>>         <field name="txtPass">
>>        <field-validator type="requiredstring">
>>        <param name="trim">false</param>
>>        <message>error</message>
>>        </field-validator>
>>        </field>
>>        </validators>
>>
>>        but it seems that even there is a error it still continue to
>>        implement the
>>        LoginAction.java file
>>        what should i do if i want it stop implementing the
>>        LoginAction.java
>>        whenever there is any error appear
>>        thank you very much
>>
>>
>>
>>
>>    ---------------------------------------------------------------------
>>    To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>    <ma...@struts.apache.org>
>>
>>    For additional commands, e-mail: user-help@struts.apache.org
>>    <ma...@struts.apache.org>
>>
>>
>>
>>
>>
>> --
>> =======================================================================
>> Ritsumeikan University, Asia JinZai Project
>> Master of Information Science
>> Nguyen Xuan Son
>>
>> Add       : Japan, Shiga-Ken, Kusatsu-Shi, Kasayama 3choume 1-18
>> ShiteiHaimu Rien, Room 103
>> Tel/Fax  : 81-(0)90-3976 2246
>> Email    : nr0003xx@ed.ritsumei.ac.jp <ma...@ed.ritsumei.ac.jp>
>>
>> Mobile   : 81-(0)90-3976 2246          URL  : http://www.ritsumei.jp
>> =======================================================================
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>


-- 
=======================================================================
Ritsumeikan University, Asia JinZai Project
Master of Information Science
Nguyen Xuan Son

Add       : Japan, Shiga-Ken, Kusatsu-Shi, Kasayama 3choume 1-18 ShiteiHaimu
Rien, Room 103
Tel/Fax  : 81-(0)90-3976 2246
Email    : nr0003xx@ed.ritsumei.ac.jp
Mobile   : 81-(0)90-3976 2246          URL  : http://www.ritsumei.jp
=======================================================================

Re: validation xml file

Posted by Denis Cabasson <de...@gmail.com>.
Everything seems to be looking good.

Is your validation xml file in the same package as your action? Are you 
using the defaultStack interceptor stack?

If you leave txtName or txtPass empty, are you still proceeding to 
C0002_Home.jsp?

Something must not be in place, because your example seems simple enough 
and definitely should be working. I tried at my place, and everything's 
working fine, so you must have some misconfiguration somewhere.

Can you share more of your code? What is your complete struts.xml?

Good luck!
Denis.

Nguyen Xuan Son a écrit :
> I think i have it. here is the detail
> <action name="login" class="com.baibai.action.LoginAction">
> <result name="success">C0002_Home.jsp</result>
> <result name="input">login.jsp</result>
> </action>
>
> Here is the HTML tag for the submit button
> <input type="image" alt="Login" border="0" 
> src="images/login_btn_arr.gif" width="26" height="26" style="cursor:hand">
>
> Please tell me what should i correct?
> thank you very much
>
> 2009/11/30 Denis Cabasson <denis.cabasson@gmail.com 
> <ma...@gmail.com>>
>
>     Do you have a result named "input" tied to your LoginAction? What
>     is it?
>
>     Denis.
>
>     Nguyen Xuan Son a écrit :
>
>         Dear all
>         I have these in the LoginAction-validation.xml file
>         <validators>
>         <field name="txtName">
>         <field-validator type="requiredstring">
>         <param name="trim">false</param>
>         <message>error</message>
>         </field-validator>
>         </field>
>          <field name="txtPass">
>         <field-validator type="requiredstring">
>         <param name="trim">false</param>
>         <message>error</message>
>         </field-validator>
>         </field>
>         </validators>
>
>         but it seems that even there is a error it still continue to
>         implement the
>         LoginAction.java file
>         what should i do if i want it stop implementing the
>         LoginAction.java
>         whenever there is any error appear
>         thank you very much
>
>          
>
>
>
>     ---------------------------------------------------------------------
>     To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>     <ma...@struts.apache.org>
>     For additional commands, e-mail: user-help@struts.apache.org
>     <ma...@struts.apache.org>
>
>
>
>
> -- 
> =======================================================================
> Ritsumeikan University, Asia JinZai Project
> Master of Information Science
> Nguyen Xuan Son
>
> Add       : Japan, Shiga-Ken, Kusatsu-Shi, Kasayama 3choume 1-18 
> ShiteiHaimu Rien, Room 103
> Tel/Fax  : 81-(0)90-3976 2246
> Email    : nr0003xx@ed.ritsumei.ac.jp <ma...@ed.ritsumei.ac.jp>
> Mobile   : 81-(0)90-3976 2246          URL  : http://www.ritsumei.jp
> =======================================================================


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


Re: validation xml file

Posted by Nguyen Xuan Son <ya...@gmail.com>.
I think i have it. here is the detail
<action name="login" class="com.baibai.action.LoginAction">
<result name="success">C0002_Home.jsp</result>
<result name="input">login.jsp</result>
</action>

Here is the HTML tag for the submit button
<input type="image" alt="Login" border="0" src="images/login_btn_arr.gif"
width="26" height="26" style="cursor:hand">

Please tell me what should i correct?
thank you very much

2009/11/30 Denis Cabasson <de...@gmail.com>

> Do you have a result named "input" tied to your LoginAction? What is it?
>
> Denis.
>
> Nguyen Xuan Son a écrit :
>
>  Dear all
>> I have these in the LoginAction-validation.xml file
>> <validators>
>> <field name="txtName">
>> <field-validator type="requiredstring">
>> <param name="trim">false</param>
>> <message>error</message>
>> </field-validator>
>> </field>
>>  <field name="txtPass">
>> <field-validator type="requiredstring">
>> <param name="trim">false</param>
>> <message>error</message>
>> </field-validator>
>> </field>
>> </validators>
>>
>> but it seems that even there is a error it still continue to implement the
>> LoginAction.java file
>> what should i do if i want it stop implementing the LoginAction.java
>> whenever there is any error appear
>> thank you very much
>>
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>


-- 
=======================================================================
Ritsumeikan University, Asia JinZai Project
Master of Information Science
Nguyen Xuan Son

Add       : Japan, Shiga-Ken, Kusatsu-Shi, Kasayama 3choume 1-18 ShiteiHaimu
Rien, Room 103
Tel/Fax  : 81-(0)90-3976 2246
Email    : nr0003xx@ed.ritsumei.ac.jp
Mobile   : 81-(0)90-3976 2246          URL  : http://www.ritsumei.jp
=======================================================================

Re: [Struts 2.1.8] Message properties on SUBMIT tag not working

Posted by Saeed Iqbal <sa...@gmail.com>.
Struts i8ln does not work with simple theme

use fmt tag instead

On Tuesday, December 1, 2009, David Canos <da...@gmail.com> wrote:
> hi guys
>
> 15th of May in this list someone write:
> theres something like this on bug-tracking?
>
> We are suffering a very strange behavior of the submit tag in a theme=simple
>> form.
>
> I'm using Struts 2.0.12 with i18n done following [1].
>
>
>> <s:submit id="botonCrear" key="creating.form.submit"  name="botonCrear" />
>
> this s:submit give us empty value
>
>
>> if you replace code before to:
>
> <input type="submit" id="botonCrearEvento" name="botonCrear" value="<s:text
>  name="creating.form.submit" />" />
>
> it works properly always.
>
>
> can anyone with me an idea plz?
>
> of course, no warnings, no debug msgs in log file.
>
>
> I have been looking for bugs in this way but have nothing found.
>
>
> [1] http://t.wits.sg/2008/06/23/howto-struts-2-i18n/
>
>
> 2009/11/30 Denis Cabasson <de...@gmail.com>
>
>> You should use key to change the text outputted on the screen. You should
>> use name as well to avoid the error you are seeing: the name is being used
>> as the property to set on your action.
>>
>> This error is actually a warning, that is not preventing anything from
>> working fine in your application. It you are really worried about this
>> warning, you can configure the params interceptor to ignore that property :
>> see http://struts.apache.org/2.x/docs/parameters-interceptor.html or
>> http://struts.apache.org/2.0.6/struts2-core/apidocs/com/opensymphony/xwork2/interceptor/ParametersInterceptor.html#excludeParams
>>
>> What is the generated HTML code in your second case (the one using key)?
>>
>> Denis.
>>
>> Celinio Fernandes a écrit :
>>
>>  Hi, I have a message properties file in my web application.
>>> I use it for many tags such as textfield, text ...
>>> For instance : <s:textfield name="client.name"  key="inscription.name"
>>> required="true"/>
>>> It works well except with the SUBMIT tag :
>>>  <s:submit name="inscription.button" align="center"/>
>>>  <s:submit key="inscription.button" align="center"/>
>>>
>>> I get this error, whether i use name or key :
>>>
>>> 20:33:21,198 INFO  [BeanSelectionProvider] Loading global messages from
>>> messages
>>> 20:57:09,451 WARN  [OgnlValueStack] Error setting expression
>>> 'inscription.button' with value '[Ljava.lang.String;@7c0c01'
>>> ognl.OgnlException: target is null for setProperty(null, "button",
>>> [Ljava.lang.String;@7c0c01)
>>>    at ognl.OgnlRuntime.setProperty(OgnlRuntime.java:2219)
>>>    at ognl.ASTProperty.setValueBody(ASTProperty.java:127)
>>>    at ognl.SimpleNode.evaluateSetValueBody(SimpleNode.java:220)
>>>    at ognl.SimpleNode.setValue(SimpleNode.java:301)
>>>    at ognl.ASTChain.setValueBody(ASTChain.java:227)
>>>    at ognl.SimpleNode.evaluateSetValueBody(SimpleNode.java:220)
>>>    at ognl.SimpleNode.setValue(SimpleNode.java:301)
>>>    at ognl.Ognl.setValue(Ognl.java:737)
>>>    at com.opensymphony.xwork2.ognl.OgnlUtil.setValue(OgnlUtil.java:198)
>>>    at
>>> com.opensymphony.xwork2.ognl.OgnlValueStack.setValue(OgnlValueStack.java:161)
>>>    at
>>> com.opensymphony.xwork2.ognl.OgnlValueStack.setValue(OgnlValueStack.java:149)
>>>    at
>>> com.opensymphony.xwork2.interceptor.ParametersInterceptor.setParameters(ParametersInterceptor.java:276)
>>>    at
>>> com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:187)
>>>    at
>>> com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)
>>>    at
>>> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
>>>    at
>>> org.apache.struts2.interceptor.MultiselectInterceptor.intercept(MultiselectInterceptor.java:75)
>>>    at
>>> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
>>>    at
>>> org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:94)
>>>    at
>>> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
>>>    at
>>> com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:165)
>>>    at
>>> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
>>>    at
>>> com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:179)
>>>    at
>>> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
>>>    at
>>> com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:176)
>>>    at
>>> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
>>>    at
>>> org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:52)
>>>    at
>>> org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:488)
>>>    at
>>> org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77)
>>>    at
>>> org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:91)
>>>    at
>>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
>>>    at
>>> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>>>    at
>>> org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
>>>    at
>>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
>>>    at
>>> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>>>    at
>>> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235)
>>>    at
>>> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
>>>    at
>>> org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190)
>>>    at
>>> org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)
>>>    at
>>> org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)
>>>    at
>>> org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)
>>>    at
>>> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
>>>    at
>>> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
>>>    at
>>> org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
>>>    at
>>> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
>>>    at
>>> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
>>>    at
>>> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)
>>>    at
>>> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:598)
>>>    at
>>> org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
>>>    at java.lang.Thread.run(Unknown Source)
>>>
>>>
>>> how come ? Is this a bug ? Thanks for helping.
>>>
>>>
>>>
>>>
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>
>
>
> --
> David Canós
> www.david-canos.net
>

-- 
Saeed Iqbal
Independant Consultant (Freelance)
Struts - J2EE - Application Architect / Developer

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


Re: [Struts 2.1.8] Message properties on SUBMIT tag not working

Posted by David Canos <da...@gmail.com>.
hi guys

15th of May in this list someone write:
theres something like this on bug-tracking?

We are suffering a very strange behavior of the submit tag in a theme=simple
> form.

I'm using Struts 2.0.12 with i18n done following [1].


> <s:submit id="botonCrear" key="creating.form.submit"  name="botonCrear" />

this s:submit give us empty value


> if you replace code before to:

<input type="submit" id="botonCrearEvento" name="botonCrear" value="<s:text
 name="creating.form.submit" />" />

it works properly always.


can anyone with me an idea plz?

of course, no warnings, no debug msgs in log file.


I have been looking for bugs in this way but have nothing found.


[1] http://t.wits.sg/2008/06/23/howto-struts-2-i18n/


2009/11/30 Denis Cabasson <de...@gmail.com>

> You should use key to change the text outputted on the screen. You should
> use name as well to avoid the error you are seeing: the name is being used
> as the property to set on your action.
>
> This error is actually a warning, that is not preventing anything from
> working fine in your application. It you are really worried about this
> warning, you can configure the params interceptor to ignore that property :
> see http://struts.apache.org/2.x/docs/parameters-interceptor.html or
> http://struts.apache.org/2.0.6/struts2-core/apidocs/com/opensymphony/xwork2/interceptor/ParametersInterceptor.html#excludeParams
>
> What is the generated HTML code in your second case (the one using key)?
>
> Denis.
>
> Celinio Fernandes a écrit :
>
>  Hi, I have a message properties file in my web application.
>> I use it for many tags such as textfield, text ...
>> For instance : <s:textfield name="client.name"  key="inscription.name"
>> required="true"/>
>> It works well except with the SUBMIT tag :
>>  <s:submit name="inscription.button" align="center"/>
>>  <s:submit key="inscription.button" align="center"/>
>>
>> I get this error, whether i use name or key :
>>
>> 20:33:21,198 INFO  [BeanSelectionProvider] Loading global messages from
>> messages
>> 20:57:09,451 WARN  [OgnlValueStack] Error setting expression
>> 'inscription.button' with value '[Ljava.lang.String;@7c0c01'
>> ognl.OgnlException: target is null for setProperty(null, "button",
>> [Ljava.lang.String;@7c0c01)
>>    at ognl.OgnlRuntime.setProperty(OgnlRuntime.java:2219)
>>    at ognl.ASTProperty.setValueBody(ASTProperty.java:127)
>>    at ognl.SimpleNode.evaluateSetValueBody(SimpleNode.java:220)
>>    at ognl.SimpleNode.setValue(SimpleNode.java:301)
>>    at ognl.ASTChain.setValueBody(ASTChain.java:227)
>>    at ognl.SimpleNode.evaluateSetValueBody(SimpleNode.java:220)
>>    at ognl.SimpleNode.setValue(SimpleNode.java:301)
>>    at ognl.Ognl.setValue(Ognl.java:737)
>>    at com.opensymphony.xwork2.ognl.OgnlUtil.setValue(OgnlUtil.java:198)
>>    at
>> com.opensymphony.xwork2.ognl.OgnlValueStack.setValue(OgnlValueStack.java:161)
>>    at
>> com.opensymphony.xwork2.ognl.OgnlValueStack.setValue(OgnlValueStack.java:149)
>>    at
>> com.opensymphony.xwork2.interceptor.ParametersInterceptor.setParameters(ParametersInterceptor.java:276)
>>    at
>> com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:187)
>>    at
>> com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)
>>    at
>> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
>>    at
>> org.apache.struts2.interceptor.MultiselectInterceptor.intercept(MultiselectInterceptor.java:75)
>>    at
>> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
>>    at
>> org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:94)
>>    at
>> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
>>    at
>> com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:165)
>>    at
>> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
>>    at
>> com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:179)
>>    at
>> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
>>    at
>> com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:176)
>>    at
>> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
>>    at
>> org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:52)
>>    at
>> org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:488)
>>    at
>> org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77)
>>    at
>> org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:91)
>>    at
>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
>>    at
>> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>>    at
>> org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
>>    at
>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
>>    at
>> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>>    at
>> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235)
>>    at
>> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
>>    at
>> org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190)
>>    at
>> org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)
>>    at
>> org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)
>>    at
>> org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)
>>    at
>> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
>>    at
>> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
>>    at
>> org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
>>    at
>> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
>>    at
>> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
>>    at
>> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)
>>    at
>> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:598)
>>    at
>> org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
>>    at java.lang.Thread.run(Unknown Source)
>>
>>
>> how come ? Is this a bug ? Thanks for helping.
>>
>>
>>
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>


-- 
David Canós
www.david-canos.net

Re: [Struts 2.1.8] Message properties on SUBMIT tag not working

Posted by Denis Cabasson <de...@gmail.com>.
You should use key to change the text outputted on the screen. You 
should use name as well to avoid the error you are seeing: the name is 
being used as the property to set on your action.

This error is actually a warning, that is not preventing anything from 
working fine in your application. It you are really worried about this 
warning, you can configure the params interceptor to ignore that 
property : see 
http://struts.apache.org/2.x/docs/parameters-interceptor.html or 
http://struts.apache.org/2.0.6/struts2-core/apidocs/com/opensymphony/xwork2/interceptor/ParametersInterceptor.html#excludeParams 


What is the generated HTML code in your second case (the one using key)?

Denis.

Celinio Fernandes a écrit :
> Hi, 
> I have a message properties file in my web application.
> I use it for many tags such as textfield, text ...
> For instance : <s:textfield name="client.name"  key="inscription.name" required="true"/>
> It works well except with the SUBMIT tag :
>   <s:submit name="inscription.button" align="center"/>
>   <s:submit key="inscription.button" align="center"/>
>
> I get this error, whether i use name or key :
>
> 20:33:21,198 INFO  [BeanSelectionProvider] Loading global messages from messages
> 20:57:09,451 WARN  [OgnlValueStack] Error setting expression 'inscription.button' with value '[Ljava.lang.String;@7c0c01'
> ognl.OgnlException: target is null for setProperty(null, "button", [Ljava.lang.String;@7c0c01)
>     at ognl.OgnlRuntime.setProperty(OgnlRuntime.java:2219)
>     at ognl.ASTProperty.setValueBody(ASTProperty.java:127)
>     at ognl.SimpleNode.evaluateSetValueBody(SimpleNode.java:220)
>     at ognl.SimpleNode.setValue(SimpleNode.java:301)
>     at ognl.ASTChain.setValueBody(ASTChain.java:227)
>     at ognl.SimpleNode.evaluateSetValueBody(SimpleNode.java:220)
>     at ognl.SimpleNode.setValue(SimpleNode.java:301)
>     at ognl.Ognl.setValue(Ognl.java:737)
>     at com.opensymphony.xwork2.ognl.OgnlUtil.setValue(OgnlUtil.java:198)
>     at com.opensymphony.xwork2.ognl.OgnlValueStack.setValue(OgnlValueStack.java:161)
>     at com.opensymphony.xwork2.ognl.OgnlValueStack.setValue(OgnlValueStack.java:149)
>     at com.opensymphony.xwork2.interceptor.ParametersInterceptor.setParameters(ParametersInterceptor.java:276)
>     at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:187)
>     at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)
>     at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
>     at org.apache.struts2.interceptor.MultiselectInterceptor.intercept(MultiselectInterceptor.java:75)
>     at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
>     at org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:94)
>     at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
>     at com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:165)
>     at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
>     at com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:179)
>     at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
>     at com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:176)
>     at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
>     at org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:52)
>     at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:488)
>     at org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77)
>     at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:91)
>     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
>     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>     at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
>     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
>     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>     at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235)
>     at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
>     at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190)
>     at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)
>     at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)
>     at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)
>     at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
>     at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
>     at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
>     at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
>     at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
>     at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)
>     at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:598)
>     at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
>     at java.lang.Thread.run(Unknown Source)
>
>
> how come ? Is this a bug ? Thanks for helping.
>
>
>
>       
>   


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


[Struts 2.1.8] Message properties on SUBMIT tag not working

Posted by Celinio Fernandes <ce...@yahoo.com>.
Hi, 
I have a message properties file in my web application.
I use it for many tags such as textfield, text ...
For instance : <s:textfield name="client.name"  key="inscription.name" required="true"/>
It works well except with the SUBMIT tag :
  <s:submit name="inscription.button" align="center"/>
  <s:submit key="inscription.button" align="center"/>

I get this error, whether i use name or key :

20:33:21,198 INFO  [BeanSelectionProvider] Loading global messages from messages
20:57:09,451 WARN  [OgnlValueStack] Error setting expression 'inscription.button' with value '[Ljava.lang.String;@7c0c01'
ognl.OgnlException: target is null for setProperty(null, "button", [Ljava.lang.String;@7c0c01)
    at ognl.OgnlRuntime.setProperty(OgnlRuntime.java:2219)
    at ognl.ASTProperty.setValueBody(ASTProperty.java:127)
    at ognl.SimpleNode.evaluateSetValueBody(SimpleNode.java:220)
    at ognl.SimpleNode.setValue(SimpleNode.java:301)
    at ognl.ASTChain.setValueBody(ASTChain.java:227)
    at ognl.SimpleNode.evaluateSetValueBody(SimpleNode.java:220)
    at ognl.SimpleNode.setValue(SimpleNode.java:301)
    at ognl.Ognl.setValue(Ognl.java:737)
    at com.opensymphony.xwork2.ognl.OgnlUtil.setValue(OgnlUtil.java:198)
    at com.opensymphony.xwork2.ognl.OgnlValueStack.setValue(OgnlValueStack.java:161)
    at com.opensymphony.xwork2.ognl.OgnlValueStack.setValue(OgnlValueStack.java:149)
    at com.opensymphony.xwork2.interceptor.ParametersInterceptor.setParameters(ParametersInterceptor.java:276)
    at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:187)
    at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)
    at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
    at org.apache.struts2.interceptor.MultiselectInterceptor.intercept(MultiselectInterceptor.java:75)
    at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
    at org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:94)
    at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
    at com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:165)
    at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
    at com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:179)
    at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
    at com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:176)
    at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
    at org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:52)
    at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:488)
    at org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77)
    at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:91)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
    at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190)
    at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)
    at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)
    at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
    at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:598)
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
    at java.lang.Thread.run(Unknown Source)


how come ? Is this a bug ? Thanks for helping.



      

Re: validation xml file

Posted by Denis Cabasson <de...@gmail.com>.
Do you have a result named "input" tied to your LoginAction? What is it?

Denis.

Nguyen Xuan Son a écrit :
> Dear all
> I have these in the LoginAction-validation.xml file
> <validators>
> <field name="txtName">
> <field-validator type="requiredstring">
> <param name="trim">false</param>
> <message>error</message>
> </field-validator>
> </field>
>  <field name="txtPass">
> <field-validator type="requiredstring">
> <param name="trim">false</param>
> <message>error</message>
> </field-validator>
> </field>
> </validators>
>
> but it seems that even there is a error it still continue to implement the
> LoginAction.java file
> what should i do if i want it stop implementing the LoginAction.java
> whenever there is any error appear
> thank you very much
>
>   


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