Test.jsp revision ada1678a4262b208a7b87391f520a7767d25287c
2N/A<%--
2N/A
2N/A DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
2N/A
2N/A Copyright (c) 2010 Oracle and/or its affiliates. All rights reserved.
2N/A
2N/A The contents of this file are subject to the terms of either the GNU
2N/A General Public License Version 2 only ("GPL") or the Common Development
2N/A and Distribution License("CDDL") (collectively, the "License"). You
2N/A may not use this file except in compliance with the License. You can
2N/A obtain a copy of the License at
2N/A https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html
2N/A or packager/legal/LICENSE.txt. See the License for the specific
2N/A language governing permissions and limitations under the License.
2N/A
2N/A When distributing the software, include this License Header Notice in each
2N/A file and include the License file at packager/legal/LICENSE.txt.
2N/A
2N/A GPL Classpath Exception:
2N/A Oracle designates this particular file as subject to the "Classpath"
2N/A exception as provided by Oracle in the GPL Version 2 section of the License
2N/A file that accompanied this code.
2N/A
2N/A Modifications:
2N/A If applicable, add the following below the License Header, with the fields
2N/A enclosed by brackets [] replaced by your own identifying information:
2N/A "Portions Copyright [year] [name of copyright owner]"
2N/A
2N/A Contributor(s):
2N/A If you wish your version of this file to be governed by only the CDDL or
2N/A only the GPL Version 2, indicate your decision by adding "[Contributor]
2N/A elects to include this software in this distribution under the [CDDL or GPL
2N/A Version 2] license." If you don't indicate a single choice of license, a
2N/A recipient has the option to distribute your version of this file under
2N/A either the CDDL, the GPL Version 2 or to extend the choice of license to
2N/A its licensees as provided above. However, if you add GPL Version 2 code
2N/A and therefore, elected the GPL Version 2 license, then the option applies
2N/A only if the new code is made subject to such option by the copyright
2N/A holder.
2N/A
2N/A--%>
2N/A
2N/A<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
2N/A<html>
2N/A<head>
2N/A<META HTTP-EQUIV="pragma" CONTENT="no-cache">
2N/A
2N/A<title>simple auth quicklook test</title>
2N/A</head>
2N/A<body>
2N/A
2N/A<%@ page import="java.security.Principal" %>
2N/A
2N/A<HR>
2N/A<BR>
2N/A
2N/A<P>Will attempt to retrieve getUserPrincipal() now.
2N/A
2N/A<%
2N/A String user = null;
2N/A Principal userp = request.getUserPrincipal();
2N/A String method = request.getAuthType();
2N/A if (userp != null) {
2N/A user = userp.toString();
2N/A }
2N/A
%>
<!-- the lines within pre block are parsed by WebTest. -->
<br>
<pre>
RESULT: principal: <%= user %>
RESULT: authtype: <%= method %>
</pre>
</body>
</html>