You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Felipe Lorenz <fe...@idealogic.com.br> on 2013/06/20 21:29:05 UTC

s:action tag showing result

Hi all,

I have been using struts quite a long time, but in the last days I have faced a strange behaviour of s:action tag.

In my JSP I am using the tag action to load list to be used to mount my s:select. But in the redered HTML, the result of the action is showing, even when the executeResult is false.

There is something I missing?


JSP code:

<s:action namespace="/ajax" name="loadEstadoByPais" var="estado" flush="false" />
<s:select
                        label="%{getText('global.lbl_nmEstado')}"
                        name="cidade.estado.idEstado"
                        listKey="idEstado"
                        listValue="nmEstado"
                        list="#estado.estados"
                        emptyOption="true"
                        id="estadoCombo"
                        tooltip="%{getText('global.hint_nmEstado')}"/>

struts.xml:

<action name="loadEstadoByPais" method="loadEstadoByPais" class="br.com.seedingControl.action.EstadoAction">
	<result name="index" type="json">
		<param name="includeProperties">
			^estados\[\d+\]\.idEstado,
			^estados\[\d+\]\.nmEstado
		</param>
	</result>
</action>

As you can see, in the struts.xml, I have only json result, and I only need as json, but when I use the action tag, I just only need the populated list to be used in the select tag. It is working very well, but the problem is that the json result is showing in the HTML. And it is showing in the top, not in the action tag position, what is strange.

Also, I try to change the struts.devMode to false, but nothing changes.

The project is using struts 2.3.14.3 with rest-plugin. But for this kind ok action, I avoid rest and use just json-plugin.

Please, if need any further info, ask me!

Thanks in advance.


Felipe Lorenz


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


Re: s:action tag showing result

Posted by Felipe Lorenz <fe...@idealogic.com.br>.
Hello Martin,

I'm not sure. Actually my experience with Spring is almost, but very close to 0. I know what spring does and I know there is a lot of modules in Spring, but I never try it in my projects.

Maybe Lukasz can help you with it.

Att,
Felipe Lorenz

Em 27/06/2013, às 12:11, Martin Gainty escreveu:

> Felipe and Lukasz
> 
> Spring 3.1 supports "injectable namespaces" to constructor of Spring Object
> would something like this work for proxyFactory?
> 
> http://static.springsource.org/spring/docs/3.1.x/spring-framework-reference/htmlsingle/spring-framework-reference.html#beans-c-namespace
> 
> Obrigado,
> Martin 
> ______________________________________________ 
> Por favor, não altere ou perturbar essa transmissão
> 
> 
>> From: lukaszlenart@apache.org
>> Date: Thu, 27 Jun 2013 14:17:18 +0200
>> Subject: Re: s:action tag showing result
>> To: user@struts.apache.org
>> 
>> Username?
>> 
>> 2013/6/27 Felipe Lorenz <fe...@idealogic.com.br>:
>>> Sure!
>>> 
>>> I have created an user at jira, but I think I dont have permissions to open a new issue. Or am I in the wrong place? :)
>>> 
>>> 
>>> Felipe Lorenz
>>> 
>>> Em 27/06/2013, às 03:11, Lukasz Lenart escreveu:
>>> 
>>>> Thanks Felipe!
>>>> 
>>>> I think we must extend RestActionProxyFactory to also add exclude list
>>>> of namespaces, eg. "/ajax,/login", thus will allow to work in your
>>>> configuration.
>>>> 
>>>> Could you register an issue?
>>>> 
>>>> 
>>>> Thanks in advance
>>>> --
>>>> Łukasz
>>>> + 48 606 323 122 http://www.lenart.org.pl/
>>>> 
>>>> 2013/6/26 Felipe Lorenz <fe...@idealogic.com.br>:
>>>>> Hi Lukasz,
>>>>> 
>>>>> I could identify one plugin wich could be creating this behaviour, the rest plugin.
>>>>> 
>>>>> 
>>>>> Since I have this configuration:
>>>>>>> <constant name="struts.mapper.class" value="org.apache.struts2.dispatcher.mapper.PrefixBasedActionMapper"/>
>>>>>>> <constant name="struts.mapper.prefixMapping" value=":rest,/ajax:struts,/login:struts"/>
>>>>> 
>>>>> 
>>>>> I expect that, when I request the following url http://xxxxxxxxxxx.com/ajax/anyThingHere, struts should handle this call. But instead, RestActionProxyFactory is handle this call.
>>>>> 
>>>>> But the RestActionProxyFactory class has a if, and every time the namespace attribute is injected with "/ajax" value. So the condition always is redirect to the rest plugin handler and not to the struts default.
>>>>> 
>>>>> Here is my ActionProxyFactory implementation:
>>>>> 
>>>>> public class CustomActionProxyFactory extends RestActionProxyFactory {
>>>>> 
>>>>>       @Override
>>>>>       public ActionProxy createActionProxy(String namespace, String actionName, String methodName, Map<String, Object> extraContext, boolean executeResult, boolean cleanupContext) {
>>>>>               RestActionProxyFactory p = new RestActionProxyFactory();
>>>>>               p.setContainer(container);
>>>>>               if ("/ajax".equals(namespace)) {
>>>>>                       p.setNamespace("/idealogic");
>>>>>               }
>>>>> 
>>>>>               return p.createActionProxy(namespace, actionName, methodName, extraContext, executeResult, cleanupContext);
>>>>>       }
>>>>> }
>>>>> 
>>>>> By some reason, it fixed the origin behaviour.
>>>>> 
>>>>> I hope it could help you.
>>>>> 
>>>>> Thanks,
>>>>> Felipe Lorenz
>>>>> 
>>>>> Em 26/06/2013, às 04:45, Lukasz Lenart escreveu:
>>>>> 
>>>>>> As I understand you use <s:action executeResult="false"/> ? Which
>>>>>> means result named "json" shouldn't be executed, you can even remove
>>>>>> it.
>>>>>> 
>>>>>> 
>>>>>> Regards
>>>>>> --
>>>>>> Łukasz
>>>>>> + 48 606 323 122 http://www.lenart.org.pl/
>>>>>> 
>>>>>> 2013/6/22 Felipe Lorenz <fe...@idealogic.com.br>:
>>>>>>> Hello Lukasz,
>>>>>>> 
>>>>>>> I still facing this behaviour. Even with 2.3.16-SNAPSHOT.
>>>>>>> 
>>>>>>> One thing that make me thing, was the flush attribute. When it is true, the json result (the string) appear in the position where the action tag is in the jsp. But, when I change it to false, the result appears in the top os my page.
>>>>>>> 
>>>>>>> One workaround that I can use is return a result name that is no defined in the struts.xml. This workaround throw an exception, since struts could no find my result name, but my list is populated and no result from this action tag appear in my page.
>>>>>>> 
>>>>>>> I hope this information can help.
>>>>>>> 
>>>>>>> Also, I am printing my config:
>>>>>>> 
>>>>>>> struts.xml:
>>>>>>> 
>>>>>>> <?xml version="1.0" encoding="UTF-8" ?>
>>>>>>> <!DOCTYPE struts PUBLIC
>>>>>>>      "-//Apache Software Foundation//DTD Struts Configuration 2.3//EN"
>>>>>>>      "http://struts.apache.org/dtds/struts-2.3.dtd">
>>>>>>> <struts order="10">
>>>>>>>      <constant name="struts.devMode" value="false" />
>>>>>>>      <constant name="struts.action.extension" value=",json,xhtml,xml"/>
>>>>>>> 
>>>>>>>      <constant name="struts.convention.action.mapAllMatches" value="true" />
>>>>>>>      <constant name="struts.convention.default.parent.package" value="default"/>
>>>>>>> 
>>>>>>>      <constant name="struts.custom.i18n.resources" value="global" />
>>>>>>> 
>>>>>>>      <constant name="struts.mapper.class" value="org.apache.struts2.dispatcher.mapper.PrefixBasedActionMapper"/>
>>>>>>>      <constant name="struts.mapper.prefixMapping" value=":rest,/ajax:struts,/login:struts"/>
>>>>>>> 
>>>>>>>      <package name="default" extends="rest-default">
>>>>>>> 
>>>>>>>              <interceptors>
>>>>>>>                      <interceptor class="br.com.idealogic.interceptor.LoginInterceptor" name="login"/>
>>>>>>>                      <interceptor class="br.com.idealogic.interceptor.PermissaoInterceptor" name="permissao"/>
>>>>>>>                      <interceptor class="br.com.idealogic.interceptor.I18nInterceptor" name="idioma"/>
>>>>>>>                      <interceptor class="br.com.idealogic.interceptor.JPAInterceptor" name="jpa"/>
>>>>>>>                      <interceptor-stack name="jpaStack">
>>>>>>>                              <interceptor-ref name="login"/>
>>>>>>>                              <interceptor-ref name="permissao"/>
>>>>>>>                              <interceptor-ref name="idioma"/>
>>>>>>>                              <interceptor-ref name="jpa"/>
>>>>>>>                              <interceptor-ref name="restDefaultStack"/>
>>>>>>>                      </interceptor-stack>
>>>>>>>              </interceptors>
>>>>>>>              <default-interceptor-ref name="jpaStack"/>
>>>>>>> 
>>>>>>> 
>>>>>>>              <default-action-ref name="login_sistema"></default-action-ref>
>>>>>>> 
>>>>>>>              <global-results>
>>>>>>>                      <result name="login">/login.jsp</result>
>>>>>>>                      <result name="forbidden">/forbidden.jsp</result>
>>>>>>>              </global-results>
>>>>>>> 
>>>>>>>      </package>
>>>>>>> 
>>>>>>>      <include file="struts-ajax.xml"/>
>>>>>>>      <include file="struts-login.xml"/>
>>>>>>>      <include file="struts-filtro.xml"/>
>>>>>>> </struts>
>>>>>>> 
>>>>>>> struts-ajax.xml
>>>>>>> 
>>>>>>> <?xml version="1.0" encoding="UTF-8"?>
>>>>>>> <!DOCTYPE struts PUBLIC
>>>>>>> "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
>>>>>>> "http://struts.apache.org/dtds/struts-2.0.dtd">
>>>>>>> <struts>
>>>>>>>      <package name="ajax" extends="json-default" namespace="/ajax">
>>>>>>>              <interceptors>
>>>>>>>                      <interceptor class="br.com.idealogic.interceptor.JPAInterceptor" name="jpa"/>
>>>>>>>                      <interceptor-stack name="jpaJsonStack">
>>>>>>>                              <interceptor-ref name="jpa"/>
>>>>>>>                              <interceptor-ref name="jsonValidationWorkflowStack"/>
>>>>>>>                      </interceptor-stack>
>>>>>>>              </interceptors>
>>>>>>>              <default-interceptor-ref name="jpaJsonStack"/>
>>>>>>> 
>>>>>>> 
>>>>>>>              <action name="loadCidadeByEstado" method="loadCidadeByEstado" class="br.com.seedingControl.action.CidadeAction">
>>>>>>>                      <result name="json" type="json">
>>>>>>>                              <param name="includeProperties">
>>>>>>>                                      ^cidades\[\d+\]\.idCidade,
>>>>>>>                                      ^cidades\[\d+\]\.nmCidade
>>>>>>>                              </param>
>>>>>>>                      </result>
>>>>>>>              </action>
>>>>>>> 
>>>>>>>      </package>
>>>>>>> </struts>
>>>>>>> 
>>>>>>> Thanks for all your help!
>>>>>>> 
>>>>>>> Felipe Lorenz
>>>>>>> 
>>>>>>> Em 22/06/2013, às 04:27, Lukasz Lenart escreveu:
>>>>>>> 
>>>>>>>> 2013/6/22 Litman, Bruno <bl...@alabamainteractive.org>:
>>>>>>>>> We are also experiencing issues with tags and theme files, we are upgrading many applications from 2.3.4.1 to 2.3.14.3
>>>>>>>>> I am not sure if this is related - if not and if I need to start a new discussion please let me know and accept my apology.
>>>>>>>>> 
>>>>>>>>> 1/
>>>>>>>>> 
>>>>>>>>> We previously always coded forms as :
>>>>>>>>>     <s:form action="login" namespace="/">....
>>>>>>>>> Now randomly, this fails to generate the proper action url in the html (it is missing the '.action', which results in a 404 once you post the form)
>>>>>>>>> 
>>>>>>>>> The only workaround we have found so far is to add the '.action' suffix to the s:form's action attribute. Before it was always added for us by struts.
>>>>>>>>> So now we are having success with
>>>>>>>>>     <s:form action="login.action" namespace="/">...
>>>>>>>>> 
>>>>>>>>> Is this expected behavior? Did this change recently? 2.3.4.1 is not so ancient..
>>>>>>>> 
>>>>>>>> No, it isn't - mainly a bug - Struts should add suffix for you, you
>>>>>>>> basically use the same action names as defined in struts.xml. This is
>>>>>>>> very strange, I have just tested with struts2-blank on Jetty and
>>>>>>>> suffix was there. Could you share more details about the config?
>>>>>>>> 
>>>>>>>>> 2/
>>>>>>>>> 
>>>>>>>>> We are trying to replace the "required" attribute in the textfields with "requiredLabel" without success. Was the xhtml theme's ftl file "controlheader_core" updated to reflect the changes in the struts-tags.tld (requiredLabel replaced required)?
>>>>>>>> 
>>>>>>>> You are right, it is bug :\ Please fill an issue
>>>>>>>> 
>>>>>>>>> Also, it seems applications are randomly serving ftl files from other applications' theme folders with the same name.
>>>>>>>>> This was demonstrated by modifying something obvious in one application's ftl file (displaying some text next to a text field's label), and the effect can be seen randomly on other applications which shouldn’t even see that application's template folder (the themes are however named the same in both applications)
>>>>>>>>> I am only able to make the "requiredLabel" attribute work if placed in a <s:param> tag as opposed to being just an attribute of the s:textfield tag, but even so it is still not always using the same ftl files (however always from similarly named themes placed inside each application)
>>>>>>>>> 
>>>>>>>>> This is extremely confusing. Is FreeMarker caching files independently of the application? Is the app container interfering with caching? (We are using Resin 4.0.36)
>>>>>>>> 
>>>>>>>> Hmmm... very strange behaviour, it will be hard to find the source of
>>>>>>>> the problem. Maybe it is related to new ContainerHolder and how Resin
>>>>>>>> is managing threads - but I'm not sure :\
>>>>>>>> 
>>>>>>>> 
>>>>>>>> Regards
>>>>>>>> --
>>>>>>>> Łukasz
>>>>>>>> + 48 606 323 122 http://www.lenart.org.pl/
>>>>>>>> 
>>>>>>>> ---------------------------------------------------------------------
>>>>>>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>>>>>>> For additional commands, e-mail: user-help@struts.apache.org
>>>>>>>> 
>>>>>>> 
>>>>>>> 
>>>>>>> ---------------------------------------------------------------------
>>>>>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>>>>>> For additional commands, e-mail: user-help@struts.apache.org
>>>>>>> 
>>>>>> 
>>>>>> ---------------------------------------------------------------------
>>>>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>>>>> For additional commands, e-mail: user-help@struts.apache.org
>>>>>> 
>>>>> 
>>>>> 
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>>>> For additional commands, e-mail: user-help@struts.apache.org
>>>>> 
>>>> 
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>>> For additional commands, e-mail: user-help@struts.apache.org
>>>> 
>>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>> 
> 		 	   		  


