source: nutchez-0.1/tomcat/webapps/examples/jsp/security/protected/index.jsp.html @ 261

Last change on this file since 261 was 66, checked in by waue, 16 years ago

NutchEz - an easy way to nutch

File size: 2.4 KB
RevLine 
[66]1<html><body><pre>
2&lt;!--
3 Licensed to the Apache Software Foundation (ASF) under one or more
4  contributor license agreements.  See the NOTICE file distributed with
5  this work for additional information regarding copyright ownership.
6  The ASF licenses this file to You under the Apache License, Version 2.0
7  (the "License"); you may not use this file except in compliance with
8  the License.  You may obtain a copy of the License at
9
10      http://www.apache.org/licenses/LICENSE-2.0
11
12  Unless required by applicable law or agreed to in writing, software
13  distributed under the License is distributed on an "AS IS" BASIS,
14  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  See the License for the specific language governing permissions and
16  limitations under the License.
17-->
18&lt;%
19  if (request.getParameter("logoff") != null) {
20    session.invalidate();
21    response.sendRedirect("index.jsp");
22    return;
23  }
24%>
25&lt;html>
26&lt;head>
27&lt;title>Protected Page for Examples&lt;/title>
28&lt;/head>
29&lt;body bgcolor="white">
30
31You are logged in as remote user
32&lt;b>&lt;%= util.HTMLFilter.filter(request.getRemoteUser()) %>&lt;/b>
33in session &lt;b>&lt;%= session.getId() %>&lt;/b>&lt;br>&lt;br>
34
35&lt;%
36  if (request.getUserPrincipal() != null) {
37%>
38    Your user principal name is
39    &lt;b>&lt;%= util.HTMLFilter.filter(request.getUserPrincipal().getName()) %>&lt;/b>
40    &lt;br>&lt;br>
41&lt;%
42  } else {
43%>
44    No user principal could be identified.&lt;br>&lt;br>
45&lt;%
46  }
47%>
48
49&lt;%
50  String role = request.getParameter("role");
51  if (role == null)
52    role = "";
53  if (role.length() > 0) {
54    if (request.isUserInRole(role)) {
55%>
56      You have been granted role
57      &lt;b>&lt;%= util.HTMLFilter.filter(role) %>&lt;/b>&lt;br>&lt;br>
58&lt;%
59    } else {
60%>
61      You have &lt;i>not&lt;/i> been granted role
62      &lt;b>&lt;%= util.HTMLFilter.filter(role) %>&lt;/b>&lt;br>&lt;br>
63&lt;%
64    }
65  }
66%>
67
68To check whether your username has been granted a particular role,
69enter it here:
70&lt;form method="GET" action='&lt;%= response.encodeURL("index.jsp") %>'>
71&lt;input type="text" name="role" value="&lt;%= util.HTMLFilter.filter(role) %>">
72&lt;/form>
73&lt;br>&lt;br>
74
75If you have configured this app for form-based authentication, you can log
76off by clicking
77&lt;a href='&lt;%= response.encodeURL("index.jsp?logoff=true") %>'>here&lt;/a>.
78This should cause you to be returned to the logon page after the redirect
79that is performed.
80
81&lt;/body>
82&lt;/html>
83</pre></body></html>
Note: See TracBrowser for help on using the repository browser.