Partial AJAX calls don't handle container session timeouts

UI Components for JSF
Post Reply
goggy
Posts: 3
Joined: 20 Apr 2012, 14:29

07 May 2012, 13:04

I haven't even got to the login stage and I'm already having problems with ViewExpiredException. I need a simple master-detail tables. One big (master) table that I fill from DB (about 1000 records) and one small table that fills after you click on a row in a master table. My problem is RowSelectEvent. It fires with no problem on small tables (a few columns and rows) but it stops working when table is a little bigger. I checked the response of POST request with Firebug and found the problem

Code: Select all

<?xml version='1.0' encoding='UTF-8'?>
<partial-response><error><error-name>class javax.faces.application.ViewExpiredException</error-name><error-message><![CDATA[viewId:/index.jsf - View /index.jsf could not be restored.]]></error-message></error></partial-response>


My index.xhtml:

Code: Select all

<h:body>
	<h:form>
		<p:dataTable id="dataTbl" var="item" value="#{indexBean.itemModel}"
				selection="#{indexBean.selected}" selectionMode="single">
			
			<p:ajax event="rowSelect" listener="#{indexBean.onRowSelect}"/>
		
			<p:column headerText="Col1">
				#{item.param1}
			</p:column>
			<p:column headerText="Col2">
				#{item.param2}
			</p:column>
			<p:column headerText="Col3">
				#{item.param3}
			</p:column>
			<p:column headerText="Col4">
				#{item.param4}
			</p:column>
			<p:column headerText="Col5">
				#{item.param5}
			</p:column>
		</p:dataTable>
	</h:form>
</h:body>
and my IndexBean

Code: Select all

@ManagedBean
@ApplicationScoped
public class IndexBean {

	private List<TableItem> itemList;
	private TableItemModel itemModel;
	
	private TableItem selected;
	
	public IndexBean() {
		itemList = new ArrayList<TableItem>();
		
		TableItem item = new TableItem();
		for (int i = 0; i < 100; i++) {
			item = new TableItem();
			item.setParam1(i);
			item.setParam2("test2");
			item.setParam3("test3");
			item.setParam4("test4");
			item.setParam5("test5");
			
			itemList.add(item);
		}
		
		itemModel = new TableItemModel(itemList);
	}

	public TableItemModel getItemModel() {
		return itemModel;
	}

	public TableItem getSelected() {
		return selected;
	}

	public void setSelected(TableItem selected) {
		this.selected = selected;
	}
	
	public void onRowSelect(SelectEvent se) {
		System.out.println("It works!!!!");
	}
}
The above example doesn't get to onRowSelect() method, but if you add

Code: Select all

 paginator="true" rows="10" 
to dataTable tag, it will start working.
I'm using PF-3.2, JSF-2.0 and Weblogic Server 12c.

Any ideas???

Regards

kgalal
Posts: 1
Joined: 11 Jul 2012, 11:18

11 Jul 2012, 11:40

optimus.prime wrote:Here is my example I've just applied to showcase to handle session timeouts and viewexpired exceptions;

ShowcaseExceptionHandlerFactory

Code: Select all

package org.primefaces.examples.application;

import javax.faces.context.ExceptionHandler;
import javax.faces.context.ExceptionHandlerFactory;

public class ShowcaseExceptionHandlerFactory extends ExceptionHandlerFactory {

    private ExceptionHandlerFactory base;
    
    public ShowcaseExceptionHandlerFactory(ExceptionHandlerFactory base) {
        this.base = base;
    }
    
    @Override
    public ExceptionHandler getExceptionHandler() {
        return new ShowcaseExceptionHandler(base.getExceptionHandler());
    }
    
}
ShowcaseExceptionHandler

Code: Select all

package org.primefaces.examples.application;