RE: s:action tag showing result

Posted by Martin Gainty <mg...@hotmail.com>.
Felipe and Lukasz
 
Spring 3.1 supports "injectable namespaces" to constructor of Spring Object
would something like this work for proxyFactory?

http://static.springsource.org/spring/docs/3.1.x/spring-framework-reference/htmlsingle/spring-framework-reference.html#beans-c-namespace

Obrigado,
Martin 
______________________________________________ 
Por favor, não altere ou perturbar essa transmissão

 
> From: lukaszlenart@apache.org
> Date: Thu, 27 Jun 2013 14:17:18 +0200
> Subject: Re: s:action tag showing result
> To: user@struts.apache.org
> 
> Username?
> 
> 2013/6/27 Felipe Lorenz <fe...@idealogic.com.br>:
> > Sure!
> >
> > I have created an user at jira, but I think I dont have permissions to open a new issue. Or am I in the wrong place? :)
> >
> >
> > Felipe Lorenz
> >
> > Em 27/06/2013, às 03:11, Lukasz Lenart escreveu:
> >
> >> Thanks Felipe!
> >>
> >> I think we must extend RestActionProxyFactory to also add exclude list
> >> of namespaces, eg. "/ajax,/login", thus will allow to work in your
> >> configuration.
> >>
> >> Could you register an issue?
> >>
> >>
> >> Thanks in advance
> >> --
> >> Łukasz
> >> + 48 606 323 122 http://www.lenart.org.pl/
> >>
> >> 2013/6/26 Felipe Lorenz <fe...@idealogic.com.br>:
> >>> Hi Lukasz,
> >>>
> >>> I could identify one plugin wich could be creating this behaviour, the rest plugin.
> >>>
> >>>
> >>> Since I have this configuration:
> >>>>> <constant name="struts.mapper.class" value="org.apache.struts2.dispatcher.mapper.PrefixBasedActionMapper"/>
> >>>>> <constant name="struts.mapper.prefixMapping" value=":rest,/ajax:struts,/login:struts"/>
> >>>
> >>>
> >>> I expect that, when I request the following url http://xxxxxxxxxxx.com/ajax/anyThingHere, struts should handle this call. But instead, RestActionProxyFactory is handle this call.
> >>>
> >>> But the RestActionProxyFactory class has a if, and every time the namespace attribute is injected with "/ajax" value. So the condition always is redirect to the rest plugin handler and not to the struts default.
> >>>
> >>> Here is my ActionProxyFactory implementation:
> >>>
> >>> public class CustomActionProxyFactory extends RestActionProxyFactory {
> >>>
> >>>        @Override
> >>>        public ActionProxy createActionProxy(String namespace, String actionName, String methodName, Map<String, Object> extraContext, boolean executeResult, boolean cleanupContext) {
> >>>                RestActionProxyFactory p = new RestActionProxyFactory();
> >>>                p.setContainer(container);
> >>>                if ("/ajax".equals(namespace)) {
> >>>                        p.setNamespace("/idealogic");
> >>>                }
> >>>
> >>>                return p.createActionProxy(namespace, actionName, methodName, extraContext, executeResult, cleanupContext);
> >>>        }
> >>> }
> >>>
> >>> By some reason, it fixed the origin behaviour.
> >>>
> >>> I hope it could help you.
> >>>
> >>> Thanks,
> >>> Felipe Lorenz
> >>>
> >>> Em 26/06/2013, às 04:45, Lukasz Lenart escreveu:
> >>>
> >>>> As I understand you use <s:action executeResult="false"/> ? Which
> >>>> means result named "json" shouldn't be executed, you can even remove
> >>>> it.
> >>>>
> >>>>
> >>>> Regards
> >>>> --
> >>>> Łukasz
> >>>> + 48 606 323 122 http://www.lenart.org.pl/
> >>>>
> >>>> 2013/6/22 Felipe Lorenz <fe...@idealogic.com.br>:
> >>>>> Hello Lukasz,
> >>>>>
> >>>>> I still facing this behaviour. Even with 2.3.16-SNAPSHOT.
> >>>>>
> >>>>> One thing that make me thing, was the flush attribute. When it is true, the json result (the string) appear in the position where the action tag is in the jsp. But, when I change it to false, the result appears in the top os my page.
> >>>>>
> >>>>> One workaround that I can use is return a result name that is no defined in the struts.xml. This workaround throw an exception, since struts could no find my result name, but my list is populated and no result from this action tag appear in my page.
> >>>>>
> >>>>> I hope this information can help.
> >>>>>
> >>>>> Also, I am printing my config:
> >>>>>
> >>>>> struts.xml:
> >>>>>
> >>>>> <?xml version="1.0" encoding="UTF-8" ?>
> >>>>> <!DOCTYPE struts PUBLIC
> >>>>>       "-//Apache Software Foundation//DTD Struts Configuration 2.3//EN"
> >>>>>       "http://struts.apache.org/dtds/struts-2.3.dtd">
> >>>>> <struts order="10">
> >>>>>       <constant name="struts.devMode" value="false" />
> >>>>>       <constant name="struts.action.extension" value=",json,xhtml,xml"/>
> >>>>>
> >>>>>       <constant name="struts.convention.action.mapAllMatches" value="true" />
> >>>>>       <constant name="struts.convention.default.parent.package" value="default"/>
> >>>>>
> >>>>>       <constant name="struts.custom.i18n.resources" value="global" />
> >>>>>
> >>>>>       <constant name="struts.mapper.class" value="org.apache.struts2.dispatcher.mapper.PrefixBasedActionMapper"/>
> >>>>>       <constant name="struts.mapper.prefixMapping" value=":rest,/ajax:struts,/login:struts"/>
> >>>>>
> >>>>>       <package name="default" extends="rest-default">
> >>>>>
> >>>>>               <interceptors>
> >>>>>                       <interceptor class="br.com.idealogic.interceptor.LoginInterceptor" name="login"/>
> >>>>>                       <interceptor class="br.com.idealogic.interceptor.PermissaoInterceptor" name="permissao"/>
> >>>>>                       <interceptor class="br.com.idealogic.interceptor.I18nInterceptor" name="idioma"/>
> >>>>>                       <interceptor class="br.com.idealogic.interceptor.JPAInterceptor" name="jpa"/>
> >>>>>                       <interceptor-stack name="jpaStack">
> >>>>>                               <interceptor-ref name="login"/>
> >>>>>                               <interceptor-ref name="permissao"/>
> >>>>>                               <interceptor-ref name="idioma"/>
> >>>>>                               <interceptor-ref name="jpa"/>
> >>>>>                               <interceptor-ref name="restDefaultStack"/>
> >>>>>                       </interceptor-stack>
> >>>>>               </interceptors>
> >>>>>               <default-interceptor-ref name="jpaStack"/>
> >>>>>
> >>>>>
> >>>>>               <default-action-ref name="login_sistema"></default-action-ref>
> >>>>>
> >>>>>               <global-results>
> >>>>>                       <result name="login">/login.jsp</result>
> >>>>>                       <result name="forbidden">/forbidden.jsp</result>
> >>>>>               </global-results>
> >>>>>
> >>>>>       </package>
> >>>>>
> >>>>>       <include file="struts-ajax.xml"/>
> >>>>>       <include file="struts-login.xml"/>
> >>>>>       <include file="struts-filtro.xml"/>
> >>>>> </struts>
> >>>>>
> >>>>> struts-ajax.xml
> >>>>>
> >>>>> <?xml version="1.0" encoding="UTF-8"?>
> >>>>> <!DOCTYPE struts PUBLIC
> >>>>> "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
> >>>>> "http://struts.apache.org/dtds/struts-2.0.dtd">
> >>>>> <struts>
> >>>>>       <package name="ajax" extends="json-default" namespace="/ajax">
> >>>>>               <interceptors>
> >>>>>                       <interceptor class="br.com.idealogic.interceptor.JPAInterceptor" name="jpa"/>
> >>>>>                       <interceptor-stack name="jpaJsonStack">
> >>>>>                               <interceptor-ref name="jpa"/>
> >>>>>                               <interceptor-ref name="jsonValidationWorkflowStack"/>
> >>>>>                       </interceptor-stack>
> >>>>>               </interceptors>
> >>>>>               <default-interceptor-ref name="jpaJsonStack"/>
> >>>>>
> >>>>>
> >>>>>               <action name="loadCidadeByEstado" method="loadCidadeByEstado" class="br.com.seedingControl.action.CidadeAction">
> >>>>>                       <result name="json" type="json">
> >>>>>                               <param name="includeProperties">
> >>>>>                                       ^cidades\[\d+\]\.idCidade,
> >>>>>                                       ^cidades\[\d+\]\.nmCidade
> >>>>>                               </param>
> >>>>>                       </result>
> >>>>>               </action>
> >>>>>
> >>>>>       </package>
> >>>>> </struts>
> >>>>>
> >>>>> Thanks for all your help!
> >>>>>
> >>>>> Felipe Lorenz
> >>>>>
> >>>>> Em 22/06/2013, às 04:27, Lukasz Lenart escreveu:
> >>>>>
> >>>>>> 2013/6/22 Litman, Bruno <bl...@alabamainteractive.org>:
> >>>>>>> We are also experiencing issues with tags and theme files, we are upgrading many applications from 2.3.4.1 to 2.3.14.3
> >>>>>>> I am not sure if this is related - if not and if I need to start a new discussion please let me know and accept my apology.
> >>>>>>>
> >>>>>>> 1/
> >>>>>>>
> >>>>>>> We previously always coded forms as :
> >>>>>>>      <s:form action="login" namespace="/">....
> >>>>>>> Now randomly, this fails to generate the proper action url in the html (it is missing the '.action', which results in a 404 once you post the form)
> >>>>>>>
> >>>>>>> The only workaround we have found so far is to add the '.action' suffix to the s:form's action attribute. Before it was always added for us by struts.
> >>>>>>> So now we are having success with
> >>>>>>>      <s:form action="login.action" namespace="/">...
> >>>>>>>
> >>>>>>> Is this expected behavior? Did this change recently? 2.3.4.1 is not so ancient..
> >>>>>>
> >>>>>> No, it isn't - mainly a bug - Struts should add suffix for you, you
> >>>>>> basically use the same action names as defined in struts.xml. This is
> >>>>>> very strange, I have just tested with struts2-blank on Jetty and
> >>>>>> suffix was there. Could you share more details about the config?
> >>>>>>
> >>>>>>> 2/
> >>>>>>>
> >>>>>>> We are trying to replace the "required" attribute in the textfields with "requiredLabel" without success. Was the xhtml theme's ftl file "controlheader_core" updated to reflect the changes in the struts-tags.tld (requiredLabel replaced required)?
> >>>>>>
> >>>>>> You are right, it is bug :\ Please fill an issue
> >>>>>>
> >>>>>>> Also, it seems applications are randomly serving ftl files from other applications' theme folders with the same name.
> >>>>>>> This was demonstrated by modifying something obvious in one application's ftl file (displaying some text next to a text field's label), and the effect can be seen randomly on other applications which shouldn’t even see that application's template folder (the themes are however named the same in both applications)
> >>>>>>> I am only able to make the "requiredLabel" attribute work if placed in a <s:param> tag as opposed to being just an attribute of the s:textfield tag, but even so it is still not always using the same ftl files (however always from similarly named themes placed inside each application)
> >>>>>>>
> >>>>>>> This is extremely confusing. Is FreeMarker caching files independently of the application? Is the app container interfering with caching? (We are using Resin 4.0.36)
> >>>>>>
> >>>>>> Hmmm... very strange behaviour, it will be hard to find the source of
> >>>>>> the problem. Maybe it is related to new ContainerHolder and how Resin
> >>>>>> is managing threads - but I'm not sure :\
> >>>>>>
> >>>>>>
> >>>>>> Regards
> >>>>>> --
> >>>>>> Łukasz
> >>>>>> + 48 606 323 122 http://www.lenart.org.pl/
> >>>>>>
> >>>>>> ---------------------------------------------------------------------
> >>>>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> >>>>>> For additional commands, e-mail: user-help@struts.apache.org
> >>>>>>
> >>>>>
> >>>>>
> >>>>> ---------------------------------------------------------------------
> >>>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> >>>>> For additional commands, e-mail: user-help@struts.apache.org
> >>>>>
> >>>>
> >>>> ---------------------------------------------------------------------
> >>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> >>>> For additional commands, e-mail: user-help@struts.apache.org
> >>>>
> >>>
> >>>
> >>> ---------------------------------------------------------------------
> >>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> >>> For additional commands, e-mail: user-help@struts.apache.org
> >>>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> >> For additional commands, e-mail: user-help@struts.apache.org
> >>
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
 		 	   		  

Re: s:action tag showing result

Posted by Felipe Lorenz <fe...@idealogic.com.br>.
Issue created!

Felipe Lorenz

Em 27/06/2013, às 16:46, Lukasz Lenart escreveu:

> 2013/6/27 Felipe Lorenz <fe...@idealogic.com.br>:
>> felipe.lorenz
> 
> You should have "Create Issue" on the top right?
> 
> 
> Regards
> -- 
> Łukasz
> + 48 606 323 122 http://www.lenart.org.pl/
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 


Re: s:action tag showing result

Posted by Lukasz Lenart <lu...@apache.org>.
2013/6/27 Felipe Lorenz <fe...@idealogic.com.br>:
> felipe.lorenz

You should have "Create Issue" on the top right?


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

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


Re: s:action tag showing result

Posted by Felipe Lorenz <fe...@idealogic.com.br>.
felipe.lorenz

Felipe Lorenz
Gerente de Projetos
Idealogic Software
Fone: (51) 3715 5523 - (51) 3715 5548
www.idealogic.com.br

Em 27/06/2013, às 09:17, Lukasz Lenart escreveu:

