portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Scott T Weaver" <scotts-jetspeed-l...@binary-designs.net>
Subject RE: Valves,
Date Thu, 24 Aug 2006 15:42:41 GMT
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"
    	<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"/>
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.


> -----Original Message-----
> From: Sahu, Santosh [mailto:Santosh.Sahu@ie.fid-intl.com]
> 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: jetspeed-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-dev-help@portals.apache.org

View raw message