Handles session timeouts much better now!

version2
Tim Holloway 2 years ago
parent 65acd42f11
commit ab9255d3d4
  1. 2
      src/main/java/com/mousetech/gourmetj/SpringPrimeFacesApplication.java
  2. 4
      src/main/java/com/mousetech/gourmetj/UserSession.java
  3. 17
      src/main/resources/META-INF/resources/WEB-INF/faces-config.xml
  4. 17
      src/main/resources/META-INF/resources/error/viewExpired.xhtml
  5. BIN
      src/main/resources/META-INF/resources/favicon.ico
  6. 2
      src/main/resources/META-INF/resources/recipeDetails.xhtml

@ -23,7 +23,7 @@ public class SpringPrimeFacesApplication {
final String errorPage = "/error/error.html";
final String error404Page = "/error/error404.html";
final String expiredPage = "/error/viewExpired.html";
final String expiredPage = "/error/viewExpired.xhtml";
public static void main(String[] args) {
SpringApplication.run(SpringPrimeFacesApplication.class,

@ -130,8 +130,8 @@ public class UserSession implements Serializable {
}
// Primefaces handle session timeout
// Session timeout, ms
long sessionTimeoutInterval = 30000L;
// Session timeout, ms (25 minutes)
long sessionTimeoutInterval = 25 * 60_000L;
/**
* @return the sessionTimeoutInterval

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<faces-config
xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee
http://xmlns.jcp.org/xml/ns/javaee/web-facesconfig_2_2.xsd"
version="2.2"
>
<name>GourmetJ</name>
<navigation-rule>
<from-view-id>*</from-view-id>
<navigation-case>
<from-outcome>home</from-outcome>
<to-view-id>/main.jsf</to-view-id>
</navigation-case>
</navigation-rule>
</faces-config>

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://xmlns.jcp.org/jsf/html"
xmlns:f="http://xmlns.jcp.org/jsf/core">
<h:head>
<title>View Expired</title>
</h:head>
<h:body>
<h2>View Expired.</h2>
<h:form>
The user session has timed out. Return to main page.
<h:commandButton value="OK" action="home"></h:commandButton>
</h:form>
</h:body>
</html>

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.4 KiB

@ -47,7 +47,7 @@
<p:commandButton
value="Back" ajax="false"
icon="ui-icon-arrowthick-1-w"
action="main.jsf"
action="home"
immediate="true"
/>
<p:commandButton ajax="false"

Loading…
Cancel
Save