> Username?
> 
> 2013/6/27 Felipe Lorenz <fe...@idealogic.com.br>:
>> Sure!
>> 
>> I have created an user at jira, but I think I dont have permissions to open a new issue. Or am I in the wrong place? :)
>> 
>> 
>> Felipe Lorenz
>> 
>> Em 27/06/2013, às 03:11, Lukasz Lenart escreveu:
>> 
>>> Thanks Felipe!
>>> 
>>> I think we must extend RestActionProxyFactory to also add exclude list
>>> of namespaces, eg. "/ajax,/login", thus will allow to work in your
>>> configuration.
>>> 
>>> Could you register an issue?
>>> 
>>> 
>>> Thanks in advance
>>> --
>>> Łukasz
>>> + 48 606 323 122 http://www.lenart.org.pl/
>>> 
>>> 2013/6/26 Felipe Lorenz <fe...@idealogic.com.br>:
>>>> Hi Lukasz,
>>>> 
>>>> I could identify one plugin wich could be creating this behaviour, the rest plugin.
>>>> 
>>>> 
>>>> Since I have this configuration:
>>>>>> <constant name="struts.mapper.class" value="org.apache.struts2.dispatcher.mapper.PrefixBasedActionMapper"/>
>>>>>> <constant name="struts.mapper.prefixMapping" value=":rest,/ajax:struts,/login:struts"/>
>>>> 
>>>> 
>>>> I expect that, when I request the following url http://xxxxxxxxxxx.com/ajax/anyThingHere, struts should handle this call. But instead, RestActionProxyFactory is handle this call.
>>>> 
>>>> But the RestActionProxyFactory class has a if, and every time the namespace attribute is injected with "/ajax" value. So the condition always is redirect to the rest plugin handler and not to the struts default.
>>>> 
>>>> Here is my ActionProxyFactory implementation:
>>>> 
>>>> public class CustomActionProxyFactory extends RestActionProxyFactory {
>>>> 
>>>>       @Override
>>>>       public ActionProxy createActionProxy(String namespace, String actionName, String methodName, Map<String, Object> extraContext, boolean executeResult, boolean cleanupContext) {
>>>>               RestActionProxyFactory p = new RestActionProxyFactory();
>>>>               p.setContainer(container);
>>>>               if ("/ajax".equals(namespace)) {
>>>>                       p.setNamespace("/idealogic");
>>>>               }
>>>> 
>>>>               return p.createActionProxy(namespace, actionName, methodName, extraContext, executeResult, cleanupContext);
>>>>       }
>>>> }
>>>> 
>>>> By some reason, it fixed the origin behaviour.
>>>> 
>>>> I hope it could help you.
>>>> 
>>>> Thanks,
>>>> Felipe Lorenz
>>>> 
>>>> Em 26/06/2013, às 04:45, Lukasz Lenart escreveu:
>>>> 
>>>>> As I understand you use <s:action executeResult="false"/> ? Which
>>>>> means result named "json" shouldn't be executed, you can even remove
>>>>> it.
>>>>> 
>>>>> 
>>>>> Regards
>>>>> --
>>>>> Łukasz
>>>>> + 48 606 323 122 http://www.lenart.org.pl/
>>>>> 
>>>>> 2013/6/22 Felipe Lorenz <fe...@idealogic.com.br>:
>>>>>> Hello Lukasz,
>>>>>> 
>>>>>> I still facing this behaviour. Even with 2.3.16-SNAPSHOT.
>>>>>> 
>>>>>> One thing that make me thing, was the flush attribute. When it is true, the json result (the string) appear in the position where the action tag is in the jsp. But, when I change it to false, the result appears in the top os my page.
>>>>>> 
>>>>>> One workaround that I can use is return a result name that is no defined in the struts.xml. This workaround throw an exception, since struts could no find my result name, but my list is populated and no result from this action tag appear in my page.
>>>>>> 
>>>>>> I hope this information can help.
>>>>>> 
>>>>>> Also, I am printing my config:
>>>>>> 
>>>>>> struts.xml:
>>>>>> 
>>>>>> <?xml version="1.0" encoding="UTF-8" ?>
>>>>>> <!DOCTYPE struts PUBLIC
>>>>>>      "-//Apache Software Foundation//DTD Struts Configuration 2.3//EN"
>>>>>>      "http://struts.apache.org/dtds/struts-2.3.dtd">
>>>>>> <struts order="10">
>>>>>>      <constant name="struts.devMode" value="false" />
>>>>>>      <constant name="struts.action.extension" value=",json,xhtml,xml"/>
>>>>>> 
>>>>>>      <constant name="struts.convention.action.mapAllMatches" value="true" />
>>>>>>      <constant name="struts.convention.default.parent.package" value="default"/>
>>>>>> 
>>>>>>      <constant name="struts.custom.i18n.resources" value="global" />
>>>>>> 
>>>>>>      <constant name="struts.mapper.class" value="org.apache.struts2.dispatcher.mapper.PrefixBasedActionMapper"/>
>>>>>>      <constant name="struts.mapper.prefixMapping" value=":rest,/ajax:struts,/login:struts"/>
>>>>>> 
>>>>>>      <package name="default" extends="rest-default">
>>>>>> 
>>>>>>              <interceptors>
>>>>>>                      <interceptor class="br.com.idealogic.interceptor.LoginInterceptor" name="login"/>
>>>>>>                      <interceptor class="br.com.idealogic.interceptor.PermissaoInterceptor" name="permissao"/>
>>>>>>                      <interceptor class="br.com.idealogic.interceptor.I18nInterceptor" name="idioma"/>
>>>>>>                      <interceptor class="br.com.idealogic.interceptor.JPAInterceptor" name="jpa"/>
>>>>>>                      <interceptor-stack name="jpaStack">
>>>>>>                              <interceptor-ref name="login"/>
>>>>>>                              <interceptor-ref name="permissao"/>
>>>>>>                              <interceptor-ref name="idioma"/>
>>>>>>                              <interceptor-ref name="jpa"/>
>>>>>>                              <interceptor-ref name="restDefaultStack"/>
>>>>>>                      </interceptor-stack>
>>>>>>              </interceptors>
>>>>>>              <default-interceptor-ref name="jpaStack"/>
>>>>>> 
>>>>>> 
>>>>>>              <default-action-ref name="login_sistema"></default-action-ref>
>>>>>> 
>>>>>>              <global-results>
>>>>>>                      <result name="login">/login.jsp</result>
>>>>>>                      <result name="forbidden">/forbidden.jsp</result>
>>>>>>              </global-results>
>>>>>> 
>>>>>>      </package>
>>>>>> 
>>>>>>      <include file="struts-ajax.xml"/>
>>>>>>      <include file="struts-login.xml"/>
>>>>>>      <include file="struts-filtro.xml"/>
>>>>>> </struts>
>>>>>> 
>>>>>> struts-ajax.xml
>>>>>> 
>>>>>> <?xml version="1.0" encoding="UTF-8"?>
>>>>>> <!DOCTYPE struts PUBLIC
>>>>>> "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
>>>>>> "http://struts.apache.org/dtds/struts-2.0.dtd">
>>>>>> <struts>
>>>>>>      <package name="ajax" extends="json-default" namespace="/ajax">
>>>>>>              <interceptors>
>>>>>>                      <interceptor class="br.com.idealogic.interceptor.JPAInterceptor" name="jpa"/>
>>>>>>                      <interceptor-stack name="jpaJsonStack">
>>>>>>                              <interceptor-ref name="jpa"/>
>>>>>>                              <interceptor-ref name="jsonValidationWorkflowStack"/>
>>>>>>                      </interceptor-stack>
>>>>>>              </interceptors>
>>>>>>              <default-interceptor-ref name="jpaJsonStack"/>
>>>>>> 
>>>>>> 
>>>>>>              <action name="loadCidadeByEstado" method="loadCidadeByEstado" class="br.com.seedingControl.action.CidadeAction">
>>>>>>                      <result name="json" type="json">
>>>>>>                              <param name="includeProperties">
>>>>>>                                      ^cidades\[\d+\]\.idCidade,
>>>>>>                                      ^cidades\[\d+\]\.nmCidade
>>>>>>                              </param>
>>>>>>                      </result>
>>>>>>              </action>
>>>>>> 
>>>>>>      </package>
>>>>>> </struts>
>>>>>> 
>>>>>> Thanks for all your help!
>>>>>> 
>>>>>> Felipe Lorenz
>>>>>> 
>>>>>> Em 22/06/2013, às 04:27, Lukasz Lenart escreveu:
>>>>>> 
>>>>>>> 2013/6/22 Litman, Bruno <bl...@alabamainteractive.org>:
>>>>>>>> We are also experiencing issues with tags and theme files, we are upgrading many applications from 2.3.4.1 to 2.3.14.3
>>>>>>>> I am not sure if this is related - if not and if I need to start a new discussion please let me know and accept my apology.
>>>>>>>> 
>>>>>>>> 1/
>>>>>>>> 
>>>>>>>> We previously always coded forms as :
>>>>>>>>     <s:form action="login" namespace="/">....
>>>>>>>> Now randomly, this fails to generate the proper action url in the html (it is missing the '.action', which results in a 404 once you post the form)
>>>>>>>> 
>>>>>>>> The only workaround we have found so far is to add the '.action' suffix to the s:form's action attribute. Before it was always added for us by struts.
>>>>>>>> So now we are having success with
>>>>>>>>     <s:form action="login.action" namespace="/">...
>>>>>>>> 
>>>>>>>> Is this expected behavior? Did this change recently? 2.3.4.1 is not so ancient..
>>>>>>> 
>>>>>>> No, it isn't - mainly a bug - Struts should add suffix for you, you
>>>>>>> basically use the same action names as defined in struts.xml. This is
>>>>>>> very strange, I have just tested with struts2-blank on Jetty and
>>>>>>> suffix was there. Could you share more details about the config?
>>>>>>> 
>>>>>>>> 2/
>>>>>>>> 
>>>>>>>> We are trying to replace the "required" attribute in the textfields with "requiredLabel" without success. Was the xhtml theme's ftl file "controlheader_core" updated to reflect the changes in the struts-tags.tld (requiredLabel replaced required)?
>>>>>>> 
>>>>>>> You are right, it is bug :\ Please fill an issue
>>>>>>> 
>>>>>>>> Also, it seems applications are randomly serving ftl files from other applications' theme folders with the same name.
>>>>>>>> This was demonstrated by modifying something obvious in one application's ftl file (displaying some text next to a text field's label), and the effect can be seen randomly on other applications which shouldn’t even see that application's template folder (the themes are however named the same in both applications)
>>>>>>>> I am only able to make the "requiredLabel" attribute work if placed in a <s:param> tag as opposed to being just an attribute of the s:textfield tag, but even so it is still not always using the same ftl files (however always from similarly named themes placed inside each application)
>>>>>>>> 
>>>>>>>> This is extremely confusing. Is FreeMarker caching files independently of the application? Is the app container interfering with caching? (We are using Resin 4.0.36)
>>>>>>> 
>>>>>>> Hmmm... very strange behaviour, it will be hard to find the source of
>>>>>>> the problem. Maybe it is related to new ContainerHolder and how Resin
>>>>>>> is managing threads - but I'm not sure :\
>>>>>>> 
>>>>>>> 
>>>>>>> Regards
>>>>>>> --
>>>>>>> Łukasz
>>>>>>> + 48 606 323 122 http://www.lenart.org.pl/
>>>>>>> 
>>>>>>> ---------------------------------------------------------------------
>>>>>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>>>>>> For additional commands, e-mail: user-help@struts.apache.org
>>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> ---------------------------------------------------------------------
>>>>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>>>>> For additional commands, e-mail: user-help@struts.apache.org
>>>>>> 
>>>>> 
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>>>> For additional commands, e-mail: user-help@struts.apache.org
>>>>> 
>>>> 
>>>> 
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>>> For additional commands, e-mail: user-help@struts.apache.org
>>>> 
>>> 
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>> For additional commands, e-mail: user-help@struts.apache.org
>>> 
>> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 


Re: s:action tag showing result

Posted by Lukasz Lenart <lu...@apache.org>.
Username?