import java.util.Iterator;
import javax.faces.FacesException;
import javax.faces.application.NavigationHandler;
import javax.faces.application.ViewExpiredException;
import javax.faces.context.ExceptionHandler;
import javax.faces.context.ExceptionHandlerWrapper;
import javax.faces.context.FacesContext;
import javax.faces.event.ExceptionQueuedEvent;
import javax.faces.event.ExceptionQueuedEventContext;

public class ShowcaseExceptionHandler extends ExceptionHandlerWrapper {

    private ExceptionHandler wrapped;

    public ShowcaseExceptionHandler(ExceptionHandler wrapped) {
        this.wrapped = wrapped;
    }

    @Override
    public ExceptionHandler getWrapped() {
        return this.wrapped;
    }

    @Override
    public void handle() throws FacesException {
        Iterable<ExceptionQueuedEvent> events = this.wrapped.getUnhandledExceptionQueuedEvents();
        for(Iterator<ExceptionQueuedEvent> it = events.iterator(); it.hasNext();) {
            ExceptionQueuedEvent event = it.next();
            ExceptionQueuedEventContext eqec = event.getContext();
            
            if(eqec.getException() instanceof ViewExpiredException) {
                FacesContext context = eqec.getContext();
                NavigationHandler navHandler = context.getApplication().getNavigationHandler();
 
                try {
                    navHandler.handleNavigation(context, null, "home?faces-redirect=true&expired=true");
                }
                finally {
                    it.remove();
                }
            }
        }

        this.wrapped.handle();;
    }
}
faces-config.xml

Code: Select all

    <factory>
        <exception-handler-factory>org.primefaces.examples.application.ShowcaseExceptionHandlerFactory</exception-handler-factory>
    </factory>
UI

User is redirected to home page when session timeouts or view expires so following dialog popups at home.xhtml;

Code: Select all

<p:confirmDialog header="Oooops!!!" severity="alert" 
                         visible="#{not empty param['expired']}" 
                         message="View has expired." widgetVar="confirmDlg">
            <p:commandButton type="button" value="Whatever" onclick="confirmDlg.hide()" />
        </p:confirmDialog>
Image
Hello optimus.prime,

Actually I am trying to apply your solution but I get the below exception thrown.

Code: Select all

12/07/11 12:31:26 javax.faces.FacesException
12/07/11 12:31:26 	at com.sun.faces.lifecycle.ApplyRequestValuesPhase.execute(ApplyRequestValuesPhase.java:86)
12/07/11 12:31:26 	at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
12/07/11 12:31:26 	at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
12/07/11 12:31:26 	at javax.faces.webapp.FacesServlet.service(FacesServlet.java:508)
12/07/11 12:31:26 	at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:64)
12/07/11 12:31:26 	at org.primefaces.webapp.filter.FileUploadFilter.doFilter(FileUploadFilter.java:79)
12/07/11 12:31:26 	at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:644)
12/07/11 12:31:26 	at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:391)
12/07/11 12:31:26 	at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:908)
12/07/11 12:31:26 	at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:458)
12/07/11 12:31:26 	at com.evermind.server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:226)
12/07/11 12:31:26 	at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:127)
12/07/11 12:31:26 	at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:117)
12/07/11 12:31:26 	at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
12/07/11 12:31:26 	at oracle.oc4j.network.ServerSocketAcceptHandler.procClientSocket(ServerSocketAcceptHandler.java:234)
12/07/11 12:31:26 	at oracle.oc4j.network.ServerSocketAcceptHandler.access$700(ServerSocketAcceptHandler.java:29)
12/07/11 12:31:26 	at oracle.oc4j.network.ServerSocketAcceptHandler$AcceptHandlerHorse.run(ServerSocketAcceptHandler.java:880)
12/07/11 12:31:26 	at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
12/07/11 12:31:26 	at java.lang.Thread.run(Thread.java:619)
12/07/11 12:31:26 Caused by: java.lang.NullPointerException
12/07/11 12:31:26 	at com.sun.faces.lifecycle.ApplyRequestValuesPhase.execute(ApplyRequestValuesPhase.java:78)
12/07/11 12:31:26 	at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
12/07/11 12:31:26 	at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
12/07/11 12:31:26 	at javax.faces.webapp.FacesServlet.service(FacesServlet.java:508)
12/07/11 12:31:26 	at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:64)
12/07/11 12:31:26 	at org.primefaces.webapp.filter.FileUploadFilter.doFilter(FileUploadFilter.java:79)
12/07/11 12:31:26 	at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:644)
12/07/11 12:31:26 	at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:391)
12/07/11 12:31:26 	at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:908)
12/07/11 12:31:26 	at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:458)
12/07/11 12:31:26 	at com.evermind.server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:226)
12/07/11 12:31:26 	at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:127)
12/07/11 12:31:26 	at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:116)
12/07/11 12:31:26 	at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
12/07/11 12:31:26 	at oracle.oc4j.network.ServerSocketAcceptHandler.procClientSocket(ServerSocketAcceptHandler.java:234)
12/07/11 12:31:26 	at oracle.oc4j.network.ServerSocketAcceptHandler.access$700(ServerSocketAcceptHandler.java:29)
12/07/11 12:31:26 	at oracle.oc4j.network.ServerSocketAcceptHandler$AcceptHandlerHorse.run(ServerSocketAcceptHandler.java:879)
12/07/11 12:31:26 	... 2 more
Here is the ViewExpiredExceptionExceptionHandler class:

Code: Select all

public class ViewExpiredExceptionExceptionHandler extends ExceptionHandlerWrapper {

    private ExceptionHandler wrapped;

    public ViewExpiredExceptionExceptionHandler(ExceptionHandler wrapped) {
        this.wrapped = wrapped;
    }

    @Override
    public ExceptionHandler getWrapped() {
        return this.wrapped;
    }

    @Override
    public void handle() throws FacesException {
    	Iterable<ExceptionQueuedEvent> events = this.wrapped.getUnhandledExceptionQueuedEvents();
        for(Iterator<ExceptionQueuedEvent> it = events.iterator(); it.hasNext();) {
            ExceptionQueuedEvent event = it.next();
            ExceptionQueuedEventContext eqec = event.getContext();

            if(eqec.getException() instanceof ViewExpiredException) {
                FacesContext context = eqec.getContext();
                NavigationHandler navHandler = context.getApplication().getNavigationHandler();

                try {
                    navHandler.handleNavigation(context, null, "viewExpired?faces-redirect=true&expired=true");
                }
                catch (Exception e) {
					e.printStackTrace();
				}
                finally {
                    it.remove();
                }
            }
        }

        this.wrapped.handle();
    }
}
And here is the faces-config.xml file:

Code: Select all

<?xml version="1.0"?>
<faces-config version="2.0" xmlns="http://java.sun.com/xml/ns/javaee"
	xmlns:xi="http://www.w3.org/2001/XInclude" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd">
	
	<converter>
	  <converter-id>custAlertCategoriesConverter</converter-id>
	  <converter-class>converters.CustAlertCategoriesConverter</converter-class>
	</converter>
	
	<factory>
      <exception-handler-factory>exceptions.ViewExpiredExceptionExceptionHandlerFactory</exception-handler-factory>
  	</factory>
	
	<navigation-rule>
		<navigation-case>
			<from-outcome>logout</from-outcome>
			<to-view-id>/login.xhtml</to-view-id>
			<redirect />
		</navigation-case>
		<navigation-case>
			<from-outcome>home</from-outcome>
			<to-view-id>/home.xhtml</to-view-id>
			<redirect />
		</navigation-case>
		<navigation-case>
			<from-outcome>alertCategory</from-outcome>
			<to-view-id>/alertCategory.xhtml</to-view-id>
			<redirect />
		</navigation-case>
		<navigation-case>
			<from-outcome>partialParts</from-outcome>
			<to-view-id>/partialParts.xhtml</to-view-id>
			<redirect />
		</navigation-case>
		<navigation-case>
			<from-outcome>viewExpired</from-outcome>
			<to-view-id>/viewExpired.xhtml</to-view-id>
		</navigation-case>
	</navigation-rule>
