WIP: examples - spring
authorKai Moritz <kai@coolibri.de>
Sun, 24 Jun 2012 22:56:21 +0000 (00:56 +0200)
committerKai Moritz <kai@coolibri.de>
Thu, 2 Aug 2012 07:03:26 +0000 (09:03 +0200)
Einstiegsseite /index.html repariert

examples/spring/src/main/webapp/WEB-INF/views/index.jsp [new file with mode: 0644]
examples/spring/src/main/webapp/WEB-INF/views/spring-page.jsp
examples/spring/src/main/webapp/index.html [deleted file]
examples/spring/src/main/webapp/index.jsp [new file with mode: 0644]

diff --git a/examples/spring/src/main/webapp/WEB-INF/views/index.jsp b/examples/spring/src/main/webapp/WEB-INF/views/index.jsp
new file mode 100644 (file)
index 0000000..020f6ee
--- /dev/null
@@ -0,0 +1,32 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+
+<html>
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+    <title>Simple Spring-MVC Examples</title>
+  </head>
+  <body>
+    <h1>Simple Spring-MVC Examples</h1>
+    <ul>
+      <li><a href="/spring-page.html">Simple Spring-View</a></li>
+    </ul>
+    <p>This page was delivered via SPRING!</p>
+    <h2>Note:</h2>
+    <p>
+      Since the <code>org.springframework.web.servlet.DispatcherServlet</code>
+      ist configured to handle all <code>*.html</code>-requests, the path
+      <code>/index.html</code> points to a view.
+    </p>
+    <p>
+      Therefore, this page must be stored under
+      <code>/WEB-INF/views/index.jsp</code> in order to be served as
+      <code>/index.html</code>
+    </p>
+    <p>
+      Additionatly, a file <code>/index.jsp</code> in the root-directory of
+      the webappliction is needed, to forward unqualified requests
+      (like <code>http://HOSTNAME/</code>) to the welcome-page served by
+      the Spring-Dispatcher-Servlet.
+    </p>
+  </body>
+</html>
index 194cac5..7a2ab93 100644 (file)
@@ -10,6 +10,6 @@
   <body>
     <h1>Hello World!</h1>
     <p>This is a really simple page...</p>
-    <p>This version of a really simple page was delivered via SPRING!</p>
+    <p>This page was delivered via SPRING!</p>
   </body>
 </html>
diff --git a/examples/spring/src/main/webapp/index.html b/examples/spring/src/main/webapp/index.html
deleted file mode 100644 (file)
index 58f0094..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-
-<html>
-  <head>
-    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
-    <title>Spring Examples</title>
-  </head>
-  <body>
-    <h1>Spring Examples</h1>
-    <ul>
-      <li><a href="/spring-page.html">Simple Spring-View</a></li>
-    </ul>
-  </body>
-</html>
diff --git a/examples/spring/src/main/webapp/index.jsp b/examples/spring/src/main/webapp/index.jsp
new file mode 100644 (file)
index 0000000..9082000
--- /dev/null
@@ -0,0 +1,8 @@
+<%@page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8" session="false" %>
+<jsp:forward page="/index.html"/>
+<%--
+
+Unfortionatly, the welcome-mechanism in web.xml does not work with a page
+served by a servlet...
+
+--%>