2013/6/27 Felipe Lorenz <fe...@idealogic.com.br>:
> Sure!
>
> I have created an user at jira, but I think I dont have permissions to open a new issue. Or am I in the wrong place? :)
>
>
> Felipe Lorenz
>
> Em 27/06/2013, às 03:11, Lukasz Lenart escreveu:
>
>> Thanks Felipe!
>>
>> I think we must extend RestActionProxyFactory to also add exclude list
>> of namespaces, eg. "/ajax,/login", thus will allow to work in your
>> configuration.
>>
>> Could you register an issue?
>>
>>
>> Thanks in advance
>> --
>> Łukasz
>> + 48 606 323 122 http://www.lenart.org.pl/
>>
>> 2013/6/26 Felipe Lorenz <fe...@idealogic.com.br>:
>>> Hi Lukasz,
>>>
>>> I could identify one plugin wich could be creating this behaviour, the rest plugin.
>>>
>>>
>>> Since I have this configuration:
>>>>> <constant name="struts.mapper.class" value="org.apache.struts2.dispatcher.mapper.PrefixBasedActionMapper"/>
>>>>> <constant name="struts.mapper.prefixMapping" value=":rest,/ajax:struts,/login:struts"/>
>>>
>>>
>>> I expect that, when I request the following url http://xxxxxxxxxxx.com/ajax/anyThingHere, struts should handle this call. But instead, RestActionProxyFactory is handle this call.
>>>
>>> But the RestActionProxyFactory class has a if, and every time the namespace attribute is injected with "/ajax" value. So the condition always is redirect to the rest plugin handler and not to the struts default.
>>>
>>> Here is my ActionProxyFactory implementation:
>>>
>>> public class CustomActionProxyFactory extends RestActionProxyFactory {
>>>
>>>        @Override
>>>        public ActionProxy createActionProxy(String namespace, String actionName, String methodName, Map<String, Object> extraContext, boolean executeResult, boolean cleanupContext) {
>>>                RestActionProxyFactory p = new RestActionProxyFactory();
>>>                p.setContainer(container);
>>>                if ("/ajax".equals(namespace)) {
>>>                        p.setNamespace("/idealogic");
>>>                }
>>>
>>>                return p.createActionProxy(namespace, actionName, methodName, extraContext, executeResult, cleanupContext);
>>>        }
>>> }
>>>
>>> By some reason, it fixed the origin behaviour.
>>>
>>> I hope it could help you.
>>>
>>> Thanks,
>>> Felipe Lorenz
>>>
>>> Em 26/06/2013, às 04:45, Lukasz Lenart escreveu:
>>>
>>>> As I understand you use <s:action executeResult="false"/> ? Which
>>>> means result named "json" shouldn't be executed, you can even remove
>>>> it.
>>>>
>>>>
>>>> Regards
>>>> --
>>>> Łukasz
>>>> + 48 606 323 122 http://www.lenart.org.pl/
>>>>
>>>> 2013/6/22 Felipe Lorenz <fe...@idealogic.com.br>:
>>>>> Hello Lukasz,
>>>>>
>>>>> I still facing this behaviour. Even with 2.3.16-SNAPSHOT.
>>>>>
>>>>> One thing that make me thing, was the flush attribute. When it is true, the json result (the string) appear in the position where the action tag is in the jsp. But, when I change it to false, the result appears in the top os my page.
>>>>>
>>>>> One workaround that I can use is return a result name that is no defined in the struts.xml. This workaround throw an exception, since struts could no find my result name, but my list is populated and no result from this action tag appear in my page.
>>>>>
>>>>> I hope this information can help.
>>>>>
>>>>> Also, I am printing my config:
>>>>>
>>>>> struts.xml:
>>>>>
>>>>> <?xml version="1.0" encoding="UTF-8" ?>
>>>>> <!DOCTYPE struts PUBLIC
>>>>>       "-//Apache Software Foundation//DTD Struts Configuration 2.3//EN"
>>>>>       "http://struts.apache.org/dtds/struts-2.3.dtd">
>>>>> <struts order="10">
>>>>>       <constant name="struts.devMode" value="false" />
>>>>>       <constant name="struts.action.extension" value=",json,xhtml,xml"/>
>>>>>
>>>>>       <constant name="struts.convention.action.mapAllMatches" value="true" />
>>>>>       <constant name="struts.convention.default.parent.package" value="default"/>
>>>>>
>>>>>       <constant name="struts.custom.i18n.resources" value="global" />
>>>>>
>>>>>       <constant name="struts.mapper.class" value="org.apache.struts2.dispatcher.mapper.PrefixBasedActionMapper"/>
>>>>>       <constant name="struts.mapper.prefixMapping" value=":rest,/ajax:struts,/login:struts"/>
>>>>>
>>>>>       <package name="default" extends="rest-default">
>>>>>
>>>>>               <interceptors>
>>>>>                       <interceptor class="br.com.idealogic.interceptor.LoginInterceptor" name="login"/>
>>>>>                       <interceptor class="br.com.idealogic.interceptor.PermissaoInterceptor" name="permissao"/>
>>>>>                       <interceptor class="br.com.idealogic.interceptor.I18nInterceptor" name="idioma"/>
>>>>>                       <interceptor class="br.com.idealogic.interceptor.JPAInterceptor" name="jpa"/>
>>>>>                       <interceptor-stack name="jpaStack">
>>>>>                               <interceptor-ref name="login"/>
>>>>>                               <interceptor-ref name="permissao"/>
>>>>>                               <interceptor-ref name="idioma"/>
>>>>>                               <interceptor-ref name="jpa"/>
>>>>>                               <interceptor-ref name="restDefaultStack"/>
>>>>>                       </interceptor-stack>
>>>>>               </interceptors>
>>>>>               <default-interceptor-ref name="jpaStack"/>
>>>>>
>>>>>
>>>>>               <default-action-ref name="login_sistema"></default-action-ref>
>>>>>
>>>>>               <global-results>
>>>>>                       <result name="login">/login.jsp</result>
>>>>>                       <result name="forbidden">/forbidden.jsp</result>
>>>>>               </global-results>
>>>>>
>>>>>       </package>
>>>>>
>>>>>       <include file="struts-ajax.xml"/>
>>>>>       <include file="struts-login.xml"/>
>>>>>       <include file="struts-filtro.xml"/>
>>>>> </struts>
>>>>>
>>>>> struts-ajax.xml
>>>>>
>>>>> <?xml version="1.0" encoding="UTF-8"?>
>>>>> <!DOCTYPE struts PUBLIC
>>>>> "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
>>>>> "http://struts.apache.org/dtds/struts-2.0.dtd">
>>>>> <struts>
>>>>>       <package name="ajax" extends="json-default" namespace="/ajax">
>>>>>               <interceptors>
>>>>>                       <interceptor class="br.com.idealogic.interceptor.JPAInterceptor" name="jpa"/>
>>>>>                       <interceptor-stack name="jpaJsonStack">
>>>>>                               <interceptor-ref name="jpa"/>
>>>>>                               <interceptor-ref name="jsonValidationWorkflowStack"/>
>>>>>                       </interceptor-stack>
>>>>>               </interceptors>
>>>>>               <default-interceptor-ref name="jpaJsonStack"/>
>>>>>
>>>>>
>>>>>               <action name="loadCidadeByEstado" method="loadCidadeByEstado" class="br.com.seedingControl.action.CidadeAction">
>>>>>                       <result name="json" type="json">
>>>>>                               <param name="includeProperties">
>>>>>                                       ^cidades\[\d+\]\.idCidade,
>>>>>                                       ^cidades\[\d+\]\.nmCidade
>>>>>                               </param>
>>>>>                       </result>
>>>>>               </action>
>>>>>
>>>>>       </package>
>>>>> </struts>
>>>>>
>>>>> Thanks for all your help!
>>>>>
>>>>> Felipe Lorenz
>>>>>
>>>>> Em 22/06/2013, às 04:27, Lukasz Lenart escreveu:
>>>>>
>>>>>> 2013/6/22 Litman, Bruno <bl...@alabamainteractive.org>:
>>>>>>> We are also experiencing issues with tags and theme files, we are upgrading many applications from 2.3.4.1 to 2.3.14.3
>>>>>>> I am not sure if this is related - if not and if I need to start a new discussion please let me know and accept my apology.
>>>>>>>
>>>>>>> 1/
>>>>>>>
>>>>>>> We previously always coded forms as :
>>>>>>>      <s:form action="login" namespace="/">....
>>>>>>> Now randomly, this fails to generate the proper action url in the html (it is missing the '.action', which results in a 404 once you post the form)
>>>>>>>
>>>>>>> The only workaround we have found so far is to add the '.action' suffix to the s:form's action attribute. Before it was always added for us by struts.
>>>>>>> So now we are having success with
>>>>>>>      <s:form action="login.action" namespace="/">...
>>>>>>>
>>>>>>> Is this expected behavior? Did this change recently? 2.3.4.1 is not so ancient..
>>>>>>
>>>>>> No, it isn't - mainly a bug - Struts should add suffix for you, you
>>>>>> basically use the same action names as defined in struts.xml. This is
>>>>>> very strange, I have just tested with struts2-blank on Jetty and
>>>>>> suffix was there. Could you share more details about the config?
>>>>>>
>>>>>>> 2/
>>>>>>>
>>>>>>> We are trying to replace the "required" attribute in the textfields with "requiredLabel" without success. Was the xhtml theme's ftl file "controlheader_core" updated to reflect the changes in the struts-tags.tld (requiredLabel replaced required)?
>>>>>>
>>>>>> You are right, it is bug :\ Please fill an issue
>>>>>>
>>>>>>> Also, it seems applications are randomly serving ftl files from other applications' theme folders with the same name.
>>>>>>> This was demonstrated by modifying something obvious in one application's ftl file (displaying some text next to a text field's label), and the effect can be seen randomly on other applications which shouldn’t even see that application's template folder (the themes are however named the same in both applications)
>>>>>>> I am only able to make the "requiredLabel" attribute work if placed in a <s:param> tag as opposed to being just an attribute of the s:textfield tag, but even so it is still not always using the same ftl files (however always from similarly named themes placed inside each application)
>>>>>>>
>>>>>>> This is extremely confusing. Is FreeMarker caching files independently of the application? Is the app container interfering with caching? (We are using Resin 4.0.36)
>>>>>>
>>>>>> Hmmm... very strange behaviour, it will be hard to find the source of
>>>>>> the problem. Maybe it is related to new ContainerHolder and how Resin
>>>>>> is managing threads - but I'm not sure :\
>>>>>>
>>>>>>
>>>>>> Regards
>>>>>> --
>>>>>> Łukasz
>>>>>> + 48 606 323 122 http://www.lenart.org.pl/
>>>>>>
>>>>>> ---------------------------------------------------------------------
>>>>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>>>>> For additional commands, e-mail: user-help@struts.apache.org
>>>>>>
>>>>>
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>>>> For additional commands, e-mail: user-help@struts.apache.org
>>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>>> For additional commands, e-mail: user-help@struts.apache.org
>>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>> For additional commands, e-mail: user-help@struts.apache.org
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>

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


Re: s:action tag showing result

Posted by Felipe Lorenz <fe...@idealogic.com.br>.
Sure!

I have created an user at jira, but I think I dont have permissions to open a new issue. Or am I in the wrong place? :)


Felipe Lorenz

Em 27/06/2013, às 03:11, Lukasz Lenart escreveu:

> Thanks Felipe!
> 
> I think we must extend RestActionProxyFactory to also add exclude list
> of namespaces, eg. "/ajax,/login", thus will allow to work in your
> configuration.
> 
> Could you register an issue?
> 
> 
> Thanks in advance
> -- 
> Łukasz
> + 48 606 323 122 http://www.lenart.org.pl/
> 
> 2013/6/26 Felipe Lorenz <fe...@idealogic.com.br>:
>> Hi Lukasz,
>> 
>> I could identify one plugin wich could be creating this behaviour, the rest plugin.
>> 
>> 
>> Since I have this configuration:
>>>> <constant name="struts.mapper.class" value="org.apache.struts2.dispatcher.mapper.PrefixBasedActionMapper"/>
>>>> <constant name="struts.mapper.prefixMapping" value=":rest,/ajax:struts,/login:struts"/>
>> 
>> 
>> I expect that, when I request the following url http://xxxxxxxxxxx.com/ajax/anyThingHere, struts should handle this call. But instead, RestActionProxyFactory is handle this call.
>> 
>> But the RestActionProxyFactory class has a if, and every time the namespace attribute is injected with "/ajax" value. So the condition always is redirect to the rest plugin handler and not to the struts default.
>> 
>> Here is my ActionProxyFactory implementation:
>> 
>> public class CustomActionProxyFactory extends RestActionProxyFactory {
>> 
>>        @Override
>>        public ActionProxy createActionProxy(String namespace, String actionName, String methodName, Map<String, Object> extraContext, boolean executeResult, boolean cleanupContext) {
>>                RestActionProxyFactory p = new RestActionProxyFactory();
>>                p.setContainer(container);
>>                if ("/ajax".equals(namespace)) {
>>                        p.setNamespace("/idealogic");
>>                }
>> 
>>                return p.createActionProxy(namespace, actionName, methodName, extraContext, executeResult, cleanupContext);
>>        }
>> }
>> 
>> By some reason, it fixed the origin behaviour.
>> 
>> I hope it could help you.
>> 
>> Thanks,
>> Felipe Lorenz
>> 
>> Em 26/06/2013, às 04:45, Lukasz Lenart escreveu:
>> 
>>> As I understand you use <s:action executeResult="false"/> ? Which
>>> means result named "json" shouldn't be executed, you can even remove
>>> it.
>>> 
>>> 
>>> Regards
>>> --
>>> Łukasz
>>> + 48 606 323 122 http://www.lenart.org.pl/
>>> 
>>> 2013/6/22 Felipe Lorenz <fe...@idealogic.com.br>:
>>>> Hello Lukasz,
>>>> 
>>>> I still facing this behaviour. Even with 2.3.16-SNAPSHOT.
>>>> 
>>>> One thing that make me thing, was the flush attribute. When it is true, the json result (the string) appear in the position where the action tag is in the jsp. But, when I change it to false, the result appears in the top os my page.
>>>> 
>>>> One workaround that I can use is return a result name that is no defined in the struts.xml. This workaround throw an exception, since struts could no find my result name, but my list is populated and no result from this action tag appear in my page.
>>>> 
>>>> I hope this information can help.
>>>> 
>>>> Also, I am printing my config:
>>>> 
>>>> struts.xml:
>>>> 
>>>> <?xml version="1.0" encoding="UTF-8" ?>
>>>> <!DOCTYPE struts PUBLIC
>>>>       "-//Apache Software Foundation//DTD Struts Configuration 2.3//EN"
>>>>       "http://struts.apache.org/dtds/struts-2.3.dtd">
>>>> <struts order="10">
>>>>       <constant name="struts.devMode" value="false" />
>>>>       <constant name="struts.action.extension" value=",json,xhtml,xml"/>
>>>> 
>>>>       <constant name="struts.convention.action.mapAllMatches" value="true" />
>>>>       <constant name="struts.convention.default.parent.package" value="default"/>
>>>> 
>>>>       <constant name="struts.custom.i18n.resources" value="global" />
>>>> 
>>>>       <constant name="struts.mapper.class" value="org.apache.struts2.dispatcher.mapper.PrefixBasedActionMapper"/>
>>>>       <constant name="struts.mapper.prefixMapping" value=":rest,/ajax:struts,/login:struts"/>
>>>> 
>>>>       <package name="default" extends="rest-default">
>>>> 
>>>>               <interceptors>
>>>>                       <interceptor class="br.com.idealogic.interceptor.LoginInterceptor" name="login"/>
>>>>                       <interceptor class="br.com.idealogic.interceptor.PermissaoInterceptor" name="permissao"/>
>>>>                       <interceptor class="br.com.idealogic.interceptor.I18nInterceptor" name="idioma"/>
>>>>                       <interceptor class="br.com.idealogic.interceptor.JPAInterceptor" name="jpa"/>
>>>>                       <interceptor-stack name="jpaStack">
>>>>                               <interceptor-ref name="login"/>
>>>>                               <interceptor-ref name="permissao"/>
>>>>                               <interceptor-ref name="idioma"/>
>>>>                               <interceptor-ref name="jpa"/>
>>>>                               <interceptor-ref name="restDefaultStack"/>
>>>>                       </interceptor-stack>
>>>>               </interceptors>
>>>>               <default-interceptor-ref name="jpaStack"/>
>>>> 
>>>> 
>>>>               <default-action-ref name="login_sistema"></default-action-ref>
>>>> 
>>>>               <global-results>
>>>>                       <result name="login">/login.jsp</result>
>>>>                       <result name="forbidden">/forbidden.jsp</result>
>>>>               </global-results>
>>>> 
>>>>       </package>
>>>> 
>>>>       <include file="struts-ajax.xml"/>
>>>>       <include file="struts-login.xml"/>
>>>>       <include file="struts-filtro.xml"/>
>>>> </struts>
>>>> 
>>>> struts-ajax.xml
>>>> 
>>>> <?xml version="1.0" encoding="UTF-8"?>
>>>> <!DOCTYPE struts PUBLIC
>>>> "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
>>>> "http://struts.apache.org/dtds/struts-2.0.dtd">
>>>> <struts>
>>>>       <package name="ajax" extends="json-default" namespace="/ajax">
>>>>               <interceptors>
>>>>                       <interceptor class="br.com.idealogic.interceptor.JPAInterceptor" name="jpa"/>
>>>>                       <interceptor-stack name="jpaJsonStack">
>>>>                               <interceptor-ref name="jpa"/>
>>>>                               <interceptor-ref name="jsonValidationWorkflowStack"/>
>>>>                       </interceptor-stack>
>>>>               </interceptors>
>>>>               <default-interceptor-ref name="jpaJsonStack"/>
>>>> 
>>>> 
>>>>               <action name="loadCidadeByEstado" method="loadCidadeByEstado" class="br.com.seedingControl.action.CidadeAction">
>>>>                       <result name="json" type="json">
>>>>                               <param name="includeProperties">
>>>>                                       ^cidades\[\d+\]\.idCidade,
>>>>                                       ^cidades\[\d+\]\.nmCidade
>>>>                               </param>
>>>>                       </result>
>>>>               </action>
>>>> 
>>>>       </package>
>>>> </struts>
>>>> 
>>>> Thanks for all your help!
>>>> 
>>>> Felipe Lorenz
>>>> 
>>>> Em 22/06/2013, às 04:27, Lukasz Lenart escreveu:
>>>> 
>>>>> 2013/6/22 Litman, Bruno <bl...@alabamainteractive.org>:
>>>>>> We are also experiencing issues with tags and theme files, we are upgrading many applications from 2.3.4.1 to 2.3.14.3
>>>>>> I am not sure if this is related - if not and if I need to start a new discussion please let me know and accept my apology.
>>>>>> 
>>>>>> 1/
>>>>>> 
>>>>>> We previously always coded forms as :
>>>>>>      <s:form action="login" namespace="/">....
>>>>>> Now randomly, this fails to generate the proper action url in the html (it is missing the '.action', which results in a 404 once you post the form)
>>>>>> 
>>>>>> The only workaround we have found so far is to add the '.action' suffix to the s:form's action attribute. Before it was always added for us by struts.
>>>>>> So now we are having success with
>>>>>>      <s:form action="login.action" namespace="/">...
>>>>>> 
>>>>>> Is this expected behavior? Did this change recently? 2.3.4.1 is not so ancient..
>>>>> 
>>>>> No, it isn't - mainly a bug - Struts should add suffix for you, you
>>>>> basically use the same action names as defined in struts.xml. This is
>>>>> very strange, I have just tested with struts2-blank on Jetty and
>>>>> suffix was there. Could you share more details about the config?
>>>>> 
>>>>>> 2/
>>>>>> 
>>>>>> We are trying to replace the "required" attribute in the textfields with "requiredLabel" without success. Was the xhtml theme's ftl file "controlheader_core" updated to reflect the changes in the struts-tags.tld (requiredLabel replaced required)?
>>>>> 
>>>>> You are right, it is bug :\ Please fill an issue
>>>>> 
>>>>>> Also, it seems applications are randomly serving ftl files from other applications' theme folders with the same name.
>>>>>> This was demonstrated by modifying something obvious in one application's ftl file (displaying some text next to a text field's label), and the effect can be seen randomly on other applications which shouldn’t even see that application's template folder (the themes are however named the same in both applications)
>>>>>> I am only able to make the "requiredLabel" attribute work if placed in a <s:param> tag as opposed to being just an attribute of the s:textfield tag, but even so it is still not always using the same ftl files (however always from similarly named themes placed inside each application)
>>>>>> 
>>>>>> This is extremely confusing. Is FreeMarker caching files independently of the application? Is the app container interfering with caching? (We are using Resin 4.0.36)
>>>>> 
>>>>> Hmmm... very strange behaviour, it will be hard to find the source of
>>>>> the problem. Maybe it is related to new ContainerHolder and how Resin
>>>>> is managing threads - but I'm not sure :\
>>>>> 
>>>>> 
>>>>> Regards
>>>>> --
>>>>> Łukasz
>>>>> + 48 606 323 122 http://www.lenart.org.pl/
>>>>> 
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>>>> For additional commands, e-mail: user-help@struts.apache.org
>>>>> 
>>>> 
>>>> 
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>>> For additional commands, e-mail: user-help@struts.apache.org
>>>> 
>>> 
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>> For additional commands, e-mail: user-help@struts.apache.org
>>> 
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 


