I have tried code in different ways and it is still giving me the exception
it is not able to redirect.

Any docs on implementing response.sendDirect in a Valve?
Thanks in advance.

Thanks,
Santosh

-----Original Message-----
From: Sahu, Santosh [mailto:[EMAIL PROTECTED] 
Sent: Thursday, August 24, 2006 4:49 PM
To: 'Jetspeed Developers List'
Subject: RE: Valves,


I think reponce is being committed at ActionValve.
So as you have seen my code do you think If I use that code and call that
valve before actionVale it will work.

For me it is saying it couldn't find the PSML page if I do that. That PSML
page is in the default directory.

If you look at my code I am redirecting using BasePath.

And if possible and if you are ok can I see the webkeyValve code plz.

Thank you.

santosh

-----Original Message-----
From: Scott T Weaver [mailto:[EMAIL PROTECTED] 
Sent: Thursday, August 24, 2006 4:43 PM
To: 'Jetspeed Developers List'
Subject: RE: Valves,


Personally, I use response.sendRedirect for my custom security valve which
redirects users to a federated login page.  Here is my pipleing config:

  <bean id="ugs-webkey-pipeline"
        class="org.apache.jetspeed.pipeline.JetspeedPipeline"
        init-method="initialize"        
  >
   <constructor-arg>
        <value>UGSWebkeyPipeline</value>
   </constructor-arg>
   <constructor-arg>
    <list>
        <ref bean="webkeyValve"/> 
        <ref bean="localeSelectorValve" />
        <ref bean="localizationValve"/>
        <ref bean="capabilityValve"/>
      <ref bean="portalURLValve"/>
        <ref bean="profilerValve"/>             
      <ref bean="customizerValve"/>
        <ref bean="containerValve"/>
        <ref bean="actionValve"/>
        <ref bean="DecorationValve" />
        <ref bean="aggregatorValve"/>
        <ref bean="cleanUpValve"/>
    </list>
    </constructor-arg>
  </bean>   
  
As for the position in the pipeline, you can see mine is the first valve.
For redirects, you should be able to do this prior to the response being
committed.  I am not entirely sure which valve in the default J2 pipeline
commits the response, but I am guessing it happens in one of these:
aggregatorValve, actionValve or conatinerValve.

-scott

> -----Original Message-----
> From: Sahu, Santosh [mailto:[EMAIL PROTECTED]
> Sent: Thursday, August 24, 2006 11:33 AM
> To: 'Jetspeed Developers List'
> Subject: Valves,
> 
> 
> Folks,
> Any help is appreciated.
> I am trying to write my own valve and put it in the jetspeed piple line.
> 
> Question is I want to call this for every request and up on a conditions
> success redirect to a page. What is the best option ? Is to use
> response.sendRedirect or use PageProfiler to do the job.
> If it is response.sendRedirect then when I need to call this valve in the
> pipeline?
> If it is Page profiler when I need to call.
> 
> Code:
> public void invoke(RequestContext request, ValveContext context) throws
> PipelineException
>       {
>               log.info("in Invoke -TCValveImpl");
>               try
>               {
>               //Get the Authenticated Used Id
>               //If(userId not null){
>               //Call ITermsAndConditions to check the whether this user
> accepted TC
>               //if Accepted {
>               //context.invokeNext(request);
>               //}
>               //else
>               HttpServletResponse resp = request.getResponse();
>               String basePath=request.getPortalURL().getBasePath();
>               //Get the LoginPage PSML file name from property file (can
> be from spring xml files)
>               resp.sendRedirect(basePath+"/login.psml");
>               }catch(Exception e)
>               {
>                       e.printStackTrace();
>               }
>        }


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to