diff --git a/demos/demo-async-rest/demo-async-rest-webapp/src/main/webapp/demo.css b/demos/demo-async-rest/demo-async-rest-webapp/src/main/webapp/demo.css new file mode 100644 index 000000000000..f2b91d3365d9 --- /dev/null +++ b/demos/demo-async-rest/demo-async-rest-webapp/src/main/webapp/demo.css @@ -0,0 +1,83 @@ +body +{ + font-family: Arial, Verdana, Helvetica, sans-serif; +} + +.topnav +{ + overflow: hidden; + padding: 10px; + border: 1px solid #f6815c; + border-radius: 10px; + text-align: right; +} + +.menu +{ + margin-left: 3em; +} + +.content +{ + padding: 10px; +} + +.footer +{ + padding: 10px; + border-radius: 10px; + border: 1px solid #f6815c; +} + +.test +{ + background-color: #0099cc; + color: white; + padding: 10px 15px; + border: none; + font-size: 12pt; + border-radius: 10px; + box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2), 0 3px 10px 0 rgba(0,0,0,0.19); +} + +.test:hover +{ + background-color: #f6815c; + color: white; +} + +A:link +{ + color: #0099cc; + text-decoration: none; + font-weight: normal; + font-size: 11pt; + font-family:sans-serif; +} + +A:visited +{ + color: #0099cc; + text-decoration: none; + font-weight: normal; + font-size: 11pt; + font-family:sans-serif; +} + +A:hover +{ + color: #ff6600; + text-decoration: none; + font-weight: normal; + font-size: 11pt; + font-family:sans-serif; +} + +A:active +{ + color: #0099cc; + text-decoration: none; + font-weight: normal; + font-size: 11pt; + font-family:sans-serif; +} diff --git a/demos/demo-async-rest/demo-async-rest-webapp/src/main/webapp/index.html b/demos/demo-async-rest/demo-async-rest-webapp/src/main/webapp/index.html index 70209dbc72d2..8709d30af636 100644 --- a/demos/demo-async-rest/demo-async-rest-webapp/src/main/webapp/index.html +++ b/demos/demo-async-rest/demo-async-rest-webapp/src/main/webapp/index.html @@ -1,44 +1,62 @@ + -

Blocking vs Asynchronous REST

-

-This demo calls the EBay WS API both synchronously and asynchronously, -to obtain items matching each of the keywords passed on the query -string. The time the request thread is held by the servlet is displayed in red for both. -

+
+ Demo Home + Source + Jetty Project Home + Documentation + Commercial Support +
- +
+
+ Demo Web Application Only - Do NOT Deploy in Production +
+ + +

Blocking vs Asynchronous REST

+

+ This demo calls the EBay WS API both synchronously and asynchronously, to obtain items matching each of the keywords passed on the query string. The time the request thread is held by the servlet is displayed in red for both. +

+ +
- - - - + + + + - - - - + + + + + +
- - - -
+ + + +
- - - -
+ + + +
+

+ By the use of Asynchronous Servlets and the Jetty Asynchronous client, the server is able to release the thread (green) while waiting for the response from Ebay. This thread goes back into the thread pool and can service many other requests during the wait. This greatly reduces the number of threads needed, which in turn greatly reduces the memory requirements of the server. +

+

+ Press your browser's reload button to see even better results after JIT and TCP/IP warmup! +

- -By the use of Asynchronous Servlets and the Jetty Asynchronous client, the server is able to release the thread (green) while -waiting for the response from Ebay. This thread goes back into the thread pool and can service many other requests during the wait. -This greatly reduces the number of threads needed, which in turn greatly reduces the memory requirements of the server. -

-Press reload to see even better results after JIT and TCP/IP warmup! +

diff --git a/demos/demo-jaas-webapp/src/main/webapp/images/small_powered_by.gif b/demos/demo-async-rest/demo-async-rest-webapp/src/main/webapp/small_powered_by.gif similarity index 100% rename from demos/demo-jaas-webapp/src/main/webapp/images/small_powered_by.gif rename to demos/demo-async-rest/demo-async-rest-webapp/src/main/webapp/small_powered_by.gif diff --git a/demos/demo-jaas-webapp/pom.xml b/demos/demo-jaas-webapp/pom.xml index 77698180d97f..38fb6e50bb18 100644 --- a/demos/demo-jaas-webapp/pom.xml +++ b/demos/demo-jaas-webapp/pom.xml @@ -33,9 +33,9 @@ 10 - ${basedir}/src/main/config/demo-base + ${basedir}/src/main/config/modules/demo.d - ${basedir}/src/main/config/demo-base/etc/login.conf + ${basedir}/src/main/config/modules/demo.d/demo-login.conf /test-jaas diff --git a/demos/demo-jaas-webapp/src/main/webapp/auth.html b/demos/demo-jaas-webapp/src/main/webapp/auth.html index 5fcce8000e9f..2041c6dce03b 100644 --- a/demos/demo-jaas-webapp/src/main/webapp/auth.html +++ b/demos/demo-jaas-webapp/src/main/webapp/auth.html @@ -2,17 +2,16 @@ -

SUCCESS! You are AUTHENTICATED and AUTHORIZED

-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 authenticated using the +configured Login Module. You have also been authorized according to this webapp's role-based web security constraints.

To logout click:

- Logout + LOGOUT

diff --git a/demos/demo-jaas-webapp/src/main/webapp/authfail.html b/demos/demo-jaas-webapp/src/main/webapp/authfail.html index f57687bf9a05..62d7e5efec89 100644 --- a/demos/demo-jaas-webapp/src/main/webapp/authfail.html +++ b/demos/demo-jaas-webapp/src/main/webapp/authfail.html @@ -1,11 +1,10 @@ Authentication Failure -

Authentication Failure

Sorry, either your login or password were incorrect, please try again.

- Login + LOGIN diff --git a/demos/demo-jaas-webapp/src/main/webapp/demo.css b/demos/demo-jaas-webapp/src/main/webapp/demo.css new file mode 100644 index 000000000000..f2b91d3365d9 --- /dev/null +++ b/demos/demo-jaas-webapp/src/main/webapp/demo.css @@ -0,0 +1,83 @@ +body +{ + font-family: Arial, Verdana, Helvetica, sans-serif; +} + +.topnav +{ + overflow: hidden; + padding: 10px; + border: 1px solid #f6815c; + border-radius: 10px; + text-align: right; +} + +.menu +{ + margin-left: 3em; +} + +.content +{ + padding: 10px; +} + +.footer +{ + padding: 10px; + border-radius: 10px; + border: 1px solid #f6815c; +} + +.test +{ + background-color: #0099cc; + color: white; + padding: 10px 15px; + border: none; + font-size: 12pt; + border-radius: 10px; + box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2), 0 3px 10px 0 rgba(0,0,0,0.19); +} + +.test:hover +{ + background-color: #f6815c; + color: white; +} + +A:link +{ + color: #0099cc; + text-decoration: none; + font-weight: normal; + font-size: 11pt; + font-family:sans-serif; +} + +A:visited +{ + color: #0099cc; + text-decoration: none; + font-weight: normal; + font-size: 11pt; + font-family:sans-serif; +} + +A:hover +{ + color: #ff6600; + text-decoration: none; + font-weight: normal; + font-size: 11pt; + font-family:sans-serif; +} + +A:active +{ + color: #0099cc; + text-decoration: none; + font-weight: normal; + font-size: 11pt; + font-family:sans-serif; +} diff --git a/demos/demo-jaas-webapp/src/main/webapp/images/jetty_banner.gif b/demos/demo-jaas-webapp/src/main/webapp/images/jetty_banner.gif deleted file mode 100644 index 0a9b1e019baf..000000000000 Binary files a/demos/demo-jaas-webapp/src/main/webapp/images/jetty_banner.gif and /dev/null differ diff --git a/demos/demo-jaas-webapp/src/main/webapp/index.html b/demos/demo-jaas-webapp/src/main/webapp/index.html index 55e8dd9b5213..618ea060a4dd 100644 --- a/demos/demo-jaas-webapp/src/main/webapp/index.html +++ b/demos/demo-jaas-webapp/src/main/webapp/index.html @@ -3,45 +3,50 @@ JAAS Authentication and Authorization Test - + + - -
-Demo Home -
-
Demo Web Application Only - Do NOT Deploy in Production -
+
+ Demo Home + Source + Jetty Project Home + Documentation + Commercial Support +
-

JAAS Authentication and Authorization Demo

-

Preparation

-

To enable JAAS in a base jetty instance do: -

+   
+
+ Demo Web Application Only - Do NOT Deploy in Production +
+

JAAS Demo

+

+ This is a demo webapp for the Eclipse Jetty HTTP Server and Servlet Container. It was added into your $JETTY_BASE/webapps directory. + + It uses a simple login module that stores its configuration in a properties file. +

+ +

Preparation

+

To use JAAS in a base jetty instance enable the jaas module: +

     $ 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. - This Jetty demo-jaas already has JAAS enabled by the demo-jaas module.

- -

The full source of this demonstration is available here.

+

+

The demo module pre-enables the jaas module.

-

Using the Demo

-

+

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 + username=me with password=me. All other usernames and passwords should result in authentication failure. -

-LOGIN -

- 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. -

+

+ START +
-
-
+ diff --git a/demos/demo-jaas-webapp/src/main/webapp/login.html b/demos/demo-jaas-webapp/src/main/webapp/login.html index 757e81fe8d35..4161619f0b61 100644 --- a/demos/demo-jaas-webapp/src/main/webapp/login.html +++ b/demos/demo-jaas-webapp/src/main/webapp/login.html @@ -1,18 +1,35 @@ JAAS Authentication and Authorization Test - + -

Enter your username and password to login

- Enter login=me and password=me in order to authenticate successfully -
- Login: -

- Password: -

- -

-

+

+
+
+ Demo Web Application Only - Do NOT Deploy in Production +
+ +

Enter your username and password to login

+ Enter login=me and password=me in order to authenticate successfully +
+ Login: +

+ Password: +

+ +

+
+ + + diff --git a/demos/demo-jndi-webapp/src/main/webapp/images/small_powered_by.gif b/demos/demo-jaas-webapp/src/main/webapp/small_powered_by.gif similarity index 100% rename from demos/demo-jndi-webapp/src/main/webapp/images/small_powered_by.gif rename to demos/demo-jaas-webapp/src/main/webapp/small_powered_by.gif diff --git a/demos/demo-jetty-webapp/src/main/webapp/auth.html b/demos/demo-jetty-webapp/src/main/webapp/auth.html index 79d66d7ab3a0..53260a6bc52c 100644 --- a/demos/demo-jetty-webapp/src/main/webapp/auth.html +++ b/demos/demo-jetty-webapp/src/main/webapp/auth.html @@ -3,34 +3,45 @@ Powered By Jetty - Auth Links + - -

Jetty Authentication Links

-

- This page contains several links to test the authentication constraints: -

-

-

- Usernames/Passwords are jetty/jetty admin/admin & user/password -

-

- Return to main menu. -

+ + + +
+ +

Jetty Authentication Links

+

+ This page contains several links to test the authentication constraints: +

+

+ Usernames/Passwords are jetty/jetty admin/admin & user/password +

+ + diff --git a/demos/demo-jetty-webapp/src/main/webapp/demo.css b/demos/demo-jetty-webapp/src/main/webapp/demo.css new file mode 100644 index 000000000000..f2b91d3365d9 --- /dev/null +++ b/demos/demo-jetty-webapp/src/main/webapp/demo.css @@ -0,0 +1,83 @@ +body +{ + font-family: Arial, Verdana, Helvetica, sans-serif; +} + +.topnav +{ + overflow: hidden; + padding: 10px; + border: 1px solid #f6815c; + border-radius: 10px; + text-align: right; +} + +.menu +{ + margin-left: 3em; +} + +.content +{ + padding: 10px; +} + +.footer +{ + padding: 10px; + border-radius: 10px; + border: 1px solid #f6815c; +} + +.test +{ + background-color: #0099cc; + color: white; + padding: 10px 15px; + border: none; + font-size: 12pt; + border-radius: 10px; + box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2), 0 3px 10px 0 rgba(0,0,0,0.19); +} + +.test:hover +{ + background-color: #f6815c; + color: white; +} + +A:link +{ + color: #0099cc; + text-decoration: none; + font-weight: normal; + font-size: 11pt; + font-family:sans-serif; +} + +A:visited +{ + color: #0099cc; + text-decoration: none; + font-weight: normal; + font-size: 11pt; + font-family:sans-serif; +} + +A:hover +{ + color: #ff6600; + text-decoration: none; + font-weight: normal; + font-size: 11pt; + font-family:sans-serif; +} + +A:active +{ + color: #0099cc; + text-decoration: none; + font-weight: normal; + font-size: 11pt; + font-family:sans-serif; +} diff --git a/demos/demo-jetty-webapp/src/main/webapp/index.html b/demos/demo-jetty-webapp/src/main/webapp/index.html index d8ce732b6466..048d953cf2eb 100644 --- a/demos/demo-jetty-webapp/src/main/webapp/index.html +++ b/demos/demo-jetty-webapp/src/main/webapp/index.html @@ -3,69 +3,70 @@ Powered By Jetty - + - -
-Demo Home -
-
Demo Web Application Only - Do NOT Deploy in Production -
- -

Welcome to Eclipse Jetty

-

- 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:

- -
- -
+ -

Useful links:

- -

+
+
+ Demo Web Application Only - Do NOT Deploy in Production +
+

Eclipse Jetty Demo Webapp

+

+ This is a demo webapp for the Eclipse Jetty HTTP Server and Servlet Container. It was added into your $JETTY_BASE/webapps directory. +

+ +

Jetty Tests:

+ + + + + +
+ + + +
+
-
-
+ diff --git a/demos/demo-jetty-webapp/src/main/webapp/jetty_banner.gif b/demos/demo-jetty-webapp/src/main/webapp/jetty_banner.gif deleted file mode 100644 index 0a9b1e019baf..000000000000 Binary files a/demos/demo-jetty-webapp/src/main/webapp/jetty_banner.gif and /dev/null differ diff --git a/demos/demo-jetty-webapp/src/main/webapp/logonError.html b/demos/demo-jetty-webapp/src/main/webapp/logonError.html index bef8cdf20de5..66a838690614 100644 --- a/demos/demo-jetty-webapp/src/main/webapp/logonError.html +++ b/demos/demo-jetty-webapp/src/main/webapp/logonError.html @@ -1,6 +1,4 @@

Authentication ERROR

Username, password or role incorrect. -                                    -                    - \ No newline at end of file + diff --git a/demos/demo-jetty-webapp/src/main/webapp/remote.html b/demos/demo-jetty-webapp/src/main/webapp/remote.html index d2e45bcd0134..89812e4009b5 100644 --- a/demos/demo-jetty-webapp/src/main/webapp/remote.html +++ b/demos/demo-jetty-webapp/src/main/webapp/remote.html @@ -1,34 +1,35 @@ - Powered By Jetty + Jetty Demo + - -

Welcome to Jetty 10 - REMOTE ACCESS!!

-

- This is the Test webapp for the Jetty HTTP Server and Servlet Container. - For more information about Jetty, please visit our - website - or documentation. - Commercial support for Jetty is available via webtide. -

-

- This test context serves several demo filters and servlets -that are not safe for deployment on the internet, since (by design) they contain -cross domain scripting vulnerabilities and reveal private information. This page - is displayed because you have accessed this context from a non local IP address. -

-

- You can disable the remote address checking by editing demo-base/webapps/test.d/override-web.xml, uncommenting the - declaration of the TestFilter, and changing the - "remote" init parameter to "true". -

-

- This webapp is deployed in $JETTY_HOME/demo-base/webapps/test.war and configured by $JETTY_HOME/demo-base/webapps/test.xml - and $JETTY_HOME/demo-base/webapps/test.d/override-web.xml -

+ + +
+

Welcome to Jetty 10 - REMOTE ACCESS!!

+

+ This is a demo webapp for the Eclipse Jetty HTTP Server and Servlet Container. +

+

+ This test context serves several demo filters and servlets that are not safe for deployment on the internet, since (by design) they contain cross domain scripting vulnerabilities and reveal private information. This page is displayed because you have accessed this context from a non local IP address. +

+

+ You can disable the remote address checking by editing demo-base/webapps/demo-jetty.d/demo-jetty-override-web.xml, uncommenting the declaration of the TestFilter, and changing the "remote" init parameter to "true". +

+
+ + diff --git a/demos/demo-jetty-webapp/src/main/webapp/rewrite/index.html b/demos/demo-jetty-webapp/src/main/webapp/rewrite/index.html index 613e13d783b1..ed308429b1ac 100644 --- a/demos/demo-jetty-webapp/src/main/webapp/rewrite/index.html +++ b/demos/demo-jetty-webapp/src/main/webapp/rewrite/index.html @@ -7,7 +7,7 @@

Rewrite not enabled

-

The rewrite handler is currently not enabled. To enable this demo, start up Jetty with:

+

The rewrite handler is currently not enabled. To enable this demo, start Jetty with:

java -jar start.jar --module=rewrite diff --git a/demos/demo-jetty-webapp/src/main/webapp/rewrite/info.html b/demos/demo-jetty-webapp/src/main/webapp/rewrite/info.html index f273b6658653..cbf2053518a9 100644 --- a/demos/demo-jetty-webapp/src/main/webapp/rewrite/info.html +++ b/demos/demo-jetty-webapp/src/main/webapp/rewrite/info.html @@ -3,41 +3,57 @@ + RewriteHandler -

Links to test the RewriteHandler

-

All examples below were configured using etc/jetty-rewrite.xml.

- -

Internal URI rewrite

-
-
Rewrite "../some/old/context" to "../rewritten/newcontext"
-
This demo shows how the entire request URI can be internally rewritten to point to another context, using simple text matching
- -
Rewrite "../rewrite/for/beginning" to "../rewritten/beginning"
-
This demo shows how the beginning of the request URI can be rewritten, while keeping the ending section
- -
Rewrite "bar/foo" to "foo/bar" using regex
-
This demo shows how sections of the request URI can be rearranged. It uses regex to parse out each section, and then return them in reverse order
- -
Rewrite the beginning, and reverse the path sections
-
This demo shows how rewrite patterns can be chained.
- -
Rewrite "bar/foo" to "foo/bar", full dump view
-
This demo rewrites "bar/foo" to "foo/bar" the same as earlier, but shows a full dump of the request
- -

Redirect

-
Redirect "../redirect/this" to "../redirected/this"
-
This demo redirects the request in a manner visible to the user agent, instead of doing an internal rewrite.
- -

Cookie

-
All pages
-
This demo rule sets a "visited" cookie for each page you visit. The second time you go to any of the links above, you will see an additional line, "Previously visited: yes".
- -

Response Code

-
Return a 400 error status
-
This demo shows how to modify the response code of a page to an error, based on its URL
- -
+ + +
+

Links to test the RewriteHandler

+

All examples below were configured using etc/jetty-rewrite.xml.

+ +

Internal URI rewrite

+
+
Rewrite "../some/old/context" to "../rewritten/newcontext"
+
This demo shows how the entire request URI can be internally rewritten to point to another context, using simple text matching
+ +
Rewrite "../rewrite/for/beginning" to "../rewritten/beginning"
+
This demo shows how the beginning of the request URI can be rewritten, while keeping the ending section
+ +
Rewrite "bar/foo" to "foo/bar" using regex
+
This demo shows how sections of the request URI can be rearranged. It uses regex to parse out each section, and then return them in reverse order
+ +
Rewrite the beginning, and reverse the path sections
+
This demo shows how rewrite patterns can be chained.
+ +
Rewrite "bar/foo" to "foo/bar", full dump view
+
This demo rewrites "bar/foo" to "foo/bar" the same as earlier, but shows a full dump of the request
+ +

Redirect

+
Redirect "../redirect/this" to "../redirected/this"
+
This demo redirects the request in a manner visible to the user agent, instead of doing an internal rewrite.
+ +

Cookie

+
All pages
+
This demo rule sets a "visited" cookie for each page you visit. The second time you go to any of the links above, you will see an additional line, "Previously visited: yes".
+ +

Response Code

+
Return a 400 error status
+
This demo shows how to modify the response code of a page to an error, based on its URL
+
+
+ + + + diff --git a/demos/demo-jndi-webapp/src/main/webapp/demo.css b/demos/demo-jndi-webapp/src/main/webapp/demo.css new file mode 100644 index 000000000000..f2b91d3365d9 --- /dev/null +++ b/demos/demo-jndi-webapp/src/main/webapp/demo.css @@ -0,0 +1,83 @@ +body +{ + font-family: Arial, Verdana, Helvetica, sans-serif; +} + +.topnav +{ + overflow: hidden; + padding: 10px; + border: 1px solid #f6815c; + border-radius: 10px; + text-align: right; +} + +.menu +{ + margin-left: 3em; +} + +.content +{ + padding: 10px; +} + +.footer +{ + padding: 10px; + border-radius: 10px; + border: 1px solid #f6815c; +} + +.test +{ + background-color: #0099cc; + color: white; + padding: 10px 15px; + border: none; + font-size: 12pt; + border-radius: 10px; + box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2), 0 3px 10px 0 rgba(0,0,0,0.19); +} + +.test:hover +{ + background-color: #f6815c; + color: white; +} + +A:link +{ + color: #0099cc; + text-decoration: none; + font-weight: normal; + font-size: 11pt; + font-family:sans-serif; +} + +A:visited +{ + color: #0099cc; + text-decoration: none; + font-weight: normal; + font-size: 11pt; + font-family:sans-serif; +} + +A:hover +{ + color: #ff6600; + text-decoration: none; + font-weight: normal; + font-size: 11pt; + font-family:sans-serif; +} + +A:active +{ + color: #0099cc; + text-decoration: none; + font-weight: normal; + font-size: 11pt; + font-family:sans-serif; +} diff --git a/demos/demo-jndi-webapp/src/main/webapp/images/jetty_banner.gif b/demos/demo-jndi-webapp/src/main/webapp/images/jetty_banner.gif deleted file mode 100644 index 0a9b1e019baf..000000000000 Binary files a/demos/demo-jndi-webapp/src/main/webapp/images/jetty_banner.gif and /dev/null differ diff --git a/demos/demo-jndi-webapp/src/main/webapp/index.html b/demos/demo-jndi-webapp/src/main/webapp/index.html index a6731102192d..b50583b49d90 100644 --- a/demos/demo-jndi-webapp/src/main/webapp/index.html +++ b/demos/demo-jndi-webapp/src/main/webapp/index.html @@ -1,52 +1,56 @@ - JNDI Test WebApp + JNDI Demo WebApp - + - -
-Demo Home -
-
Demo Web Application Only - Do NOT Deploy in Production -
+ -

JNDI Test WebApp

+
+
+ Demo Web Application Only - Do NOT Deploy in Production +
+

Eclipse Jetty JNDI Demo Webapp

+

+ This is a demo webapp for the Eclipse Jetty HTTP Server and Servlet Container. It was added into your $JETTY_BASE/webapps directory. +

-

- This example shows how to configure and lookup resources such as DataSources, a JTA transaction manager and a - java.mail.Session in JNDI. -

+

+ It shows how to configure and lookup resources such as javax.sql.DataSource, a JTA transaction manager and a java.mail.Session in JNDI. +

-

Preparation

-

To enable JNDI in a base jetty instance do: -

-$ cd $JETTY_BASE
-$ java -jar $JETTY_HOME/start.jar --add-module=jndi
-
-

-

- This will create a $JETTY_BASE/start.d/jndi.ini file to enable and parameterise JNDI. - The jetty demo-base already has JNDI enabled and some mock resources included by the - demo-jndi module. -

-

- The full source of this demonstration is available - here. -

+

Preparation

+

To use JNDI in a base jetty instance enable the jndi module: +

+     $ cd $JETTY_BASE
+     $ java -jar $JETTY_HOME/start.jar --add-module=jndi
+         
+

+

+ The jetty demo module pre-enables JNDI along with some mock resources used by this demo. +

-

Execution

-

+

Execution

+

Click Test to check the runtime lookup of the JNDI resources. -

-
- -
+

+
+ +
+
+ + -
-
diff --git a/demos/demo-spec/demo-spec-webapp/src/main/webapp/images/small_powered_by.gif b/demos/demo-jndi-webapp/src/main/webapp/small_powered_by.gif similarity index 100% rename from demos/demo-spec/demo-spec-webapp/src/main/webapp/images/small_powered_by.gif rename to demos/demo-jndi-webapp/src/main/webapp/small_powered_by.gif diff --git a/demos/demo-jsp-webapp/src/main/webapp/demo.css b/demos/demo-jsp-webapp/src/main/webapp/demo.css new file mode 100644 index 000000000000..6cc26f40ece3 --- /dev/null +++ b/demos/demo-jsp-webapp/src/main/webapp/demo.css @@ -0,0 +1,84 @@ +body +{ + font-family: Arial, Verdana, Helvetica, sans-serif; +} + +.topnav +{ + overflow: hidden; + padding: 10px; + border: 1px solid #f6815c; + border-radius: 10px; + text-align: right; +} + +.menu +{ + margin-left: 3em; +} + +.content +{ + padding: 10px; +} + +.footer +{ + padding: 10px; + border-radius: 10px; + border: 1px solid #f6815c; +} + +.test +{ + background-color: #0099cc; + color: white; + padding: 10px 15px; + border: none; + font-size: 12pt; + border-radius: 10px; + box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2), 0 3px 10px 0 rgba(0,0,0,0.19); +} + +.test:hover +{ + background-color: #f6815c; + color: white; +} + + +A:link +{ + color: #0099cc; + text-decoration: none; + font-weight: normal; + font-size: 11pt; + font-family:sans-serif; +} + +A:visited +{ + color: #0099cc; + text-decoration: none; + font-weight: normal; + font-size: 11pt; + font-family:sans-serif; +} + +A:hover +{ + color: #ff6600; + text-decoration: none; + font-weight: normal; + font-size: 11pt; + font-family:sans-serif; +} + +A:active +{ + color: #0099cc; + text-decoration: none; + font-weight: normal; + font-size: 11pt; + font-family:sans-serif; +} diff --git a/demos/demo-jsp-webapp/src/main/webapp/index.jsp b/demos/demo-jsp-webapp/src/main/webapp/index.jsp index c74eac02ad78..e7ae6e8e2d8f 100644 --- a/demos/demo-jsp-webapp/src/main/webapp/index.jsp +++ b/demos/demo-jsp-webapp/src/main/webapp/index.jsp @@ -3,18 +3,43 @@ <%@ page contentType="text/html; charset=UTF-8" %> + + + -

JSP Examples on <%= DateTimeFormatter.ofPattern("d MMMM yyyy").format(LocalDate.now()) %>

- - Main Menu + + + +
+
+ Demo Web Application Only - Do NOT Deploy in Production +
+

Eclipse Jetty JSP Demo Webapp

+

+ This is a demo webapp for the Eclipse Jetty HTTP Server and Servlet Container. It was added into your $JETTY_BASE/webapps directory. +

+ +

JSP Examples on <%= DateTimeFormatter.ofPattern("d MMMM yyyy").format(LocalDate.now()) %>

+ +
+ + diff --git a/demos/demo-jsp-webapp/src/main/webapp/small_powered_by.gif b/demos/demo-jsp-webapp/src/main/webapp/small_powered_by.gif new file mode 100644 index 000000000000..c5dd44319f0a Binary files /dev/null and b/demos/demo-jsp-webapp/src/main/webapp/small_powered_by.gif differ diff --git a/demos/demo-spec/demo-spec-webapp/src/main/webapp/demo.css b/demos/demo-spec/demo-spec-webapp/src/main/webapp/demo.css new file mode 100644 index 000000000000..f2b91d3365d9 --- /dev/null +++ b/demos/demo-spec/demo-spec-webapp/src/main/webapp/demo.css @@ -0,0 +1,83 @@ +body +{ + font-family: Arial, Verdana, Helvetica, sans-serif; +} + +.topnav +{ + overflow: hidden; + padding: 10px; + border: 1px solid #f6815c; + border-radius: 10px; + text-align: right; +} + +.menu +{ + margin-left: 3em; +} + +.content +{ + padding: 10px; +} + +.footer +{ + padding: 10px; + border-radius: 10px; + border: 1px solid #f6815c; +} + +.test +{ + background-color: #0099cc; + color: white; + padding: 10px 15px; + border: none; + font-size: 12pt; + border-radius: 10px; + box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2), 0 3px 10px 0 rgba(0,0,0,0.19); +} + +.test:hover +{ + background-color: #f6815c; + color: white; +} + +A:link +{ + color: #0099cc; + text-decoration: none; + font-weight: normal; + font-size: 11pt; + font-family:sans-serif; +} + +A:visited +{ + color: #0099cc; + text-decoration: none; + font-weight: normal; + font-size: 11pt; + font-family:sans-serif; +} + +A:hover +{ + color: #ff6600; + text-decoration: none; + font-weight: normal; + font-size: 11pt; + font-family:sans-serif; +} + +A:active +{ + color: #0099cc; + text-decoration: none; + font-weight: normal; + font-size: 11pt; + font-family:sans-serif; +} diff --git a/demos/demo-spec/demo-spec-webapp/src/main/webapp/images/jetty_banner.gif b/demos/demo-spec/demo-spec-webapp/src/main/webapp/images/jetty_banner.gif deleted file mode 100644 index 0a9b1e019baf..000000000000 Binary files a/demos/demo-spec/demo-spec-webapp/src/main/webapp/images/jetty_banner.gif and /dev/null differ diff --git a/demos/demo-spec/demo-spec-webapp/src/main/webapp/index.html b/demos/demo-spec/demo-spec-webapp/src/main/webapp/index.html index d4ec12570d15..bc13b4b53892 100644 --- a/demos/demo-spec/demo-spec-webapp/src/main/webapp/index.html +++ b/demos/demo-spec/demo-spec-webapp/src/main/webapp/index.html @@ -1,86 +1,86 @@ - Test Specification WebApp + Demo Specification WebApp - + - -
-Demo Home -
-
Demo Web Application Only - Do NOT Deploy in Production -
+ -

Servlet 4.0 Demo WebApp

+
+
+ Demo Web Application Only - Do NOT Deploy in Production +
-

- This example tests some aspects of the servlet specification: -

    -
  • context defaults
  • -
  • servlet annotations
  • -
  • web-fragments
  • -
  • servlet container initializers
  • -
  • multi-part upload support
  • -
-The source repository for this test is available -here. -

+

Servlet 4.0 Demo WebApp

+

This example tests some aspects of the servlet specification:

+
    +
  • context defaults
  • +
  • servlet annotations
  • +
  • web-fragments
  • +
  • servlet container initializers
  • +
  • multi-part upload support
  • +
-

Test Defaults, Annotations, Fragments and Initializers

-
- -
+

Test Defaults, Annotations, Fragments and Initializers

+
+ +
-

Test Dynamically Added Jsp File

-

Click the link to test accessing a programmatically added jsp file

-Dynamically added jsp +

Test Dynamically Added JSP File

+

Click the link to test accessing a programmatically added jsp file:

+ Dynamically added jsp -

Test Static Content from Fragment

-

Click the link to test accessing static content from a fragment's META-INF/resources

-Static resource from a fragment +

Test Static Content from Fragment

+

Click the link to test accessing static content from a fragment's META-INF/resources:

+ Static resource from a fragment -

Test Servlet from Fragment

-

Click the link to test accessing a servlet added from a fragment's web-fragment.xml

-Servlet added by web-fragment.xml +

Test Servlet from Fragment

+

Click the link to test accessing a servlet added from a fragment's web-fragment.xml:

+ Servlet added by web-fragment.xml -

Test DeclaresRoles

-

Login as user admin with password admin when prompted after clicking the button below to test @DeclareRoles annotation

-
- -
+

Test DeclaresRoles

+

Login as user admin with password admin when prompted after clicking the button below to test @DeclareRoles annotation:

+
+ +
-

Test Servlet Security

-

Login as user admin with password admin when prompted after clicking the button below to test @ServletSecurity annotation

-
- -
+

Test Servlet Security

+

Login as user admin with password admin when prompted after clicking the button below to test @ServletSecurity annotation:

+
+ +
-

Test Servlet Multipart Mime

-Test of the annotation: -
-@MultipartConfig(location="foo/bar", maxFileSize=10240, maxRequestSize=-1, fileSizeThreshold=2048)
-
-
- File to upload: - -
+

Test Servlet Multipart Mime

+ Test the annotation: +
+    @MultipartConfig(location="foo/bar", maxFileSize=10240, maxRequestSize=-1, fileSizeThreshold=2048)
+    
+
+ File to upload: + +
-

AsyncListener Resource Injection

-

Click the following link to test that javax.servlet.AsyncListeners are injectable

-
- -
+

AsyncListener Resource Injection

+

Click the following link to test that javax.servlet.AsyncListeners are injectable:

+
+ +
-

Test ClassPath Isolation

-

Click the link to test classpath isolation of system and server classes

-ClassPathServlet - -
-
- -
+

Test ClassPath Isolation

+

Click the link to test classpath isolation of system and server classes:

+ ClassPathServlet +
+ diff --git a/demos/demo-spec/demo-spec-webapp/src/main/webapp/small_powered_by.gif b/demos/demo-spec/demo-spec-webapp/src/main/webapp/small_powered_by.gif new file mode 100644 index 000000000000..c5dd44319f0a Binary files /dev/null and b/demos/demo-spec/demo-spec-webapp/src/main/webapp/small_powered_by.gif differ diff --git a/demos/demo-template/pom.xml b/demos/demo-template/pom.xml new file mode 100644 index 000000000000..99490d07cafa --- /dev/null +++ b/demos/demo-template/pom.xml @@ -0,0 +1,28 @@ + + + + org.eclipse.jetty.demos + demos-parent + 10.0.8-SNAPSHOT + + + 4.0.0 + demo-template + Demo :: Template + jar + + + + + org.apache.maven.plugins + maven-jar-plugin + + + index.html + small_powered_by.gif + + + + + + diff --git a/demos/demo-template/src/main/resources/demo.css b/demos/demo-template/src/main/resources/demo.css new file mode 100644 index 000000000000..f2b91d3365d9 --- /dev/null +++ b/demos/demo-template/src/main/resources/demo.css @@ -0,0 +1,83 @@ +body +{ + font-family: Arial, Verdana, Helvetica, sans-serif; +} + +.topnav +{ + overflow: hidden; + padding: 10px; + border: 1px solid #f6815c; + border-radius: 10px; + text-align: right; +} + +.menu +{ + margin-left: 3em; +} + +.content +{ + padding: 10px; +} + +.footer +{ + padding: 10px; + border-radius: 10px; + border: 1px solid #f6815c; +} + +.test +{ + background-color: #0099cc; + color: white; + padding: 10px 15px; + border: none; + font-size: 12pt; + border-radius: 10px; + box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2), 0 3px 10px 0 rgba(0,0,0,0.19); +} + +.test:hover +{ + background-color: #f6815c; + color: white; +} + +A:link +{ + color: #0099cc; + text-decoration: none; + font-weight: normal; + font-size: 11pt; + font-family:sans-serif; +} + +A:visited +{ + color: #0099cc; + text-decoration: none; + font-weight: normal; + font-size: 11pt; + font-family:sans-serif; +} + +A:hover +{ + color: #ff6600; + text-decoration: none; + font-weight: normal; + font-size: 11pt; + font-family:sans-serif; +} + +A:active +{ + color: #0099cc; + text-decoration: none; + font-weight: normal; + font-size: 11pt; + font-family:sans-serif; +} diff --git a/demos/demo-template/src/main/resources/index.html b/demos/demo-template/src/main/resources/index.html new file mode 100644 index 000000000000..cf08af072201 --- /dev/null +++ b/demos/demo-template/src/main/resources/index.html @@ -0,0 +1,35 @@ + + + + XXX + + + + + + + +
+
+ Demo Web Application Only - Do NOT Deploy in Production +
+ + +

Jetty XXX Demo Webapp

+ + + +
+ + + + diff --git a/demos/demo-template/src/main/resources/small_powered_by.gif b/demos/demo-template/src/main/resources/small_powered_by.gif new file mode 100644 index 000000000000..c5dd44319f0a Binary files /dev/null and b/demos/demo-template/src/main/resources/small_powered_by.gif differ diff --git a/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestJettyOSGiBootWithAnnotations.java b/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestJettyOSGiBootWithAnnotations.java index f39179e717b1..d944569b42b5 100644 --- a/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestJettyOSGiBootWithAnnotations.java +++ b/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestJettyOSGiBootWithAnnotations.java @@ -100,7 +100,7 @@ public void testIndex() throws Exception assertEquals("Response status code", HttpStatus.OK_200, response.getStatus()); String content = response.getContentAsString(); - TestOSGiUtil.assertContains("Response contents", content, "Test Specification WebApp"); + TestOSGiUtil.assertContains("Response contents", content, "Demo Specification WebApp"); Request req = client.POST("http://127.0.0.1:" + port + "/test"); response = req.send(); diff --git a/tests/test-quickstart/src/test/java/org/eclipse/jetty/quickstart/QuickStartTest.java b/tests/test-quickstart/src/test/java/org/eclipse/jetty/quickstart/QuickStartTest.java index e161777f1ca3..06499de08067 100644 --- a/tests/test-quickstart/src/test/java/org/eclipse/jetty/quickstart/QuickStartTest.java +++ b/tests/test-quickstart/src/test/java/org/eclipse/jetty/quickstart/QuickStartTest.java @@ -193,7 +193,7 @@ public void testJNDIWar() throws Exception HttpURLConnection connection = (HttpURLConnection)url.openConnection(); assertEquals(200, connection.getResponseCode()); String content = IO.toString((InputStream)connection.getContent()); - assertThat(content, Matchers.containsString("JNDI Test WebApp")); + assertThat(content, Matchers.containsString("JNDI Demo WebApp")); server.stop(); }