</faces-config>
And here is the web.xml file:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">
  <display-name>AlertSystem</display-name>
  
	<context-param>
		<param-name>javax.faces.PARTIAL_STATE_SAVING</param-name>
		<param-value>false</param-value>
	</context-param>
	
	<context-param>
		<param-name>javax.faces.STATE_SAVING_METHOD</param-name>
		<param-value>server</param-value>
	</context-param>
	<context-param>
		<param-name>javax.faces.CONFIG_FILES</param-name>
		<param-value>/WEB-INF/faces-config.xml</param-value>
	</context-param>
	<context-param>
		<param-name>javax.faces.PROJECT_STAGE</param-name>
		<param-value>Development</param-value>
	</context-param>
	

	<error-page>
		<exception-type>javax.faces.application.ViewExpiredException</exception-type>
		<location>/faces/viewExpired.xhtml</location>
	</error-page>
  
  	<servlet>
		<servlet-name>Faces Servlet</servlet-name>
		<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
		<load-on-startup>250</load-on-startup>
	</servlet>
	
	<servlet-mapping>
		<servlet-name>Faces Servlet</servlet-name>
		<url-pattern>/faces/*</url-pattern>
	</servlet-mapping>
	
	<filter>
	    <filter-name>PrimeFaces FileUpload Filter</filter-name>
	    <filter-class>org.primefaces.webapp.filter.FileUploadFilter</filter-class>
	</filter>
	<filter-mapping>
	    <filter-name>PrimeFaces FileUpload Filter</filter-name>
	    <servlet-name>Faces Servlet</servlet-name>
	</filter-mapping>
	
	<session-config>
		<session-timeout>1</session-timeout>
	</session-config>
	<mime-mapping>
		<extension>html</extension>
		<mime-type>text/html</mime-type>
	</mime-mapping>
	<mime-mapping>
		<extension>txt</extension>
		<mime-type>text/plain</mime-type>
	</mime-mapping>
	<mime-mapping>
		<extension>xls</extension>
		<mime-type>application/vnd.ms-excel</mime-type>
	</mime-mapping>
  
  <welcome-file-list>
    <welcome-file>index.jsp</welcome-file>    
  </welcome-file-list>
</web-app>
I appreciate your help.

Thanks.

smithh032772
Posts: 6144
Joined: 10 Sep 2011, 21:10

28 Oct 2012, 04:01

Howard

PrimeFaces 6.0, Extensions 6.0.0, Push (Atmosphere 2.4.0)
TomEE+ 1.7.4 (Tomcat 7.0.68), MyFaces Core 2.2.9, JDK8
JUEL 2.2.7 | OmniFaces | EclipseLink-JPA/Derby | Chrome

Java EE 6 Tutorial|NetBeans|Google|Stackoverflow|PrimeFaces|Apache

User avatar
andyba
Expert Member
Posts: 2473
Joined: 31 Mar 2011, 16:27
Location: Steinfeld, near Bremen/Osnabrück, DE
Contact:

29 Oct 2012, 14:43

smithh032772 wrote:Try this, this is awesome!

https://snapshot-omnifaces.rhcloud.com/ ... View.xhtml
I use Omnifaces, it takes all the guesswork out of things like this and leaves me free to do more creative stuff elsewhere.
PF 4.x (Elite versions), PF 5, Pf 5.1, PF 6.0
Glassfish 4.1, Mojarra 2.x, Java 8, Payara 4.1.1.
If you haven't read the forum rules read them now

ribcakes
Posts: 3
Joined: 23 Oct 2012, 07:58

18 Nov 2012, 22:49

mores wrote:What if the webapp is protected by a filter like http://www.jasig.org/cas

The session is gone then the filter will redirect to a login page. The exception-handler-factory can never actually be called.

CAS works well for non-ajax requests but fails when using a ajax page.

What changes would need to occur on the CAS filter such that primefaces sees the redirect when using ajax ?
Or is something else needed in primefaces to catch the redirect ?
I just came across this problem myself and wanted to share my Frankenstein solution in case anyone had any better ideas / anyone still stuck on what to do about Jasig CAS & Ajax in jsf

I took BalusC's advice and made my own custom filter that will run before the CAS filters.
I took some code from the CAS HttpServletRequestWrapperFilter that it uses to get the remote user and used that to check if there was a remote user in the request. This seems to work for my application, and I haven't had any problems with it, but as I said, it is slightly Frankenstein-ed together:

Code: Select all

/**
 * This {@link Filter} is designed to be used in conjunction with a CAS Service.
 * This filter will check all ajax requests to ensure that a remote user is
 * defined in the {@link ServletRequest} or will redirect the user back to the
 * CAS logon page for this application.
 */
