struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nils-Helge Garli Hegvik <nil...@gmail.com>
Subject Re: System.out into interceptor
Date Mon, 16 Mar 2009 18:02:46 GMT
You're setting a request attribute, but trying to access a request
parameter. Also, I would recommend that you do not access the output
stream directly. I suggest you take some time to study some
servlet/jsp tutorials, and then move on to the Struts 2 bootstrap
guides.

Nils-H

On Mon, Mar 16, 2009 at 5:31 PM, PEGASUS84 <pegasus84@hotmail.it> wrote:
>
> that's right!
> now i realize this:
>
> import com.opensymphony.xwork2.ActionInvocation;
> import com.opensymphony.xwork2.interceptor.Interceptor;
> import com.opensymphony.xwork2.Action;
> import javax.servlet.http.HttpServletRequest;
> import com.opensymphony.xwork2.ActionContext;
> import java.util.*;
>
>
> public class filtro implements Interceptor {
>
> private HttpServletRequest request;
>  public void setServletRequest(HttpServletRequest request){
>    this.request = request;
>  }
>
>  public HttpServletRequest getServletRequest(){
>    return request;
>  }
>
>
>
> public void destroy() {
> }
> public void init() {
> }
> public String intercept( ActionInvocation actionInvocation) throws
> Exception{
>
> Map session = actionInvocation.getInvocationContext().getSession();
> utente user = (utente)session.get("autenticato");
> if (user != null)
>   request.setAttribute("ciao","condizione");
> return Action.ERROR;
>
>
> }
>
> }
>
> and into jsp page:
>
> <%out.print(request.getParameter("ciao"))%>
>
> but it doesn't work
> --
> View this message in context: http://www.nabble.com/System.out-into-interceptor-tp22535922p22541213.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> 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


Mime
View raw message