From 92bb80d72d0aff0c193325f11edcd96dfe7b83a4 Mon Sep 17 00:00:00 2001 From: maxcooper Date: Sat, 14 Jun 2003 14:10:42 +0000 Subject: [PATCH] added elements for POST method testing --- src/example/org/securityfilter/example/Constants.java | 18 ++++++++++++------ web/share/index.jsp | 9 +++++++++ web/share/logout.jsp | 9 +++++++-- web/share/securePage.jsp | 10 ++++++++++ 4 files changed, 38 insertions(+), 8 deletions(-) diff --git a/src/example/org/securityfilter/example/Constants.java b/src/example/org/securityfilter/example/Constants.java index 1568297..0fa4ebd 100644 --- a/src/example/org/securityfilter/example/Constants.java +++ b/src/example/org/securityfilter/example/Constants.java @@ -1,7 +1,7 @@ /* - * $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 @@ -59,7 +59,7 @@ package org.securityfilter.example; * 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 { @@ -71,14 +71,20 @@ 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"; } diff --git a/web/share/index.jsp b/web/share/index.jsp index 55b7995..6a1f05d 100644 --- a/web/share/index.jsp +++ b/web/share/index.jsp @@ -9,5 +9,14 @@

<%=Constants.HOME_TITLE%>

<%@include file="/menu.jsp" %> Welcome to the Security Filter example application. Use the menu above to navigate the site. + +

POST to the Secure Page

+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. +
+ + +
+ \ No newline at end of file diff --git a/web/share/logout.jsp b/web/share/logout.jsp index d1cb839..3254a18 100644 --- a/web/share/logout.jsp +++ b/web/share/logout.jsp @@ -1,13 +1,18 @@ +<%@ page import="org.securityfilter.example.Constants"%> + + -SecurityFilter Example Application: Logout +<%=Constants.LOGOUT_TITLE%> + -

SecurityFilter Example Application: Logout

+

<%=Constants.LOGOUT_TITLE%>

<%@include file="/menu.jsp" %> <% session.invalidate(); %> You have been logged out of the SecurityFilter example application.

This operation was achieved with a simple call to session.invalidate(). + \ No newline at end of file diff --git a/web/share/securePage.jsp b/web/share/securePage.jsp index 0deaa05..159ca40 100644 --- a/web/share/securePage.jsp +++ b/web/share/securePage.jsp @@ -13,5 +13,15 @@ Welcome <%=request.getRemoteUser()%>, you are viewing a secure page. +<% + String postedValue = request.getParameter(Constants.HOME_POST_FIELD); + if (postedValue != null) { +%> +

You POSTed a value from the Home Page!

+The value you posted was "<%=postedValue%>". +<% + } +%> + \ No newline at end of file -- 2.11.0