Re: s:action tag showing result

Posted by Lukasz Lenart <lu...@apache.org>.
Thanks Felipe!

I think we must extend RestActionProxyFactory to also add exclude list
of namespaces, eg. "/ajax,/login", thus will allow to work in your
configuration.

Could you register an issue?


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

2013/6/26 Felipe Lorenz <fe...@idealogic.com.br>:
> Hi Lukasz,
>
> I could identify one plugin wich could be creating this behaviour, the rest plugin.
>
>
> Since I have this configuration:
>>> <constant name="struts.mapper.class" value="org.apache.struts2.dispatcher.mapper.PrefixBasedActionMapper"/>
>>> <constant name="struts.mapper.prefixMapping" value=":rest,/ajax:struts,/login:struts"/>
>
>
> I expect that, when I request the following url http://xxxxxxxxxxx.com/ajax/anyThingHere, struts should handle this call. But instead, RestActionProxyFactory is handle this call.
>
> But the RestActionProxyFactory class has a if, and every time the namespace attribute is injected with "/ajax" value. So the condition always is redirect to the rest plugin handler and not to the struts default.
>
> Here is my ActionProxyFactory implementation:
>
> public class CustomActionProxyFactory extends RestActionProxyFactory {
>
>         @Override
>         public ActionProxy createActionProxy(String namespace, String actionName, String methodName, Map<String, Object> extraContext, boolean executeResult, boolean cleanupContext) {
>                 RestActionProxyFactory p = new RestActionProxyFactory();
>                 p.setContainer(container);
>                 if ("/ajax".equals(namespace)) {
>                         p.setNamespace("/idealogic");
>                 }
>
>                 return p.createActionProxy(namespace, actionName, methodName, extraContext, executeResult, cleanupContext);
>         }
> }
>
> By some reason, it fixed the origin behaviour.
>
> I hope it could help you.
>
> Thanks,
> Felipe Lorenz
>
> Em 26/06/2013, às 04:45, Lukasz Lenart escreveu:
>
>> As I understand you use <s:action executeResult="false"/> ? Which
>> means result named "json" shouldn't be executed, you can even remove
>> it.
>>
>>
>> Regards
>> --
>> Łukasz
>> + 48 606 323 122 http://www.lenart.org.pl/
>>
>> 2013/6/22 Felipe Lorenz <fe...@idealogic.com.br>:
>>> Hello Lukasz,
>>>
>>> I still facing this behaviour. Even with 2.3.16-SNAPSHOT.
>>>
>>> One thing that make me thing, was the flush attribute. When it is true, the json result (the string) appear in the position where the action tag is in the jsp. But, when I change it to false, the result appears in the top os my page.
>>>
>>> One workaround that I can use is return a result name that is no defined in the struts.xml. This workaround throw an exception, since struts could no find my result name, but my list is populated and no result from this action tag appear in my page.
>>>
>>> I hope this information can help.
>>>
>>> Also, I am printing my config:
>>>
>>> struts.xml:
>>>
>>> <?xml version="1.0" encoding="UTF-8" ?>
>>> <!DOCTYPE struts PUBLIC
>>>        "-//Apache Software Foundation//DTD Struts Configuration 2.3//EN"
>>>        "http://struts.apache.org/dtds/struts-2.3.dtd">
>>> <struts order="10">
>>>        <constant name="struts.devMode" value="false" />
>>>        <constant name="struts.action.extension" value=",json,xhtml,xml"/>
>>>
>>>        <constant name="struts.convention.action.mapAllMatches" value="true" />
>>>        <constant name="struts.convention.default.parent.package" value="default"/>
>>>
>>>        <constant name="struts.custom.i18n.resources" value="global" />
>>>
>>>        <constant name="struts.mapper.class" value="org.apache.struts2.dispatcher.mapper.PrefixBasedActionMapper"/>
>>>        <constant name="struts.mapper.prefixMapping" value=":rest,/ajax:struts,/login:struts"/>
>>>
>>>        <package name="default" extends="rest-default">
>>>
>>>                <interceptors>
>>>                        <interceptor class="br.com.idealogic.interceptor.LoginInterceptor" name="login"/>
>>>                        <interceptor class="br.com.idealogic.interceptor.PermissaoInterceptor" name="permissao"/>
>>>                        <interceptor class="br.com.idealogic.interceptor.I18nInterceptor" name="idioma"/>
>>>                        <interceptor class="br.com.idealogic.interceptor.JPAInterceptor" name="jpa"/>
>>>                        <interceptor-stack name="jpaStack">
>>>                                <interceptor-ref name="login"/>
>>>                                <interceptor-ref name="permissao"/>
>>>                                <interceptor-ref name="idioma"/>
>>>                                <interceptor-ref name="jpa"/>
>>>                                <interceptor-ref name="restDefaultStack"/>
>>>                        </interceptor-stack>
>>>                </interceptors>
>>>                <default-interceptor-ref name="jpaStack"/>
>>>
>>>
>>>                <default-action-ref name="login_sistema"></default-action-ref>
>>>
>>>                <global-results>
>>>                        <result name="login">/login.jsp</result>
>>>                        <result name="forbidden">/forbidden.jsp</result>
>>>                </global-results>
>>>
>>>        </package>
>>>
>>>        <include file="struts-ajax.xml"/>
>>>        <include file="struts-login.xml"/>
>>>        <include file="struts-filtro.xml"/>
>>> </struts>
>>>
>>> struts-ajax.xml
>>>
>>> <?xml version="1.0" encoding="UTF-8"?>
>>> <!DOCTYPE struts PUBLIC
>>> "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
>>> "http://struts.apache.org/dtds/struts-2.0.dtd">
>>> <struts>
>>>        <package name="ajax" extends="json-default" namespace="/ajax">
>>>                <interceptors>
>>>                        <interceptor class="br.com.idealogic.interceptor.JPAInterceptor" name="jpa"/>
>>>                        <interceptor-stack name="jpaJsonStack">
>>>                                <interceptor-ref name="jpa"/>
>>>                                <interceptor-ref name="jsonValidationWorkflowStack"/>
>>>                        </interceptor-stack>
>>>                </interceptors>
>>>                <default-interceptor-ref name="jpaJsonStack"/>
>>>
>>>
>>>                <action name="loadCidadeByEstado" method="loadCidadeByEstado" class="br.com.seedingControl.action.CidadeAction">
>>>                        <result name="json" type="json">
>>>                                <param name="includeProperties">
>>>                                        ^cidades\[\d+\]\.idCidade,
>>>                                        ^cidades\[\d+\]\.nmCidade
>>>                                </param>
>>>                        </result>
>>>                </action>
>>>
>>>        </package>
>>> </struts>
>>>
>>> Thanks for all your help!
>>>
>>> Felipe Lorenz
>>>
>>> Em 22/06/2013, às 04:27, Lukasz Lenart escreveu:
>>>
>>>> 2013/6/22 Litman, Bruno <bl...@alabamainteractive.org>:
>>>>> We are also experiencing issues with tags and theme files, we are upgrading many applications from 2.3.4.1 to 2.3.14.3
>>>>> I am not sure if this is related - if not and if I need to start a new discussion please let me know and accept my apology.
>>>>>
>>>>> 1/
>>>>>
>>>>> We previously always coded forms as :
>>>>>       <s:form action="login" namespace="/">....
>>>>> Now randomly, this fails to generate the proper action url in the html (it is missing the '.action', which results in a 404 once you post the form)
>>>>>
>>>>> The only workaround we have found so far is to add the '.action' suffix to the s:form's action attribute. Before it was always added for us by struts.
>>>>> So now we are having success with
>>>>>       <s:form action="login.action" namespace="/">...
>>>>>
>>>>> Is this expected behavior? Did this change recently? 2.3.4.1 is not so ancient..
>>>>
>>>> No, it isn't - mainly a bug - Struts should add suffix for you, you
>>>> basically use the same action names as defined in struts.xml. This is
>>>> very strange, I have just tested with struts2-blank on Jetty and
>>>> suffix was there. Could you share more details about the config?
>>>>
>>>>> 2/
>>>>>
>>>>> We are trying to replace the "required" attribute in the textfields with "requiredLabel" without success. Was the xhtml theme's ftl file "controlheader_core" updated to reflect the changes in the struts-tags.tld (requiredLabel replaced required)?
>>>>
>>>> You are right, it is bug :\ Please fill an issue
>>>>
>>>>> Also, it seems applications are randomly serving ftl files from other applications' theme folders with the same name.
>>>>> This was demonstrated by modifying something obvious in one application's ftl file (displaying some text next to a text field's label), and the effect can be seen randomly on other applications which shouldn’t even see that application's template folder (the themes are however named the same in both applications)
>>>>> I am only able to make the "requiredLabel" attribute work if placed in a <s:param> tag as opposed to being just an attribute of the s:textfield tag, but even so it is still not always using the same ftl files (however always from similarly named themes placed inside each application)
>>>>>
>>>>> This is extremely confusing. Is FreeMarker caching files independently of the application? Is the app container interfering with caching? (We are using Resin 4.0.36)
>>>>
>>>> Hmmm... very strange behaviour, it will be hard to find the source of
>>>> the problem. Maybe it is related to new ContainerHolder and how Resin
>>>> is managing threads - but I'm not sure :\
>>>>
>>>>
>>>> Regards
>>>> --
>>>> Łukasz
>>>> + 48 606 323 122 http://www.lenart.org.pl/
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>>> For additional commands, e-mail: user-help@struts.apache.org
>>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>> For additional commands, e-mail: user-help@struts.apache.org
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>

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


Re: s:action tag showing result

Posted by Felipe Lorenz <fe...@idealogic.com.br>.
Hi Lukasz,

I could identify one plugin wich could be creating this behaviour, the rest plugin.


Since I have this configuration:
>> <constant name="struts.mapper.class" value="org.apache.struts2.dispatcher.mapper.PrefixBasedActionMapper"/>
>> <constant name="struts.mapper.prefixMapping" value=":rest,/ajax:struts,/login:struts"/>


I expect that, when I request the following url http://xxxxxxxxxxx.com/ajax/anyThingHere, struts should handle this call. But instead, RestActionProxyFactory is handle this call.

But the RestActionProxyFactory class has a if, and every time the namespace attribute is injected with "/ajax" value. So the condition always is redirect to the rest plugin handler and not to the struts default.

Here is my ActionProxyFactory implementation:

public class CustomActionProxyFactory extends RestActionProxyFactory {

	@Override
	public ActionProxy createActionProxy(String namespace, String actionName, String methodName, Map<String, Object> extraContext, boolean executeResult, boolean cleanupContext) {
		RestActionProxyFactory p = new RestActionProxyFactory();
		p.setContainer(container);
		if ("/ajax".equals(namespace)) {
			p.setNamespace("/idealogic");
		}

		return p.createActionProxy(namespace, actionName, methodName, extraContext, executeResult, cleanupContext);
	}
}

