-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathLogoutPage.java
33 lines (29 loc) · 1.02 KB
/
LogoutPage.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/*
* © 2023 iamfortress.net
*/
package org.wicketsample;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.apache.wicket.markup.html.basic.Label;
import jakarta.servlet.http.HttpServletRequest;
/**
* The Wicket Sample web app will route user's to this page for logout.
* Although this page is important for page flow with regard to security, isn't itself secured by fortress or javaEE.
*
* @author Shawn McKinney
* @version $Rev$
*/
public class LogoutPage extends WicketSampleBasePage
{
private static final Logger LOG = LoggerFactory.getLogger( LogoutPage.class.getName() );
public LogoutPage()
{
HttpServletRequest servletReq = (HttpServletRequest)getRequest().getContainerRequest();
LOG.info( "logout user, route to login page" );
// invalidate the session and force the user to log back on:
servletReq.getSession().invalidate();
getSession().invalidate();
setResponsePage( LoginPage.class );
add(new Label("label1", "Select logout"));
}
}