You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Fabio Alves de Araujo Ebner - DnaSolution <fa...@dnasolution.com.br> on 2010/07/12 19:15:44 UTC
Help Struts2 + interceptor
Hi, i need help to use interceptor, i create one to test if the user are logged in my application until he execute one Action, but when the server pass throw interceptor and back to action, all my var are null, this is my struts.xml
<!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN" "http://struts.apache.org/dtds/struts-2.0.dtd"><struts>
<package name="loginClienteAndUsuario"
extends="struts-default">
<interceptors>
<interceptor name="loginUsuario"
class="br.com.dnasolution.site.interceptor.LoginUsuarioInterceptor">
</interceptor>
<interceptor name="loginCliente"
class="br.com.dnasolution.site.interceptor.LoginClienteInterceptor">
</interceptor>
<interceptor-stack name="myStack">
<interceptor-ref name="loginCliente"/>
<interceptor-ref name="loginUsuario"/>
<interceptor-ref name="defaultStack"/>
</interceptor-stack>
</interceptors>
<default-interceptor-ref name="myStack"/>
<global-results>
<result name="clienteNaoLogado">/jsp/usuario/loginUsuario.jsp</result>
<result name="clienteNaoLogado">/jsp/cliente/loginCliente.jsp</result>
</global-results>
</package>
</struts>
tks
RE: Struts 1 binding vulnerability
Posted by "Zheng, Xiahong" <Xi...@FMR.COM>.
Created and attached a patch. Please have a look at the issue https://issues.apache.org/jira/browse/STR-3206
-----Original Message-----
From: paulus.benedictus@gmail.com [mailto:paulus.benedictus@gmail.com] On Behalf Of Paul Benedict
Sent: Monday, July 12, 2010 3:13 PM
To: Struts Users Mailing List
Subject: Re: Struts 1 binding vulnerability
Open a JIRA ticket and submit a patch. We welcome help from the community.
On Mon, Jul 12, 2010 at 2:06 PM, Zheng, Xiahong <Xi...@fmr.com> wrote:
> Hi,
>
> Spring recently released the following security vulnerability in its MVC data binding framework. Here is the description
>
> The Spring Framework provides a mechanism to use client provided data to update the properties of an object. This mechanism allows an attacker to modify the properties of the class loader used to load the object (via 'class.classloader'). This can lead to arbitrary command execution since, for example, an attacker can modify the URLs used by the class loader to point to locations controlled by the attacker.
>
> For full description, follow this link http://www.springsource.com/security/cve-2010-1622
>
> Although Struts is not vulnerable to the exact attack described in the cve, we found Struts' binding mechanism do expose the opportunities for an attacker to manipulate other classloader properties such as "delegationMode", "jarPath", "antiJarLocking", etc. I am wondering if the Struts team is aware of this and any plans to have a fix in the near future.
>
> Thanks,
> Xiaohong Zheng
>
>
>
>
> ---------------------------------------------------------------------
> 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: Struts 1 binding vulnerability
Posted by Paul Benedict <pb...@apache.org>.
Open a JIRA ticket and submit a patch. We welcome help from the community.
On Mon, Jul 12, 2010 at 2:06 PM, Zheng, Xiahong <Xi...@fmr.com> wrote:
> Hi,
>
> Spring recently released the following security vulnerability in its MVC data binding framework. Here is the description
>
> The Spring Framework provides a mechanism to use client provided data to update the properties of an object. This mechanism allows an attacker to modify the properties of the class loader used to load the object (via 'class.classloader'). This can lead to arbitrary command execution since, for example, an attacker can modify the URLs used by the class loader to point to locations controlled by the attacker.
>
> For full description, follow this link http://www.springsource.com/security/cve-2010-1622
>
> Although Struts is not vulnerable to the exact attack described in the cve, we found Struts' binding mechanism do expose the opportunities for an attacker to manipulate other classloader properties such as "delegationMode", "jarPath", "antiJarLocking", etc. I am wondering if the Struts team is aware of this and any plans to have a fix in the near future.
>
> Thanks,
> Xiaohong Zheng
>
>
>
>
> ---------------------------------------------------------------------
> 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
Struts 1 binding vulnerability
Posted by "Zheng, Xiahong" <Xi...@FMR.COM>.
Hi,
Spring recently released the following security vulnerability in its MVC data binding framework. Here is the description
The Spring Framework provides a mechanism to use client provided data to update the properties of an object. This mechanism allows an attacker to modify the properties of the class loader used to load the object (via 'class.classloader'). This can lead to arbitrary command execution since, for example, an attacker can modify the URLs used by the class loader to point to locations controlled by the attacker.
For full description, follow this link http://www.springsource.com/security/cve-2010-1622
Although Struts is not vulnerable to the exact attack described in the cve, we found Struts' binding mechanism do expose the opportunities for an attacker to manipulate other classloader properties such as "delegationMode", "jarPath", "antiJarLocking", etc. I am wondering if the Struts team is aware of this and any plans to have a fix in the near future.
Thanks,
Xiaohong Zheng
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Help Struts2 + interceptor
Posted by Paweł Wielgus <po...@gmail.com>.
Hi all,
You can try this way:
http://poulwiel.blogspot.com/2009/01/intercepting-all-actions-inside-my-app.html
Best greetings,
Paweł Wielgus.
2010/7/13 Fabio Alves de Araujo Ebner - DnaSolution
<fa...@dnasolution.com.br>:
> The problem is: When he pass through interceptor and go to action
> "cadastrarOrdemServico" my var cdProjetoOS are set with null :(
>
> thanks, follow my all code:
>
> CLASS LoginClienteInterceptor .java
> ---------------------------------------------------
> package br.com.dnasolution.site.interceptor;
>
> import com.opensymphony.xwork2.ActionInvocation;
> import com.opensymphony.xwork2.interceptor.Interceptor;
>
> public class LoginClienteInterceptor implements Interceptor {
>
> @Override
> public void destroy() { }
> @Override
> public void init() { }
>
> @Override
> public String intercept(ActionInvocation invocation) throws Exception {
> if(invocation.getInvocationContext().getSession().get("clienteLogado") !=
> null){
> return invocation.invoke();
> }else{
> return "clienteNaoLogado";
> }
> }
>
> }
> ----------------------------------------------------
> Class LoginUsuarioInterceptor
> ----------------------------------------------------
> package br.com.dnasolution.site.interceptor;
>
> import com.opensymphony.xwork2.ActionInvocation;
> import com.opensymphony.xwork2.interceptor.Interceptor;
>
> public class LoginUsuarioInterceptor implements Interceptor {
>
> @Override
> public void destroy() {}
>
> @Override
> public void init() { }
>
> @Override
> public String intercept(ActionInvocation invocation) throws Exception {
> if(invocation.getInvocationContext().getSession().get("usuarioLogado") !=
> null){
> return invocation.invoke();
> }else{
> return "usuarioNaoLogado";
> }
> }
>
> }
> ----------------------------------------------------
> My STruts.xml
> ----------------------------------------------------
> <!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts
> Configuration 2.0//EN"
> "http://struts.apache.org/dtds/struts-2.0.dtd"><struts>
> <package name="my-secure"
> extends="convention-default">
> <interceptors>
> <interceptor name="loginUsuarioInterceptor"
> class="br.com.dnasolution.site.interceptor.LoginUsuarioInterceptor">
> </interceptor>
> <interceptor name="loginClienteInterceptor"
> class="br.com.dnasolution.site.interceptor.LoginClienteInterceptor">
> </interceptor>
> <interceptor-stack name="secureStack">
> <interceptor-ref name="defaultStack"/>
> <interceptor-ref name="loginClienteInterceptor"/>
> <interceptor-ref name="loginUsuarioInterceptor"/>
> </interceptor-stack>
> </interceptors>
>
> <default-interceptor-ref name="secureStack"/>
>
> <global-results>
> <result name="clienteNaoLogado">/jsp/usuario/loginUsuario.jsp
> </result>
> <result name="clienteNaoLogado">/jsp/cliente/loginCliente.jsp
> </result>
> </global-results>
>
> </package>
> </struts>
> ----------------------------------------------------
> My OrdemServicoAction.java
> ----------------------------------------------------
>
>
> package br.com.dnasolution.site.action;
>
> import java.util.Date;
> import java.util.List;
>
> import org.apache.struts2.convention.annotation.Action;
> import org.apache.struts2.convention.annotation.InterceptorRef;
> import org.apache.struts2.convention.annotation.ParentPackage;
> import org.apache.struts2.convention.annotation.Result;
>
>
> import com.opensymphony.xwork2.ActionContext;
>
> @ParentPackage("my-secure")
> public class OrdemServicoAction {
> @Action(value = "cadastrarOrdemServico", results = {
> @Result(name = "valido", location =
> "/jsp/ordemservico/cadastro_sucesso.jsp"),
> @Result(name = "invalido", location =
> "/jsp/ordemservico/cadastro_falha.jsp") }, interceptorRefs = {
> @InterceptorRef("loginClienteInterceptor") })
> public String cadastrarOrdemServico() {
> try {
> TbProjeto projetoOS = projetoService
> .getProjetoById(this.cdProjetoOS);
> TbTopicoOs topicoOs = topicoOsService.getTopicoById(cdTopicoOS);
>
> }
>
> ---------------------------------------------------------------------
> 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: Help Struts2 + interceptor
Posted by Fabio Alves de Araujo Ebner - DnaSolution <fa...@dnasolution.com.br>.
The problem is: When he pass through interceptor and go to action
"cadastrarOrdemServico" my var cdProjetoOS are set with null :(
thanks, follow my all code:
CLASS LoginClienteInterceptor .java
---------------------------------------------------
package br.com.dnasolution.site.interceptor;
import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.interceptor.Interceptor;
public class LoginClienteInterceptor implements Interceptor {
@Override
public void destroy() { }
@Override
public void init() { }
@Override
public String intercept(ActionInvocation invocation) throws Exception {
if(invocation.getInvocationContext().getSession().get("clienteLogado") !=
null){
return invocation.invoke();
}else{
return "clienteNaoLogado";
}
}
}
----------------------------------------------------
Class LoginUsuarioInterceptor
----------------------------------------------------
package br.com.dnasolution.site.interceptor;
import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.interceptor.Interceptor;
public class LoginUsuarioInterceptor implements Interceptor {
@Override
public void destroy() {}
@Override
public void init() { }
@Override
public String intercept(ActionInvocation invocation) throws Exception {
if(invocation.getInvocationContext().getSession().get("usuarioLogado") !=
null){
return invocation.invoke();
}else{
return "usuarioNaoLogado";
}
}
}
----------------------------------------------------
My STruts.xml
----------------------------------------------------
<!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts
Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd"><struts>
<package name="my-secure"
extends="convention-default">
<interceptors>
<interceptor name="loginUsuarioInterceptor"
class="br.com.dnasolution.site.interceptor.LoginUsuarioInterceptor">
</interceptor>
<interceptor name="loginClienteInterceptor"
class="br.com.dnasolution.site.interceptor.LoginClienteInterceptor">
</interceptor>
<interceptor-stack name="secureStack">
<interceptor-ref name="defaultStack"/>
<interceptor-ref name="loginClienteInterceptor"/>
<interceptor-ref name="loginUsuarioInterceptor"/>
</interceptor-stack>
</interceptors>
<default-interceptor-ref name="secureStack"/>
<global-results>
<result name="clienteNaoLogado">/jsp/usuario/loginUsuario.jsp
</result>
<result name="clienteNaoLogado">/jsp/cliente/loginCliente.jsp
</result>
</global-results>
</package>
</struts>
----------------------------------------------------
My OrdemServicoAction.java
----------------------------------------------------
package br.com.dnasolution.site.action;
import java.util.Date;
import java.util.List;
import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.InterceptorRef;
import org.apache.struts2.convention.annotation.ParentPackage;
import org.apache.struts2.convention.annotation.Result;
import com.opensymphony.xwork2.ActionContext;
@ParentPackage("my-secure")
public class OrdemServicoAction {
@Action(value = "cadastrarOrdemServico", results = {
@Result(name = "valido", location =
"/jsp/ordemservico/cadastro_sucesso.jsp"),
@Result(name = "invalido", location =
"/jsp/ordemservico/cadastro_falha.jsp") }, interceptorRefs = {
@InterceptorRef("loginClienteInterceptor") })
public String cadastrarOrdemServico() {
try {
TbProjeto projetoOS = projetoService
.getProjetoById(this.cdProjetoOS);
TbTopicoOs topicoOs = topicoOsService.getTopicoById(cdTopicoOS);
}
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Help Struts2 + interceptor
Posted by JP Cafaro <jc...@gmail.com>.
I'm fairly new to this myself so maybe someone else can jump in. First
things first, put a print statement in the intercept methods of your
interceptors so you at least know if the interceptor is even getting
called.
Secondly, I didn't ever use a line like this:interceptorRefs = {
@InterceptorRef("loginClienteInterceptor") }) .
Other than that, I'm not sure what else to do.
Fabio Alves de Araujo Ebner - DnaSolution wrote:
> Hey man, this is my structure
>
>
> MY ACTION
>
> package br.com.dnasolution.site.action;
>
>
> /** import **//
>
>
> @ParentPackage("my-secure")
>
> public class OrdemServicoAction {
>
> @Action(value = "cadastrarOrdemServico", results = {@Result(name =
> "valido", location = "/jsp/ordemservico/cadastro_sucesso.jsp"),
> @Result(name = "invalido", location =
> "/jsp/ordemservico/cadastro_falha.jsp") }, interceptorRefs = {
> @InterceptorRef("loginClienteInterceptor") })
> public String cadastrarOrdemServico() {
> /* code */
> }
>
>
>
> MY INTERCEPTOR
>
> package br.com.dnasolution.site.interceptor;
>
> import com.opensymphony.xwork2.ActionInvocation;
> import com.opensymphony.xwork2.interceptor.Interceptor;
>
> public class LoginClienteInterceptor implements Interceptor {
>
> @Override
> public void destroy() {
> // TODO Auto-generated method stub
>
> }
>
> @Override
> public void init() {
> // TODO Auto-generated method stub
>
> }
>
> @Override
> public String intercept(ActionInvocation invocation) throws Exception {
> if(invocation.getInvocationContext().getSession().get("clienteLogado")
> != null){
> return invocation.invoke();
> }else{
> return "clienteNaoLogado";
> }
> }
>
> }
>
>
>
> AND MY STRUTS.XML
>
> <!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts
> Configuration 2.0//EN"
> "http://struts.apache.org/dtds/struts-2.0.dtd"><struts>
>
> <package name="my-secure"
>
> extends="struts-default">
>
> <interceptors>
>
> <interceptor name="loginUsuarioInterceptor"
>
> class="br.com.dnasolution.site.interceptor.LoginUsuarioInterceptor">
>
> </interceptor>
>
> <interceptor name="loginClienteInterceptor"
>
> class="br.com.dnasolution.site.interceptor.LoginClienteInterceptor">
>
> </interceptor>
>
> <interceptor-stack name="secureStack">
>
> <interceptor-ref name="loginUsuarioInterceptor"/>
>
> <interceptor-ref name="loginClienteInterceptor"/>
>
> <interceptor-ref name="defaultStack"/>
>
> </interceptor-stack>
>
> </interceptors>
>
>
> <default-interceptor-ref name="secureStack"/>
>
>
> <global-results>
>
> <result name="clienteNaoLogado">/jsp/usuario/loginUsuario.jsp
>
> </result>
>
> <result name="clienteNaoLogado">/jsp/cliente/loginCliente.jsp
>
> </result>
>
> </global-results>
>
>
> </package>
>
> </struts>
>
>
>
>
>
>
> and still dosen't work :(
>
>
> ---------------------------------------------------------------------
> 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: Help Struts2 + interceptor
Posted by Fabio Alves de Araujo Ebner - DnaSolution <fa...@dnasolution.com.br>.
Hey man, this is my structure
MY ACTION
package br.com.dnasolution.site.action;
/** import **//
@ParentPackage("my-secure")
public class OrdemServicoAction {
@Action(value = "cadastrarOrdemServico", results = {@Result(name = "valido",
location = "/jsp/ordemservico/cadastro_sucesso.jsp"), @Result(name =
"invalido", location = "/jsp/ordemservico/cadastro_falha.jsp") },
interceptorRefs = { @InterceptorRef("loginClienteInterceptor") })
public String cadastrarOrdemServico() {
/* code */
}
MY INTERCEPTOR
package br.com.dnasolution.site.interceptor;
import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.interceptor.Interceptor;
public class LoginClienteInterceptor implements Interceptor {
@Override
public void destroy() {
// TODO Auto-generated method stub
}
@Override
public void init() {
// TODO Auto-generated method stub
}
@Override
public String intercept(ActionInvocation invocation) throws Exception {
if(invocation.getInvocationContext().getSession().get("clienteLogado") !=
null){
return invocation.invoke();
}else{
return "clienteNaoLogado";
}
}
}
AND MY STRUTS.XML
<!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts
Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd"><struts>
<package name="my-secure"
extends="struts-default">
<interceptors>
<interceptor name="loginUsuarioInterceptor"
class="br.com.dnasolution.site.interceptor.LoginUsuarioInterceptor">
</interceptor>
<interceptor name="loginClienteInterceptor"
class="br.com.dnasolution.site.interceptor.LoginClienteInterceptor">
</interceptor>
<interceptor-stack name="secureStack">
<interceptor-ref name="loginUsuarioInterceptor"/>
<interceptor-ref name="loginClienteInterceptor"/>
<interceptor-ref name="defaultStack"/>
</interceptor-stack>
</interceptors>
<default-interceptor-ref name="secureStack"/>
<global-results>
<result name="clienteNaoLogado">/jsp/usuario/loginUsuario.jsp
</result>
<result name="clienteNaoLogado">/jsp/cliente/loginCliente.jsp
</result>
</global-results>
</package>
</struts>
and still dosen't work :(
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Help Struts2 + interceptor
Posted by JP Cafaro <jc...@gmail.com>.
Here's how I do it:
struts.xml:
<package name="my-secure" extends="my-default">
<interceptors>
<interceptor name="authenticationInterceptor"
class="interceptors.AuthenticationInterceptor" />
<interceptor-stack name="secureStack">
<interceptor-ref name="authenticationInterceptor" />
<interceptor-ref name="defaultStack" />
</interceptor-stack>
</interceptors>
<default-interceptor-ref name="secureStack" />
</package>
where my-default is another package that extends struts-default,
Then I have a package-info.java file in each package that has actions
that need to use this interceptor, for example:
@ParentPackage("my-secure")
package actions.secure;
import org.apache.struts2.convention.annotation.ParentPackage;
Note, I'm using the convention plugin
Fabio Alves de Araujo Ebner - DnaSolution wrote:
> so i put in my aciotn
>
> ParentPackage("loginClienteAndUsuario")
>
> and i got the same problem
> ----- Original Message ----- From: "JP Cafaro" <jc...@gmail.com>
> To: "Struts Users Mailing List" <us...@struts.apache.org>
> Sent: Monday, July 12, 2010 2:18 PM
> Subject: Re: Help Struts2 + interceptor
>
>
>> The action has to be a part of that package, it has to extend that
>> package.
>>
>> Fabio Alves de Araujo Ebner - DnaSolution wrote:
>>>
>>> Hi, i need help to use interceptor, i create one to test if the user
>>> are logged in my application until he execute one Action, but when
>>> the server pass throw interceptor and back to action, all my var are
>>> null, this is my struts.xml
>>>
>>> <!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts
>>> Configuration 2.0//EN"
>>> "http://struts.apache.org/dtds/struts-2.0.dtd"><struts>
>>> <package name="loginClienteAndUsuario"
>>> extends="struts-default">
>>> <interceptors>
>>> <interceptor name="loginUsuario"
>>>
>>> class="br.com.dnasolution.site.interceptor.LoginUsuarioInterceptor">
>>> </interceptor>
>>> <interceptor name="loginCliente"
>>>
>>> class="br.com.dnasolution.site.interceptor.LoginClienteInterceptor">
>>> </interceptor>
>>> <interceptor-stack name="myStack">
>>> <interceptor-ref name="loginCliente"/>
>>> <interceptor-ref name="loginUsuario"/>
>>> <interceptor-ref name="defaultStack"/>
>>> </interceptor-stack>
>>> </interceptors>
>>> <default-interceptor-ref name="myStack"/>
>>> <global-results>
>>> <result name="clienteNaoLogado">/jsp/usuario/loginUsuario.jsp</result>
>>> <result name="clienteNaoLogado">/jsp/cliente/loginCliente.jsp</result>
>>> </global-results>
>>>
>>> </package>
>>> </struts>
>>>
>>>
>>> tks
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>
>
> --------------------------------------------------------------------------------
>
>
>
>
> No virus found in this incoming message.
> Checked by AVG - www.avg.com
> Version: 9.0.830 / Virus Database: 271.1.1/2998 - Release Date:
> 07/12/10 03:36:00
>
>
> ---------------------------------------------------------------------
> 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: Help Struts2 + interceptor
Posted by Fabio Alves de Araujo Ebner - DnaSolution <fa...@dnasolution.com.br>.
so i put in my aciotn
ParentPackage("loginClienteAndUsuario")
and i got the same problem
----- Original Message -----
From: "JP Cafaro" <jc...@gmail.com>
To: "Struts Users Mailing List" <us...@struts.apache.org>
Sent: Monday, July 12, 2010 2:18 PM
Subject: Re: Help Struts2 + interceptor
> The action has to be a part of that package, it has to extend that
> package.
>
> Fabio Alves de Araujo Ebner - DnaSolution wrote:
>>
>> Hi, i need help to use interceptor, i create one to test if the user are
>> logged in my application until he execute one Action, but when the server
>> pass throw interceptor and back to action, all my var are null, this is
>> my struts.xml
>>
>> <!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts
>> Configuration 2.0//EN"
>> "http://struts.apache.org/dtds/struts-2.0.dtd"><struts>
>> <package name="loginClienteAndUsuario"
>> extends="struts-default">
>> <interceptors>
>> <interceptor name="loginUsuario"
>>
>> class="br.com.dnasolution.site.interceptor.LoginUsuarioInterceptor">
>> </interceptor>
>> <interceptor name="loginCliente"
>>
>> class="br.com.dnasolution.site.interceptor.LoginClienteInterceptor">
>> </interceptor>
>> <interceptor-stack name="myStack">
>> <interceptor-ref name="loginCliente"/>
>> <interceptor-ref name="loginUsuario"/>
>> <interceptor-ref name="defaultStack"/>
>> </interceptor-stack>
>> </interceptors>
>> <default-interceptor-ref name="myStack"/>
>> <global-results>
>> <result name="clienteNaoLogado">/jsp/usuario/loginUsuario.jsp</result>
>> <result name="clienteNaoLogado">/jsp/cliente/loginCliente.jsp</result>
>> </global-results>
>>
>> </package>
>> </struts>
>>
>>
>> tks
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
--------------------------------------------------------------------------------
No virus found in this incoming message.
Checked by AVG - www.avg.com
Version: 9.0.830 / Virus Database: 271.1.1/2998 - Release Date: 07/12/10
03:36:00
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Help Struts2 + interceptor
Posted by JP Cafaro <jc...@gmail.com>.
The action has to be a part of that package, it has to extend that package.
Fabio Alves de Araujo Ebner - DnaSolution wrote:
>
> Hi, i need help to use interceptor, i create one to test if the user are logged in my application until he execute one Action, but when the server pass throw interceptor and back to action, all my var are null, this is my struts.xml
>
> <!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN" "http://struts.apache.org/dtds/struts-2.0.dtd"><struts>
> <package name="loginClienteAndUsuario"
> extends="struts-default">
> <interceptors>
> <interceptor name="loginUsuario"
> class="br.com.dnasolution.site.interceptor.LoginUsuarioInterceptor">
> </interceptor>
> <interceptor name="loginCliente"
> class="br.com.dnasolution.site.interceptor.LoginClienteInterceptor">
> </interceptor>
> <interceptor-stack name="myStack">
> <interceptor-ref name="loginCliente"/>
> <interceptor-ref name="loginUsuario"/>
> <interceptor-ref name="defaultStack"/>
> </interceptor-stack>
> </interceptors>
> <default-interceptor-ref name="myStack"/>
> <global-results>
> <result name="clienteNaoLogado">/jsp/usuario/loginUsuario.jsp</result>
> <result name="clienteNaoLogado">/jsp/cliente/loginCliente.jsp</result>
> </global-results>
>
> </package>
> </struts>
>
>
> tks
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org