By some reason, it fixed the origin behaviour.

I hope it could help you.

Thanks,
Felipe Lorenz

Em 26/06/2013, às 04:45, Lukasz Lenart escreveu:

> As I understand you use <s:action executeResult="false"/> ? Which
> means result named "json" shouldn't be executed, you can even remove
> it.
> 
> 
> Regards
> -- 
> Łukasz
> + 48 606 323 122 http://www.lenart.org.pl/
> 
> 2013/6/22 Felipe Lorenz <fe...@idealogic.com.br>:
>> Hello Lukasz,
>> 
>> I still facing this behaviour. Even with 2.3.16-SNAPSHOT.
>> 
>> One thing that make me thing, was the flush attribute. When it is true, the json result (the string) appear in the position where the action tag is in the jsp. But, when I change it to false, the result appears in the top os my page.
>> 
>> One workaround that I can use is return a result name that is no defined in the struts.xml. This workaround throw an exception, since struts could no find my result name, but my list is populated and no result from this action tag appear in my page.
>> 
>> I hope this information can help.
>> 
>> Also, I am printing my config:
>> 
>> struts.xml:
>> 
>> <?xml version="1.0" encoding="UTF-8" ?>
>> <!DOCTYPE struts PUBLIC
>>        "-//Apache Software Foundation//DTD Struts Configuration 2.3//EN"
>>        "http://struts.apache.org/dtds/struts-2.3.dtd">
>> <struts order="10">
>>        <constant name="struts.devMode" value="false" />
>>        <constant name="struts.action.extension" value=",json,xhtml,xml"/>
>> 
>>        <constant name="struts.convention.action.mapAllMatches" value="true" />
>>        <constant name="struts.convention.default.parent.package" value="default"/>
>> 
>>        <constant name="struts.custom.i18n.resources" value="global" />
>> 
>>        <constant name="struts.mapper.class" value="org.apache.struts2.dispatcher.mapper.PrefixBasedActionMapper"/>
>>        <constant name="struts.mapper.prefixMapping" value=":rest,/ajax:struts,/login:struts"/>
>> 
>>        <package name="default" extends="rest-default">
>> 
>>                <interceptors>
>>                        <interceptor class="br.com.idealogic.interceptor.LoginInterceptor" name="login"/>
>>                        <interceptor class="br.com.idealogic.interceptor.PermissaoInterceptor" name="permissao"/>
>>                        <interceptor class="br.com.idealogic.interceptor.I18nInterceptor" name="idioma"/>
>>                        <interceptor class="br.com.idealogic.interceptor.JPAInterceptor" name="jpa"/>
>>                        <interceptor-stack name="jpaStack">
>>                                <interceptor-ref name="login"/>
>>                                <interceptor-ref name="permissao"/>
>>                                <interceptor-ref name="idioma"/>
>>                                <interceptor-ref name="jpa"/>
>>                                <interceptor-ref name="restDefaultStack"/>
>>                        </interceptor-stack>
>>                </interceptors>
>>                <default-interceptor-ref name="jpaStack"/>
>> 
>> 
>>                <default-action-ref name="login_sistema"></default-action-ref>
>> 
>>                <global-results>
>>                        <result name="login">/login.jsp</result>
>>                        <result name="forbidden">/forbidden.jsp</result>
>>                </global-results>
>> 
>>        </package>
>> 
>>        <include file="struts-ajax.xml"/>
>>        <include file="struts-login.xml"/>
>>        <include file="struts-filtro.xml"/>
>> </struts>
>> 
>> struts-ajax.xml
>> 
>> <?xml version="1.0" encoding="UTF-8"?>
>> <!DOCTYPE struts PUBLIC
>> "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
>> "http://struts.apache.org/dtds/struts-2.0.dtd">
>> <struts>
>>        <package name="ajax" extends="json-default" namespace="/ajax">
>>                <interceptors>
>>                        <interceptor class="br.com.idealogic.interceptor.JPAInterceptor" name="jpa"/>
>>                        <interceptor-stack name="jpaJsonStack">
>>                                <interceptor-ref name="jpa"/>
>>                                <interceptor-ref name="jsonValidationWorkflowStack"/>
>>                        </interceptor-stack>
>>                </interceptors>
>>                <default-interceptor-ref name="jpaJsonStack"/>
>> 
>> 
>>                <action name="loadCidadeByEstado" method="loadCidadeByEstado" class="br.com.seedingControl.action.CidadeAction">
>>                        <result name="json" type="json">
>>                                <param name="includeProperties">
>>                                        ^cidades\[\d+\]\.idCidade,
>>                                        ^cidades\[\d+\]\.nmCidade
>>                                </param>
>>                        </result>
>>                </action>
>> 
>>        </package>
>> </struts>
>> 
>> Thanks for all your help!
>> 
>> Felipe Lorenz
>> 
>> Em 22/06/2013, às 04:27, Lukasz Lenart escreveu:
>> 
>>> 2013/6/22 Litman, Bruno <bl...@alabamainteractive.org>:
>>>> We are also experiencing issues with tags and theme files, we are upgrading many applications from 2.3.4.1 to 2.3.14.3
>>>> I am not sure if this is related - if not and if I need to start a new discussion please let me know and accept my apology.
>>>> 
>>>> 1/
>>>> 
>>>> We previously always coded forms as :
>>>>       <s:form action="login" namespace="/">....
>>>> Now randomly, this fails to generate the proper action url in the html (it is missing the '.action', which results in a 404 once you post the form)
>>>> 
>>>> The only workaround we have found so far is to add the '.action' suffix to the s:form's action attribute. Before it was always added for us by struts.
>>>> So now we are having success with
>>>>       <s:form action="login.action" namespace="/">...
>>>> 
>>>> Is this expected behavior? Did this change recently? 2.3.4.1 is not so ancient..
>>> 
>>> No, it isn't - mainly a bug - Struts should add suffix for you, you
>>> basically use the same action names as defined in struts.xml. This is
>>> very strange, I have just tested with struts2-blank on Jetty and
>>> suffix was there. Could you share more details about the config?
>>> 
>>>> 2/
>>>> 
>>>> We are trying to replace the "required" attribute in the textfields with "requiredLabel" without success. Was the xhtml theme's ftl file "controlheader_core" updated to reflect the changes in the struts-tags.tld (requiredLabel replaced required)?
>>> 
>>> You are right, it is bug :\ Please fill an issue
>>> 
>>>> Also, it seems applications are randomly serving ftl files from other applications' theme folders with the same name.
>>>> This was demonstrated by modifying something obvious in one application's ftl file (displaying some text next to a text field's label), and the effect can be seen randomly on other applications which shouldn’t even see that application's template folder (the themes are however named the same in both applications)
>>>> I am only able to make the "requiredLabel" attribute work if placed in a <s:param> tag as opposed to being just an attribute of the s:textfield tag, but even so it is still not always using the same ftl files (however always from similarly named themes placed inside each application)
>>>> 
>>>> This is extremely confusing. Is FreeMarker caching files independently of the application? Is the app container interfering with caching? (We are using Resin 4.0.36)
>>> 
>>> Hmmm... very strange behaviour, it will be hard to find the source of
>>> the problem. Maybe it is related to new ContainerHolder and how Resin
>>> is managing threads - but I'm not sure :\
>>> 
>>> 
>>> Regards
>>> --
>>> Łukasz
>>> + 48 606 323 122 http://www.lenart.org.pl/
>>> 
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>> For additional commands, e-mail: user-help@struts.apache.org
>>> 
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 


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


Re: s:action tag showing result

Posted by Lukasz Lenart <lu...@apache.org>.
As I understand you use <s:action executeResult="false"/> ? Which
means result named "json" shouldn't be executed, you can even remove
it.


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

2013/6/22 Felipe Lorenz <fe...@idealogic.com.br>:
> Hello Lukasz,
>
> I still facing this behaviour. Even with 2.3.16-SNAPSHOT.
>
> One thing that make me thing, was the flush attribute. When it is true, the json result (the string) appear in the position where the action tag is in the jsp. But, when I change it to false, the result appears in the top os my page.
>
> One workaround that I can use is return a result name that is no defined in the struts.xml. This workaround throw an exception, since struts could no find my result name, but my list is populated and no result from this action tag appear in my page.
>
> I hope this information can help.
>
> Also, I am printing my config:
>
> struts.xml:
>
> <?xml version="1.0" encoding="UTF-8" ?>
> <!DOCTYPE struts PUBLIC
>         "-//Apache Software Foundation//DTD Struts Configuration 2.3//EN"
>         "http://struts.apache.org/dtds/struts-2.3.dtd">
> <struts order="10">
>         <constant name="struts.devMode" value="false" />
>         <constant name="struts.action.extension" value=",json,xhtml,xml"/>
>
>         <constant name="struts.convention.action.mapAllMatches" value="true" />
>         <constant name="struts.convention.default.parent.package" value="default"/>
>
>         <constant name="struts.custom.i18n.resources" value="global" />
>
>         <constant name="struts.mapper.class" value="org.apache.struts2.dispatcher.mapper.PrefixBasedActionMapper"/>
>         <constant name="struts.mapper.prefixMapping" value=":rest,/ajax:struts,/login:struts"/>
>
>         <package name="default" extends="rest-default">
>
>                 <interceptors>
>                         <interceptor class="br.com.idealogic.interceptor.LoginInterceptor" name="login"/>
>                         <interceptor class="br.com.idealogic.interceptor.PermissaoInterceptor" name="permissao"/>
>                         <interceptor class="br.com.idealogic.interceptor.I18nInterceptor" name="idioma"/>
>                         <interceptor class="br.com.idealogic.interceptor.JPAInterceptor" name="jpa"/>
>                         <interceptor-stack name="jpaStack">
>                                 <interceptor-ref name="login"/>
>                                 <interceptor-ref name="permissao"/>
>                                 <interceptor-ref name="idioma"/>
>                                 <interceptor-ref name="jpa"/>
>                                 <interceptor-ref name="restDefaultStack"/>
>                         </interceptor-stack>
>                 </interceptors>
>                 <default-interceptor-ref name="jpaStack"/>
>
>
>                 <default-action-ref name="login_sistema"></default-action-ref>
>
>                 <global-results>
>                         <result name="login">/login.jsp</result>
>                         <result name="forbidden">/forbidden.jsp</result>
>                 </global-results>
>
>         </package>
>
>         <include file="struts-ajax.xml"/>
>         <include file="struts-login.xml"/>
>         <include file="struts-filtro.xml"/>
> </struts>
>
> struts-ajax.xml
>
> <?xml version="1.0" encoding="UTF-8"?>
> <!DOCTYPE struts PUBLIC
>  "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
>  "http://struts.apache.org/dtds/struts-2.0.dtd">
> <struts>
>         <package name="ajax" extends="json-default" namespace="/ajax">
>                 <interceptors>
>                         <interceptor class="br.com.idealogic.interceptor.JPAInterceptor" name="jpa"/>
>                         <interceptor-stack name="jpaJsonStack">
>                                 <interceptor-ref name="jpa"/>
>                                 <interceptor-ref name="jsonValidationWorkflowStack"/>
>                         </interceptor-stack>
>                 </interceptors>
>                 <default-interceptor-ref name="jpaJsonStack"/>
>
>
>                 <action name="loadCidadeByEstado" method="loadCidadeByEstado" class="br.com.seedingControl.action.CidadeAction">
>                         <result name="json" type="json">
>                                 <param name="includeProperties">
>                                         ^cidades\[\d+\]\.idCidade,
>                                         ^cidades\[\d+\]\.nmCidade
>                                 </param>
>                         </result>
>                 </action>
>
>         </package>
> </struts>
>
> Thanks for all your help!
>
> Felipe Lorenz
>
> Em 22/06/2013, às 04:27, Lukasz Lenart escreveu:
>
>> 2013/6/22 Litman, Bruno <bl...@alabamainteractive.org>:
>>> We are also experiencing issues with tags and theme files, we are upgrading many applications from 2.3.4.1 to 2.3.14.3
>>> I am not sure if this is related - if not and if I need to start a new discussion please let me know and accept my apology.
>>>
>>> 1/
>>>
>>> We previously always coded forms as :
>>>        <s:form action="login" namespace="/">....
>>> Now randomly, this fails to generate the proper action url in the html (it is missing the '.action', which results in a 404 once you post the form)
>>>
>>> The only workaround we have found so far is to add the '.action' suffix to the s:form's action attribute. Before it was always added for us by struts.
>>> So now we are having success with
>>>        <s:form action="login.action" namespace="/">...
>>>
>>> Is this expected behavior? Did this change recently? 2.3.4.1 is not so ancient..
>>
>> No, it isn't - mainly a bug - Struts should add suffix for you, you
>> basically use the same action names as defined in struts.xml. This is
>> very strange, I have just tested with struts2-blank on Jetty and
>> suffix was there. Could you share more details about the config?
>>
>>> 2/
>>>
>>> We are trying to replace the "required" attribute in the textfields with "requiredLabel" without success. Was the xhtml theme's ftl file "controlheader_core" updated to reflect the changes in the struts-tags.tld (requiredLabel replaced required)?
>>
>> You are right, it is bug :\ Please fill an issue
>>
>>> Also, it seems applications are randomly serving ftl files from other applications' theme folders with the same name.
>>> This was demonstrated by modifying something obvious in one application's ftl file (displaying some text next to a text field's label), and the effect can be seen randomly on other applications which shouldn’t even see that application's template folder (the themes are however named the same in both applications)
>>> I am only able to make the "requiredLabel" attribute work if placed in a <s:param> tag as opposed to being just an attribute of the s:textfield tag, but even so it is still not always using the same ftl files (however always from similarly named themes placed inside each application)
>>>
>>> This is extremely confusing. Is FreeMarker caching files independently of the application? Is the app container interfering with caching? (We are using Resin 4.0.36)
>>
>> Hmmm... very strange behaviour, it will be hard to find the source of
>> the problem. Maybe it is related to new ContainerHolder and how Resin
>> is managing threads - but I'm not sure :\
>>
>>
>> Regards
>> --
>> Łukasz
>> + 48 606 323 122 http://www.lenart.org.pl/
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>

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


Re: s:action tag showing result

Posted by Felipe Lorenz <fe...@idealogic.com.br>.
Hello Lukasz,

I still facing this behaviour. Even with 2.3.16-SNAPSHOT.

One thing that make me thing, was the flush attribute. When it is true, the json result (the string) appear in the position where the action tag is in the jsp. But, when I change it to false, the result appears in the top os my page.

One workaround that I can use is return a result name that is no defined in the struts.xml. This workaround throw an exception, since struts could no find my result name, but my list is populated and no result from this action tag appear in my page.