public class AjaxCas implements Filter
{
	@Override
	public void destroy()
	{
		// nothing to do
	}

	/**
	 * Executes the logic for this filter.
	 */
	@Override
	public void doFilter(ServletRequest request, ServletResponse response,
			FilterChain chain) throws IOException, ServletException
	{
		// check to see if the request was an ajax request
		boolean ajax = "partial/ajax".equals(((HttpServletRequest) request)
				.getHeader("Faces-Request"));

		// if it wasn't an ajax request, or there was a remote user found in the
		// request, continue with the filter chain
		if (!ajax || hasRemoteUser(request))
		{
			chain.doFilter(request, response);
		}
		
		//otherwise redirect the user to the CAS login
		else
		{
			if (ajax)
			{
				response.setContentType("text/xml");
				response.getWriter()
						.append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>")
						.printf("<partial-response><redirect url=\"%s\"></redirect></partial-response>",
								URL.CAS_LOGIN.getLocation());
			}
			else
			{
				((HttpServletResponse) response)
						.sendRedirect(URL.CAS_LOGIN.getLocation());
			}
		}


	}

	@Override
	public void init(FilterConfig config) throws ServletException
	{
		// nothing to do
	}

	/**
	 * This method uses the same code in the
	 * {@link HttpServletRequestWrapperFilter} to check for the presence of an
	 * authenticated user.
	 * 
	 * @param servletRequest
	 *            the {@link ServletRequest} to check
	 * @return whether or not an authenticated user was found
	 */
	private boolean hasRemoteUser(ServletRequest servletRequest)
	{
		final HttpServletRequest request = (HttpServletRequest) servletRequest;
		final HttpSession session = request.getSession(false);
		final Assertion assertion = (Assertion) (session == null ? request
				.getAttribute(AbstractCasFilter.CONST_CAS_ASSERTION) : session
				.getAttribute(AbstractCasFilter.CONST_CAS_ASSERTION));
		final AttributePrincipal principal = assertion == null ? null
				: assertion.getPrincipal();
		String remoteUser = principal != null ? principal.getName() : null;


		return remoteUser != null;
	}
}
Then all I needed to do was put something like this before the CAS filters:

