/*
- * $Header: /cvsroot/securityfilter/securityfilter/src/example/org/securityfilter/example/Constants.java,v 1.2 2003/06/09 12:05:17 maxcooper Exp $
- * $Revision: 1.2 $
- * $Date: 2003/06/09 12:05:17 $
+ * $Header: /cvsroot/securityfilter/securityfilter/src/example/org/securityfilter/example/Constants.java,v 1.3 2003/06/14 14:10:42 maxcooper Exp $
+ * $Revision: 1.3 $
+ * $Date: 2003/06/14 14:10:42 $
*
* ====================================================================
* The SecurityFilter Software License, Version 1.1
* Constants - constants for the example applications to facilitate testing
*
* @author Max Cooper (max@maxcooper.com)
- * @version $Revision: 1.2 $ $Date: 2003/06/09 12:05:17 $
+ * @version $Revision: 1.3 $ $Date: 2003/06/14 14:10:42 $
*/
public interface Constants {
// home page constants
public static final String HOME_TITLE = COMMON_TITLE_BASE + "Home";
-
+ public static final String HOME_FORM_ID = "homeForm";
+ public static final String HOME_POST_FIELD = "postMe";
+
// login form constants
public static final String LOGIN_TITLE = COMMON_TITLE_BASE + "Login Page";
- public static final String LOGIN_FORM_ID = "login";
+ public static final String LOGIN_FORM_ID = "loginForm";
public static final String LOGIN_FORM_ACTION = "j_security_check";
public static final String LOGIN_USERNAME_FIELD = "j_username";
public static final String LOGIN_PASSWORD_FIELD = "j_password";
// secure page constants
public static final String SECURE_TITLE = COMMON_TITLE_BASE + "Secure Page";
+ public static final String SECURE_POSTED_VALUE_ID = "postedValue";
+
+ // logout page constants
+ public static final String LOGOUT_TITLE = COMMON_TITLE_BASE + "Logout";
}
<h1><%=Constants.HOME_TITLE%></h1>
<%@include file="/menu.jsp" %>
Welcome to the Security Filter example application. Use the menu above to navigate the site.
+
+<h2>POST to the Secure Page</h2>
+This form POSTs to the Secure Page. By entering a value here and clicking the submit button below, you can
+verify that POSTed parameters are maintained through the login sequence.
+<form id="<%=Constants.HOME_FORM_ID%>" action="<%=request.getContextPath()%>/securePage.jsp" method="POST">
+<input type="text" name="<%=Constants.HOME_POST_FIELD%>">
+<input type="submit">
+</form>
+
</body>
</html>
\ No newline at end of file
+<%@ page import="org.securityfilter.example.Constants"%>
+
<html>
+
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<title>SecurityFilter Example Application: Logout</title>
+<title><%=Constants.LOGOUT_TITLE%></title>
</head>
+
<body>
-<h1>SecurityFilter Example Application: Logout</h1>
+<h1><%=Constants.LOGOUT_TITLE%></h1>
<%@include file="/menu.jsp" %>
<% session.invalidate(); %>
You have been logged out of the SecurityFilter example application.<p>
This operation was achieved with a simple call to <code>session.invalidate()</code>.
</body>
+
</html>
\ No newline at end of file
Welcome <i><%=request.getRemoteUser()%></i>, you are viewing a secure page.
+<%
+ String postedValue = request.getParameter(Constants.HOME_POST_FIELD);
+ if (postedValue != null) {
+%>
+<h2>You POSTed a value from the Home Page!</h2>
+The value you posted was "<span id="<%=Constants.SECURE_POSTED_VALUE_ID%>"><%=postedValue%></span>".
+<%
+ }
+%>
+
</body>
</html>
\ No newline at end of file