I hope this information can help.

Also, I am printing my config:

struts.xml:

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC
	"-//Apache Software Foundation//DTD Struts Configuration 2.3//EN"
	"http://struts.apache.org/dtds/struts-2.3.dtd">
<struts order="10">
	<constant name="struts.devMode" value="false" />
	<constant name="struts.action.extension" value=",json,xhtml,xml"/>

	<constant name="struts.convention.action.mapAllMatches" value="true" />
	<constant name="struts.convention.default.parent.package" value="default"/>

	<constant name="struts.custom.i18n.resources" value="global" />

	<constant name="struts.mapper.class" value="org.apache.struts2.dispatcher.mapper.PrefixBasedActionMapper"/>
	<constant name="struts.mapper.prefixMapping" value=":rest,/ajax:struts,/login:struts"/>

	<package name="default" extends="rest-default">

		<interceptors>
			<interceptor class="br.com.idealogic.interceptor.LoginInterceptor" name="login"/>
			<interceptor class="br.com.idealogic.interceptor.PermissaoInterceptor" name="permissao"/>
			<interceptor class="br.com.idealogic.interceptor.I18nInterceptor" name="idioma"/>
			<interceptor class="br.com.idealogic.interceptor.JPAInterceptor" name="jpa"/>
			<interceptor-stack name="jpaStack">
				<interceptor-ref name="login"/>
				<interceptor-ref name="permissao"/>
				<interceptor-ref name="idioma"/>
				<interceptor-ref name="jpa"/>
				<interceptor-ref name="restDefaultStack"/>
			</interceptor-stack>
		</interceptors>
		<default-interceptor-ref name="jpaStack"/>


		<default-action-ref name="login_sistema"></default-action-ref>

		<global-results>
			<result name="login">/login.jsp</result>
			<result name="forbidden">/forbidden.jsp</result>
		</global-results>

	</package>

	<include file="struts-ajax.xml"/>
	<include file="struts-login.xml"/>
	<include file="struts-filtro.xml"/>
</struts>

struts-ajax.xml

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts PUBLIC
 "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
 "http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
	<package name="ajax" extends="json-default" namespace="/ajax">
		<interceptors>
			<interceptor class="br.com.idealogic.interceptor.JPAInterceptor" name="jpa"/>
			<interceptor-stack name="jpaJsonStack">
				<interceptor-ref name="jpa"/>
				<interceptor-ref name="jsonValidationWorkflowStack"/>
			</interceptor-stack>
		</interceptors>
		<default-interceptor-ref name="jpaJsonStack"/>


		<action name="loadCidadeByEstado" method="loadCidadeByEstado" class="br.com.seedingControl.action.CidadeAction">
			<result name="json" type="json">
				<param name="includeProperties">
					^cidades\[\d+\]\.idCidade,
					^cidades\[\d+\]\.nmCidade
				</param>
			</result>
		</action>

	</package>
</struts>

Thanks for all your help!

Felipe Lorenz

Em 22/06/2013, às 04:27, Lukasz Lenart escreveu:

> 2013/6/22 Litman, Bruno <bl...@alabamainteractive.org>:
>> We are also experiencing issues with tags and theme files, we are upgrading many applications from 2.3.4.1 to 2.3.14.3
>> I am not sure if this is related - if not and if I need to start a new discussion please let me know and accept my apology.
>> 
>> 1/
>> 
>> We previously always coded forms as :
>>        <s:form action="login" namespace="/">....
>> Now randomly, this fails to generate the proper action url in the html (it is missing the '.action', which results in a 404 once you post the form)
>> 
>> The only workaround we have found so far is to add the '.action' suffix to the s:form's action attribute. Before it was always added for us by struts.
>> So now we are having success with
>>        <s:form action="login.action" namespace="/">...
>> 
>> Is this expected behavior? Did this change recently? 2.3.4.1 is not so ancient..
> 
> No, it isn't - mainly a bug - Struts should add suffix for you, you
> basically use the same action names as defined in struts.xml. This is
> very strange, I have just tested with struts2-blank on Jetty and
> suffix was there. Could you share more details about the config?
> 
>> 2/
>> 
>> We are trying to replace the "required" attribute in the textfields with "requiredLabel" without success. Was the xhtml theme's ftl file "controlheader_core" updated to reflect the changes in the struts-tags.tld (requiredLabel replaced required)?
> 
> You are right, it is bug :\ Please fill an issue
> 
>> Also, it seems applications are randomly serving ftl files from other applications' theme folders with the same name.
>> This was demonstrated by modifying something obvious in one application's ftl file (displaying some text next to a text field's label), and the effect can be seen randomly on other applications which shouldn’t even see that application's template folder (the themes are however named the same in both applications)
>> I am only able to make the "requiredLabel" attribute work if placed in a <s:param> tag as opposed to being just an attribute of the s:textfield tag, but even so it is still not always using the same ftl files (however always from similarly named themes placed inside each application)
>> 
>> This is extremely confusing. Is FreeMarker caching files independently of the application? Is the app container interfering with caching? (We are using Resin 4.0.36)
> 
> Hmmm... very strange behaviour, it will be hard to find the source of
> the problem. Maybe it is related to new ContainerHolder and how Resin
> is managing threads - but I'm not sure :\
> 
> 
> Regards
> -- 
> Łukasz
> + 48 606 323 122 http://www.lenart.org.pl/
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 


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


Re: s:action tag showing result

Posted by Lukasz Lenart <lu...@apache.org>.
2013/6/22 Litman, Bruno <bl...@alabamainteractive.org>:
> We are also experiencing issues with tags and theme files, we are upgrading many applications from 2.3.4.1 to 2.3.14.3
> I am not sure if this is related - if not and if I need to start a new discussion please let me know and accept my apology.
>
> 1/
>
> We previously always coded forms as :
>         <s:form action="login" namespace="/">....
> Now randomly, this fails to generate the proper action url in the html (it is missing the '.action', which results in a 404 once you post the form)
>
> The only workaround we have found so far is to add the '.action' suffix to the s:form's action attribute. Before it was always added for us by struts.
> So now we are having success with
>         <s:form action="login.action" namespace="/">...
>
> Is this expected behavior? Did this change recently? 2.3.4.1 is not so ancient..

No, it isn't - mainly a bug - Struts should add suffix for you, you
basically use the same action names as defined in struts.xml. This is
very strange, I have just tested with struts2-blank on Jetty and
suffix was there. Could you share more details about the config?

> 2/
>
> We are trying to replace the "required" attribute in the textfields with "requiredLabel" without success. Was the xhtml theme's ftl file "controlheader_core" updated to reflect the changes in the struts-tags.tld (requiredLabel replaced required)?

You are right, it is bug :\ Please fill an issue

> Also, it seems applications are randomly serving ftl files from other applications' theme folders with the same name.
>  This was demonstrated by modifying something obvious in one application's ftl file (displaying some text next to a text field's label), and the effect can be seen randomly on other applications which shouldn’t even see that application's template folder (the themes are however named the same in both applications)
> I am only able to make the "requiredLabel" attribute work if placed in a <s:param> tag as opposed to being just an attribute of the s:textfield tag, but even so it is still not always using the same ftl files (however always from similarly named themes placed inside each application)
>
> This is extremely confusing. Is FreeMarker caching files independently of the application? Is the app container interfering with caching? (We are using Resin 4.0.36)

Hmmm... very strange behaviour, it will be hard to find the source of
the problem. Maybe it is related to new ContainerHolder and how Resin
is managing threads - but I'm not sure :\


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

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


RE: s:action tag showing result

Posted by "Litman, Bruno" <bl...@alabamainteractive.org>.
We are also experiencing issues with tags and theme files, we are upgrading many applications from 2.3.4.1 to 2.3.14.3
I am not sure if this is related - if not and if I need to start a new discussion please let me know and accept my apology.

1/ 

We previously always coded forms as : 
	<s:form action="login" namespace="/">....
Now randomly, this fails to generate the proper action url in the html (it is missing the '.action', which results in a 404 once you post the form)

The only workaround we have found so far is to add the '.action' suffix to the s:form's action attribute. Before it was always added for us by struts. 
So now we are having success with 
	<s:form action="login.action" namespace="/">...

Is this expected behavior? Did this change recently? 2.3.4.1 is not so ancient..

2/ 

We are trying to replace the "required" attribute in the textfields with "requiredLabel" without success. Was the xhtml theme's ftl file "controlheader_core" updated to reflect the changes in the struts-tags.tld (requiredLabel replaced required)? 

Also, it seems applications are randomly serving ftl files from other applications' theme folders with the same name.
 This was demonstrated by modifying something obvious in one application's ftl file (displaying some text next to a text field's label), and the effect can be seen randomly on other applications which shouldn’t even see that application's template folder (the themes are however named the same in both applications)
I am only able to make the "requiredLabel" attribute work if placed in a <s:param> tag as opposed to being just an attribute of the s:textfield tag, but even so it is still not always using the same ftl files (however always from similarly named themes placed inside each application)

This is extremely confusing. Is FreeMarker caching files independently of the application? Is the app container interfering with caching? (We are using Resin 4.0.36)

Any help would be greatly appreciated
Thank you in advance

Bruno Litman

-----Original Message-----
From: Daniel Clemente Ivars [mailto:daniel.clemente@boluda.com.es] 
Sent: Friday, June 21, 2013 7:43 AM
To: Struts Users Mailing List
Subject: Re: s:action tag showing result

I agree with Felipe. In version 2.3.8 all was fine, but from 2.3.12 all the problems with tags begun (action tags and field tags).

Thanks

 
Daniel Clemente Ivars




De:     Felipe Lorenz <fe...@idealogic.com.br>
Para:   "Struts Users Mailing List" <us...@struts.apache.org>, 
Fecha:  21/06/2013 14:30
Asunto: Re: s:action tag showing result



Hi Lukasz,

I try struts v. 2.3.8, and everything works fine. But, the first version I've notice this strange behaviour was 2.3.12.

I try to find the ftl file for the action tag, but I could no find it. 
There is a special file? How does it works?

Thanks,

Felipe Lorenz
Gerente de Projetos
Idealogic Software
Fone: (51) 3715 5523 - (51) 3715 5548
www.idealogic.com.br

Em 21/06/2013, às 02:34, Lukasz Lenart escreveu:

> Have you tried to use the previous versions?
> 
> 
> Regards
> --
> Łukasz
> + 48 606 323 122 http://www.lenart.org.pl/
> 
> 2013/6/20 Felipe Lorenz <fe...@idealogic.com.br>:
>> Hi all,
>> 
>> I have been using struts quite a long time, but in the last days I 
>> have
faced a strange behaviour of s:action tag.
>> 
>> In my JSP I am using the tag action to load list to be used to mount 
>> my
s:select. But in the redered HTML, the result of the action is showing, even when the executeResult is false.
>> 
>> There is something I missing?
>> 
>> 
>> JSP code:
>> 
>> <s:action namespace="/ajax" name="loadEstadoByPais" var="estado" 
flush="false" />
>> <s:select
>>                        label="%{getText('global.lbl_nmEstado')}"
>>                        name="cidade.estado.idEstado"
>>                        listKey="idEstado"
>>                        listValue="nmEstado"
>>                        list="#estado.estados"
>>                        emptyOption="true"
>>                        id="estadoCombo"
>>                        tooltip="%{getText('global.hint_nmEstado')}"/>
>> 
>> struts.xml:
>> 
>> <action name="loadEstadoByPais" method="loadEstadoByPais" 
class="br.com.seedingControl.action.EstadoAction">
>>        <result name="index" type="json">
>>                <param name="includeProperties">
>>                        ^estados\[\d+\]\.idEstado,
>>                        ^estados\[\d+\]\.nmEstado
>>                </param>
>>        </result>
>> </action>
>> 
>> As you can see, in the struts.xml, I have only json result, and I 
>> only
need as json, but when I use the action tag, I just only need the populated list to be used in the select tag. It is working very well, but the problem is that the json result is showing in the HTML. And it is showing in the top, not in the action tag position, what is strange.
>> 
>> Also, I try to change the struts.devMode to false, but nothing changes.
>> 
>> The project is using struts 2.3.14.3 with rest-plugin. But for this
kind ok action, I avoid rest and use just json-plugin.
>> 
>> Please, if need any further info, ask me!
>> 
>> Thanks in advance.
>> 
>> 
>> Felipe Lorenz
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 



.
.

Re: s:action tag showing result

Posted by Lukasz Lenart <lu...@apache.org>.
Snapshots
https://repository.apache.org/content/groups/snapshots/

2.3.15 is under way to Maven Central

2013/6/21 Felipe Lorenz <fe...@idealogic.com.br>:
> There is a maven repository for the snapshots?
>
> Felipe Lorenz
> Gerente de Projetos
> Idealogic Software
> Fone: (51) 3715 5523 - (51) 3715 5548
> www.idealogic.com.br
>
> Em 21/06/2013, às 10:47, Lukasz Lenart escreveu:
>
>> I have tested with struts2-blank and it works - I mean, executeResult
>> is respected (as in 2.3.15). You can test that by simple removing all
>> result definitions from struts.xml for that action.
>>
>> 2013/6/21 Felipe Lorenz <fe...@idealogic.com.br>:
>>> Thanks for all your help Lukasz,
>>>
>>> Looking with more attention (I know, sorry) my struts.xml and comparing with the json plugin wiki, my result was different.
>>>
>>> Before, I had:
>>> <result name="json" type="json">
>>>
>>> And to fix the issue, I remove the name attribute.
>>>
>>> <result type="json">
>>>
>>> But, my question is, why does it affect the action tag? I understand that using executeResult = false should be respected.
>>>
>>> Att,
>>>
>>> Felipe Lorenz
>>> Gerente de Projetos
>>> Idealogic Software
>>> Fone: (51) 3715 5523 - (51) 3715 5548
>>> www.idealogic.com.br
>>>
>>> Em 21/06/2013, às 10:15, Lukasz Lenart escreveu:
>>>
>>>> Could you try with the latest (almost released) version 2.3.15?
>>>>
>>>> I was checking locally with struts2-blank app and everything works,
>>>> but maybe my setup is a bit different. If so I will need an example
>>>> app (maven based the best).
>>>>
>>>>
>>>> Regards
>>>> --
>>>> Łukasz
>>>> + 48 606 323 122 http://www.lenart.org.pl/
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>>> For additional commands, e-mail: user-help@struts.apache.org
>>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>> For additional commands, e-mail: user-help@struts.apache.org
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>

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


Re: s:action tag showing result

Posted by Felipe Lorenz <fe...@idealogic.com.br>.
There is a maven repository for the snapshots?

Felipe Lorenz
Gerente de Projetos
Idealogic Software
Fone: (51) 3715 5523 - (51) 3715 5548
www.idealogic.com.br