Code: Select all

	<filter>
		<filter-name>Ajax CAS Filter</filter-name>
		<filter-class>myPackage.filters.AjaxCas</filter-class>
	</filter>
	<filter-mapping>
		<filter-name>Ajax CAS Filter</filter-name>
		<url-pattern>/*</url-pattern>
	</filter-mapping>

rosière
Posts: 92
Joined: 28 Nov 2012, 15:55
Contact:

16 Aug 2013, 12:42

Hello,

I'm also developing a web app while my glassfish is protected by cas jasig SSO framework.
Then I noticed that cas jasig prevents me from uploading any file with p:fileUpload. Only by removing cas jasig from
glassfish am I able to upload files.

Would anyone please tell me how to get through?
mores wrote:What if the webapp is protected by a filter like http://www.jasig.org/cas

The session is gone then the filter will redirect to a login page. The exception-handler-factory can never actually be called.

CAS works well for non-ajax requests but fails when using a ajax page.

What changes would need to occur on the CAS filter such that primefaces sees the redirect when using ajax ?
Or is something else needed in primefaces to catch the redirect ?
JDK: 1.8
Operating system: Windows 10
server: 4.1.1.171 #badassfish (build 136)
IDE: NetBeans 11.2
primefaces : version 6.0
primefaces extensions : 4.0.0
Apache Poi: 3.15

smithh032772
Posts: 6144
Joined: 10 Sep 2011, 21:10

16 Aug 2013, 13:13

rosière wrote:Would anyone please tell me how to get through?
Forum-posting rules require that you create a new topic when asking your question instead of resurrecting old/dead topics. In your new topic, feel free to provide the URL to this forum topic (and/or a response to this forum topic).
Howard

PrimeFaces 6.0, Extensions 6.0.0, Push (Atmosphere 2.4.0)
TomEE+ 1.7.4 (Tomcat 7.0.68), MyFaces Core 2.2.9, JDK8
JUEL 2.2.7 | OmniFaces | EclipseLink-JPA/Derby | Chrome

Java EE 6 Tutorial|NetBeans|Google|Stackoverflow|PrimeFaces|Apache

kukeltje
Expert Member
Posts: 9605
Joined: 17 Jun 2010, 13:34
Location: Netherlands

16 Aug 2013, 16:05

What changes would need to occur on the CAS filter such that primefaces sees the redirect when using ajax ?
This is the pointer to the solution... Same needs to be done for Shiro, but the redirect is not done by this primefaces but by this adapted filter

http://balusc.blogspot.nl/2013/01/apach ... Expiration

davidfdr
Posts: 10
Joined: 05 Jul 2013, 01:20
Location: BRAZIL

01 Nov 2013, 16:00

ribcakes wrote:
mores wrote:What if the webapp is protected by a filter like http://www.jasig.org/cas

The session is gone then the filter will redirect to a login page. The exception-handler-factory can never actually be called.

CAS works well for non-ajax requests but fails when using a ajax page.
...
In my case the page is protected with JAAS (JBOSS AS 7 + PRIMEFACES 4).

I was unable to build a filter to handle ajax requests and check if the user is logged in (pre filter j_security_check).

The response from ajax calls:

Code: Select all

<?xml version='1.0' encoding='UTF-8'?>
<partial-response><changes><update id="javax.faces.ViewState"><![CDATA[-5436816145615382846:4622433328007168648]]></update></changes></partial-response>
With this I can 't handle the redirec to the login page....
Jboss as 7.1.1 / EAP 6 / Tomcat 7
Fedora 19 / Firefox 24 / Chrome 30.0.1599.66
Primefaces 4.0 / Mojarra 2.1.x
Kernel 3.11.2-201.fc19.x86_64 - Linux for workgroups :)

mores
Posts: 64
Joined: 01 Dec 2010, 05:04

13 Nov 2013, 21:18

mores wrote:What if the webapp is protected by a filter like http://www.jasig.org/cas

The session is gone then the filter will redirect to a login page. The exception-handler-factory can never actually be called.

CAS works well for non-ajax requests but fails when using a ajax page.

What changes would need to occur on the CAS filter such that primefaces sees the redirect when using ajax ?
Or is something else needed in primefaces to catch the redirect ?
Documenting my fix for others to find...
java-cas-client version 3.3.0 will include a new FacesCompatibleAuthenticationRedirectStrategy
https://github.com/Jasig/java-cas-client/pull/49
prime faces 7.0.11
jsf 2.3.9
tomcat 9.0.50

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 23 guests