- In order to see this page, you must have been JAAS authentictated using the
- configured Login Module. You have also been AUTHORIZED according to this webapp's role-based web security constraints.
-
+In order to see this page, you must have been JAAS authentictated using the
+configured Login Module. You have also been AUTHORIZED according to this webapp's role-based web security constraints.
+
Demo Web Application Only - Do NOT Deploy in Production
+
-
JAAS Authentication and Authorization Demo
-
Preparation
-
To enable JAAS in a base jetty instance do:
-
+
JAAS Authentication and Authorization Demo
+
Preparation
+
To enable JAAS in a base jetty instance do:
+
$ cd $JETTY_BASE
$ java -jar $JETTY_HOME/start.jar --add-module=jaas
-
-
This will create a $JETTY_BASE/start.d/jaas.ini file to enable and parameterize JAAS.
- The Jetty demo-base already has JAAS enabled by the demo-jaas module.
+
+
This will create a $JETTY_BASE/start.d/jaas.ini file to enable and parameterize JAAS.
+ This Jetty demo-jaas already has JAAS enabled by the demo-jaas module.
The full source of this demonstration is available here.
- Click on the link below to test JAAS authentication and role-based web security constraint authorization. Use username="me" with password="me". All other usernames, passwords should result in authentication failure.
-
- This demo uses a simple login module that stores its configuration in a properties file. There are other types of login
- module provided with the jetty distro. For full information, please refer to the
- Jetty 9 documentation.
-
+
Using the Demo
+
+ Click on the link below to test JAAS authentication and role-based web security constraint authorization. Use
+ username="me" with password="me". All other usernames, passwords should result in authentication
+ failure.
+
+ This demo uses a simple login module that stores its configuration in a properties file. There are other types of login
+ module provided with the jetty distro. For full information, please refer to the
+ Jetty 9 documentation.
+
-
-
+
+
-
-
+
+
diff --git a/demos/demo-jaas-webapp/src/main/webapp/login.html b/demos/demo-jaas-webapp/src/main/webapp/login.html
index 608ea5ec522..757e81fe8d3 100644
--- a/demos/demo-jaas-webapp/src/main/webapp/login.html
+++ b/demos/demo-jaas-webapp/src/main/webapp/login.html
@@ -1,18 +1,18 @@
-
- JAAS Authentication and Authorization Test
-
-
-
-
Enter your username and password to login
- Enter login=me and password=me in order to authenticate successfully
-
-
-
-
+
+
JAAS Authentication and Authorization Test
+
+
+
+
Enter your username and password to login
+ Enter login=me and password=me in order to authenticate successfully
+
+
+
+
diff --git a/demos/demo-jetty-webapp/src/main/java/com/acme/DispatchServlet.java b/demos/demo-jetty-webapp/src/main/java/com/acme/DispatchServlet.java
index ef107f5ed7e..0dc4fb51714 100644
--- a/demos/demo-jetty-webapp/src/main/java/com/acme/DispatchServlet.java
+++ b/demos/demo-jetty-webapp/src/main/java/com/acme/DispatchServlet.java
@@ -95,18 +95,18 @@ public class DispatchServlet extends HttpServlet
PrintWriter pout = null;
pout = sres.getWriter();
- pout.write("
Include (writer): " + info + "
");
+ pout.write("
Include (writer): " + info + "
");
RequestDispatcher dispatch = getServletContext().getRequestDispatcher(info);
if (dispatch == null)
{
pout = sres.getWriter();
- pout.write("
");
}
else if (info.startsWith("/includeS/"))
{
@@ -119,18 +119,18 @@ public class DispatchServlet extends HttpServlet
OutputStream out = null;
out = sres.getOutputStream();
- out.write(("
Include (outputstream): " + info + "
").getBytes());
+ out.write(("
Include (outputstream): " + info + "
").getBytes());
RequestDispatcher dispatch = getServletContext().getRequestDispatcher(info);
if (dispatch == null)
{
out = sres.getOutputStream();
- out.write("
".getBytes());
}
else if (info.startsWith("/forward/"))
{
@@ -162,7 +162,7 @@ public class DispatchServlet extends HttpServlet
{
sres.setContentType("text/html");
PrintWriter pout = sres.getWriter();
- pout.write("
No dispatcher for: " + info + "
");
+ pout.write("
No dispatcher for: " + info + "
");
pout.flush();
}
}
@@ -188,7 +188,7 @@ public class DispatchServlet extends HttpServlet
{
sres.setContentType("text/html");
PrintWriter pout = sres.getWriter();
- pout.write("
No dispatcher for: " + cpath + "/" + info + "
");
+ pout.write("
No dispatcher for: " + cpath + "/" + info + "
");
pout.flush();
}
}
@@ -205,7 +205,7 @@ public class DispatchServlet extends HttpServlet
else
{
pout = sres.getWriter();
- pout.write("
Include named: " + info + "
");
+ pout.write("
Include named: " + info + "
");
}
RequestDispatcher dispatch = getServletContext().getNamedDispatcher(info);
@@ -214,11 +214,11 @@ public class DispatchServlet extends HttpServlet
else
{
pout = sres.getWriter();
- pout.write("
No servlet named: " + info + "
");
+ pout.write("
No servlet named: " + info + "
");
}
pout = sres.getWriter();
- pout.write("
Included ");
+ pout.write("
Included ");
}
else if (info.startsWith("/forwardN/"))
{
@@ -232,7 +232,7 @@ public class DispatchServlet extends HttpServlet
{
sres.setContentType("text/html");
PrintWriter pout = sres.getWriter();
- pout.write("
No servlet named: " + info + "
");
+ pout.write("
No servlet named: " + info + "
");
pout.flush();
}
}
@@ -241,7 +241,7 @@ public class DispatchServlet extends HttpServlet
sres.setContentType("text/html");
PrintWriter pout = sres.getWriter();
pout.write(
- "
Dispatch URL must be of the form:
" +
+ "
Dispatch URL must be of the form:
" +
"
" +
prefix + "/includeW/path\n" +
prefix + "/includeS/path\n" +
diff --git a/demos/demo-jetty-webapp/src/main/java/com/acme/Dump.java b/demos/demo-jetty-webapp/src/main/java/com/acme/Dump.java
index a83c48447d9..e09d4135832 100644
--- a/demos/demo-jetty-webapp/src/main/java/com/acme/Dump.java
+++ b/demos/demo-jetty-webapp/src/main/java/com/acme/Dump.java
@@ -408,7 +408,7 @@ public class Dump extends HttpServlet
if (pi != null && pi.startsWith("/ex"))
{
OutputStream out = response.getOutputStream();
- out.write("
This text should be reset
".getBytes());
+ out.write("This text should be reset".getBytes());
if ("/ex0".equals(pi))
throw new ServletException("test ex0", new Throwable());
else if ("/ex1".equals(pi))
diff --git a/demos/demo-jetty-webapp/src/main/java/com/acme/SessionDump.java b/demos/demo-jetty-webapp/src/main/java/com/acme/SessionDump.java
index 366bcf52ef4..e79b447b8cb 100644
--- a/demos/demo-jetty-webapp/src/main/java/com/acme/SessionDump.java
+++ b/demos/demo-jetty-webapp/src/main/java/com/acme/SessionDump.java
@@ -131,7 +131,7 @@ public class SessionDump extends HttpServlet
if (session == null)
{
- out.println("
No Session
");
+ out.println("
No Session
");
out.println("");
}
else
@@ -167,10 +167,10 @@ public class SessionDump extends HttpServlet
out.println(" ");
if (request.isRequestedSessionIdFromCookie())
- out.println("
Turn off cookies in your browser to try url encoding ");
+ out.println("
Turn off cookies in your browser to try url encoding ");
if (request.isRequestedSessionIdFromURL())
- out.println("
Turn on cookies in your browser to try cookie encoding ");
+ out.println("
Turn on cookies in your browser to try cookie encoding ");
out.println("Encoded Link ");
}
catch (IllegalStateException e)
diff --git a/demos/demo-jetty-webapp/src/main/webapp/auth.html b/demos/demo-jetty-webapp/src/main/webapp/auth.html
index 3b55b767f39..79d66d7ab3a 100644
--- a/demos/demo-jetty-webapp/src/main/webapp/auth.html
+++ b/demos/demo-jetty-webapp/src/main/webapp/auth.html
@@ -1,36 +1,36 @@
-
-
custom 404 page
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/demos/demo-jetty-webapp/src/main/webapp/index.html b/demos/demo-jetty-webapp/src/main/webapp/index.html
index 9539d74557c..459bd44dc69 100644
--- a/demos/demo-jetty-webapp/src/main/webapp/index.html
+++ b/demos/demo-jetty-webapp/src/main/webapp/index.html
@@ -1,25 +1,27 @@
-
-
- Powered By Jetty
-
-
-
-
-
-
-
- Demo Home
-
-
Test Web Application Only - Do NOT Deploy in Production
Demo Web Application Only - Do NOT Deploy in Production
+
+
+
Welcome to Eclipse Jetty
-This is the Test webapp for the Jetty HTTP Server and Servlet Container.
-It is configured as a jetty base directory in $JETTY_HOME/demo_base.
+ This is the Demo webapp for the Eclipse Jetty HTTP Server and Servlet Container.
+ It was added into your $JETTY_BASE/webapps directory.
Jetty Tests:
@@ -56,17 +58,16 @@ It is configured as a jetty base directory in $JETTY_HOME/demo_base.