Em 21/06/2013, às 10:47, Lukasz Lenart escreveu:

> I have tested with struts2-blank and it works - I mean, executeResult
> is respected (as in 2.3.15). You can test that by simple removing all
> result definitions from struts.xml for that action.
> 
> 2013/6/21 Felipe Lorenz <fe...@idealogic.com.br>:
>> Thanks for all your help Lukasz,
>> 
>> Looking with more attention (I know, sorry) my struts.xml and comparing with the json plugin wiki, my result was different.
>> 
>> Before, I had:
>> <result name="json" type="json">
>> 
>> And to fix the issue, I remove the name attribute.
>> 
>> <result type="json">
>> 
>> But, my question is, why does it affect the action tag? I understand that using executeResult = false should be respected.
>> 
>> Att,
>> 
>> Felipe Lorenz
>> Gerente de Projetos
>> Idealogic Software
>> Fone: (51) 3715 5523 - (51) 3715 5548
>> www.idealogic.com.br
>> 
>> Em 21/06/2013, às 10:15, Lukasz Lenart escreveu:
>> 
>>> Could you try with the latest (almost released) version 2.3.15?
>>> 
>>> I was checking locally with struts2-blank app and everything works,
>>> but maybe my setup is a bit different. If so I will need an example
>>> app (maven based the best).
>>> 
>>> 
>>> Regards
>>> --
>>> Łukasz
>>> + 48 606 323 122 http://www.lenart.org.pl/
>>> 
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>> For additional commands, e-mail: user-help@struts.apache.org
>>> 
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 


Re: s:action tag showing result

Posted by Lukasz Lenart <lu...@apache.org>.
I have tested with struts2-blank and it works - I mean, executeResult
is respected (as in 2.3.15). You can test that by simple removing all
result definitions from struts.xml for that action.

2013/6/21 Felipe Lorenz <fe...@idealogic.com.br>:
> Thanks for all your help Lukasz,
>
> Looking with more attention (I know, sorry) my struts.xml and comparing with the json plugin wiki, my result was different.
>
> Before, I had:
> <result name="json" type="json">
>
> And to fix the issue, I remove the name attribute.
>
> <result type="json">
>
> But, my question is, why does it affect the action tag? I understand that using executeResult = false should be respected.
>
> Att,
>
> Felipe Lorenz
> Gerente de Projetos
> Idealogic Software
> Fone: (51) 3715 5523 - (51) 3715 5548
> www.idealogic.com.br
>
> Em 21/06/2013, às 10:15, Lukasz Lenart escreveu:
>
>> Could you try with the latest (almost released) version 2.3.15?
>>
>> I was checking locally with struts2-blank app and everything works,
>> but maybe my setup is a bit different. If so I will need an example
>> app (maven based the best).
>>
>>
>> Regards
>> --
>> Łukasz
>> + 48 606 323 122 http://www.lenart.org.pl/
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>

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


Re: s:action tag showing result

Posted by Felipe Lorenz <fe...@idealogic.com.br>.
Thanks for all your help Lukasz,

Looking with more attention (I know, sorry) my struts.xml and comparing with the json plugin wiki, my result was different.

Before, I had:
<result name="json" type="json">

And to fix the issue, I remove the name attribute.

<result type="json">

But, my question is, why does it affect the action tag? I understand that using executeResult = false should be respected.

Att,

Felipe Lorenz
Gerente de Projetos
Idealogic Software
Fone: (51) 3715 5523 - (51) 3715 5548
www.idealogic.com.br

Em 21/06/2013, às 10:15, Lukasz Lenart escreveu:

> Could you try with the latest (almost released) version 2.3.15?
> 
> I was checking locally with struts2-blank app and everything works,
> but maybe my setup is a bit different. If so I will need an example
> app (maven based the best).
> 
> 
> Regards
> -- 
> Łukasz
> + 48 606 323 122 http://www.lenart.org.pl/
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 


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


Re: s:action tag showing result

Posted by Lukasz Lenart <lu...@apache.org>.
Could you try with the latest (almost released) version 2.3.15?

I was checking locally with struts2-blank app and everything works,
but maybe my setup is a bit different. If so I will need an example
app (maven based the best).


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

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


Re: s:action tag showing result

Posted by Daniel Clemente Ivars <da...@boluda.com.es>.
I agree with Felipe. In version 2.3.8 all was fine, but from 2.3.12 all 
the problems with tags begun (action tags and field tags).

Thanks

 
Daniel Clemente Ivars




De:     Felipe Lorenz <fe...@idealogic.com.br>
Para:   "Struts Users Mailing List" <us...@struts.apache.org>, 
Fecha:  21/06/2013 14:30
Asunto: Re: s:action tag showing result



Hi Lukasz,

I try struts v. 2.3.8, and everything works fine. But, the first version 
I've notice this strange behaviour was 2.3.12.

I try to find the ftl file for the action tag, but I could no find it. 
There is a special file? How does it works?

Thanks,

Felipe Lorenz
Gerente de Projetos
Idealogic Software
Fone: (51) 3715 5523 - (51) 3715 5548
www.idealogic.com.br

Em 21/06/2013, às 02:34, Lukasz Lenart escreveu:

> Have you tried to use the previous versions?
> 
> 
> Regards
> -- 
> Łukasz
> + 48 606 323 122 http://www.lenart.org.pl/
> 
> 2013/6/20 Felipe Lorenz <fe...@idealogic.com.br>:
>> Hi all,
>> 
>> I have been using struts quite a long time, but in the last days I have 
faced a strange behaviour of s:action tag.
>> 
>> In my JSP I am using the tag action to load list to be used to mount my 
s:select. But in the redered HTML, the result of the action is showing, 
even when the executeResult is false.
>> 
>> There is something I missing?
>> 
>> 
>> JSP code:
>> 
>> <s:action namespace="/ajax" name="loadEstadoByPais" var="estado" 
flush="false" />
>> <s:select
>>                        label="%{getText('global.lbl_nmEstado')}"
>>                        name="cidade.estado.idEstado"
>>                        listKey="idEstado"
>>                        listValue="nmEstado"
>>                        list="#estado.estados"
>>                        emptyOption="true"
>>                        id="estadoCombo"
>>                        tooltip="%{getText('global.hint_nmEstado')}"/>
>> 
>> struts.xml:
>> 
>> <action name="loadEstadoByPais" method="loadEstadoByPais" 
class="br.com.seedingControl.action.EstadoAction">
>>        <result name="index" type="json">
>>                <param name="includeProperties">
>>                        ^estados\[\d+\]\.idEstado,
>>                        ^estados\[\d+\]\.nmEstado
>>                </param>
>>        </result>
>> </action>
>> 
>> As you can see, in the struts.xml, I have only json result, and I only 
need as json, but when I use the action tag, I just only need the 
populated list to be used in the select tag. It is working very well, but 
the problem is that the json result is showing in the HTML. And it is 
showing in the top, not in the action tag position, what is strange.
>> 
>> Also, I try to change the struts.devMode to false, but nothing changes.
>> 
>> The project is using struts 2.3.14.3 with rest-plugin. But for this 
kind ok action, I avoid rest and use just json-plugin.
>> 
>> Please, if need any further info, ask me!
>> 
>> Thanks in advance.
>> 
>> 
>> Felipe Lorenz
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 



.
.

Re: s:action tag showing result

Posted by Felipe Lorenz <fe...@idealogic.com.br>.
Hi Lukasz,

I try struts v. 2.3.8, and everything works fine. But, the first version I've notice this strange behaviour was 2.3.12.

I try to find the ftl file for the action tag, but I could no find it. There is a special file? How does it works?

Thanks,

Felipe Lorenz
Gerente de Projetos
Idealogic Software
Fone: (51) 3715 5523 - (51) 3715 5548
www.idealogic.com.br

Em 21/06/2013, às 02:34, Lukasz Lenart escreveu:

> Have you tried to use the previous versions?
> 
> 
> Regards
> -- 
> Łukasz
> + 48 606 323 122 http://www.lenart.org.pl/
> 
> 2013/6/20 Felipe Lorenz <fe...@idealogic.com.br>:
>> Hi all,
>> 
>> I have been using struts quite a long time, but in the last days I have faced a strange behaviour of s:action tag.
>> 
>> In my JSP I am using the tag action to load list to be used to mount my s:select. But in the redered HTML, the result of the action is showing, even when the executeResult is false.
>> 
>> There is something I missing?
>> 
>> 
>> JSP code:
>> 
>> <s:action namespace="/ajax" name="loadEstadoByPais" var="estado" flush="false" />
>> <s:select
>>                        label="%{getText('global.lbl_nmEstado')}"
>>                        name="cidade.estado.idEstado"
>>                        listKey="idEstado"
>>                        listValue="nmEstado"
>>                        list="#estado.estados"
>>                        emptyOption="true"
>>                        id="estadoCombo"
>>                        tooltip="%{getText('global.hint_nmEstado')}"/>
>> 
>> struts.xml:
>> 
>> <action name="loadEstadoByPais" method="loadEstadoByPais" class="br.com.seedingControl.action.EstadoAction">
>>        <result name="index" type="json">
>>                <param name="includeProperties">
>>                        ^estados\[\d+\]\.idEstado,
>>                        ^estados\[\d+\]\.nmEstado
>>                </param>
>>        </result>
>> </action>
>> 
>> As you can see, in the struts.xml, I have only json result, and I only need as json, but when I use the action tag, I just only need the populated list to be used in the select tag. It is working very well, but the problem is that the json result is showing in the HTML. And it is showing in the top, not in the action tag position, what is strange.
>> 
>> Also, I try to change the struts.devMode to false, but nothing changes.
>> 
>> The project is using struts 2.3.14.3 with rest-plugin. But for this kind ok action, I avoid rest and use just json-plugin.
>> 
>> Please, if need any further info, ask me!
>> 
>> Thanks in advance.
>> 
>> 
>> Felipe Lorenz
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 


Re: s:action tag showing result

Posted by Daniel Clemente Ivars <da...@boluda.com.es>.
Hi!

I'm facing not the same, but a strange behavior too with "s:action tag" 
since Struts version 2.3.12.

I'm using them in similar way than Felipe, so it load some Lists to be 
used later for Select Fields filling. It worked well until change struts 
version form 2.3.8 to 2.3.12 and later.

Now, it works well when I start up the server for the first app that get 
called, but not for the other apps that may use the same technique but get 
called later. If I redeploy the app that was working (without restarting 
the whole Tomcat server), it doesn't work any more.

I'm facing "random" results too with s:form field tags (such s:input and 
so on), in which they some times use the default "theme" to create the 
html code and other times use the "simple" theme (which is the one I've 
set in strus.xml). It happen randomly, any time the page its reloaded in 
the browser it may change the result.

Any idea?

Thanks a lot.





De:     Lukasz Lenart <lu...@apache.org>
Para:   Struts Users Mailing List <us...@struts.apache.org>, 
Fecha:  21/06/2013 07:34
Asunto: Re: s:action tag showing result



Have you tried to use the previous versions?


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

2013/6/20 Felipe Lorenz <fe...@idealogic.com.br>:
> Hi all,
>
> I have been using struts quite a long time, but in the last days I have 
faced a strange behaviour of s:action tag.
>
> In my JSP I am using the tag action to load list to be used to mount my 
s:select. But in the redered HTML, the result of the action is showing, 
even when the executeResult is false.
>
> There is something I missing?
>
>
> JSP code:
>
> <s:action namespace="/ajax" name="loadEstadoByPais" var="estado" 
flush="false" />
> <s:select
>                         label="%{getText('global.lbl_nmEstado')}"
>                         name="cidade.estado.idEstado"
>                         listKey="idEstado"
>                         listValue="nmEstado"
>                         list="#estado.estados"
>                         emptyOption="true"
>                         id="estadoCombo"
>                         tooltip="%{getText('global.hint_nmEstado')}"/>
>
> struts.xml:
>
> <action name="loadEstadoByPais" method="loadEstadoByPais" 
class="br.com.seedingControl.action.EstadoAction">
>         <result name="index" type="json">
>                 <param name="includeProperties">
>                         ^estados\[\d+\]\.idEstado,
>                         ^estados\[\d+\]\.nmEstado
>                 </param>
>         </result>
> </action>
>
> As you can see, in the struts.xml, I have only json result, and I only 
need as json, but when I use the action tag, I just only need the 
populated list to be used in the select tag. It is working very well, but 
the problem is that the json result is showing in the HTML. And it is 
showing in the top, not in the action tag position, what is strange.
>
> Also, I try to change the struts.devMode to false, but nothing changes.
>
> The project is using struts 2.3.14.3 with rest-plugin. But for this kind 
ok action, I avoid rest and use just json-plugin.
>
> Please, if need any further info, ask me!
>
> Thanks in advance.
>
>
> Felipe Lorenz
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>

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



.
.


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


Re: s:action tag showing result

Posted by Lukasz Lenart <lu...@apache.org>.
Have you tried to use the previous versions?


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

2013/6/20 Felipe Lorenz <fe...@idealogic.com.br>:
> Hi all,
>
> I have been using struts quite a long time, but in the last days I have faced a strange behaviour of s:action tag.
>
> In my JSP I am using the tag action to load list to be used to mount my s:select. But in the redered HTML, the result of the action is showing, even when the executeResult is false.
>
> There is something I missing?
>
>
> JSP code:
>
> <s:action namespace="/ajax" name="loadEstadoByPais" var="estado" flush="false" />
> <s:select
>                         label="%{getText('global.lbl_nmEstado')}"
>                         name="cidade.estado.idEstado"
>                         listKey="idEstado"
>                         listValue="nmEstado"
>                         list="#estado.estados"
>                         emptyOption="true"
>                         id="estadoCombo"
>                         tooltip="%{getText('global.hint_nmEstado')}"/>
>
> struts.xml:
>
> <action name="loadEstadoByPais" method="loadEstadoByPais" class="br.com.seedingControl.action.EstadoAction">
>         <result name="index" type="json">
>                 <param name="includeProperties">
>                         ^estados\[\d+\]\.idEstado,
>                         ^estados\[\d+\]\.nmEstado
>                 </param>
>         </result>
> </action>
>
> As you can see, in the struts.xml, I have only json result, and I only need as json, but when I use the action tag, I just only need the populated list to be used in the select tag. It is working very well, but the problem is that the json result is showing in the HTML. And it is showing in the top, not in the action tag position, what is strange.
>
> Also, I try to change the struts.devMode to false, but nothing changes.
>
> The project is using struts 2.3.14.3 with rest-plugin. But for this kind ok action, I avoid rest and use just json-plugin.
>
> Please, if need any further info, ask me!
>
> Thanks in advance.
>
>
> Felipe Lorenz
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>

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