[weld-commits] Weld SVN: r6667 - in archetypes/javaee6-webapp/trunk/src/main/webapp: WEB-INF and 1 other directory.

weld-commits at lists.jboss.org weld-commits at lists.jboss.org
Fri Jul 16 19:05:45 EDT 2010


Author: dan.j.allen
Date: 2010-07-16 19:05:45 -0400 (Fri, 16 Jul 2010)
New Revision: 6667

Added:
   archetypes/javaee6-webapp/trunk/src/main/webapp/index.jsf
   archetypes/javaee6-webapp/trunk/src/main/webapp/index.xhtml
Removed:
   archetypes/javaee6-webapp/trunk/src/main/webapp/home.xhtml
   archetypes/javaee6-webapp/trunk/src/main/webapp/index.jsp
Modified:
   archetypes/javaee6-webapp/trunk/src/main/webapp/WEB-INF/web.xml
Log:
use welcome file to forward to index.jsf instead of using a redirect in index.jsp


Modified: archetypes/javaee6-webapp/trunk/src/main/webapp/WEB-INF/web.xml
===================================================================
--- archetypes/javaee6-webapp/trunk/src/main/webapp/WEB-INF/web.xml	2010-07-16 23:00:44 UTC (rev 6666)
+++ archetypes/javaee6-webapp/trunk/src/main/webapp/WEB-INF/web.xml	2010-07-16 23:05:45 UTC (rev 6667)
@@ -24,9 +24,10 @@
       <url-pattern>*.jsf</url-pattern>
    </servlet-mapping>
    
-   <!-- This section is option. -->
    <welcome-file-list>
+      <welcome-file>index.jsp</welcome-file>
+      <welcome-file>index.html</welcome-file>
       <welcome-file>index.jsf</welcome-file>
-      <welcome-file>index.jsp</welcome-file>
    </welcome-file-list>
+
 </web-app>

Deleted: archetypes/javaee6-webapp/trunk/src/main/webapp/home.xhtml
===================================================================
--- archetypes/javaee6-webapp/trunk/src/main/webapp/home.xhtml	2010-07-16 23:00:44 UTC (rev 6666)
+++ archetypes/javaee6-webapp/trunk/src/main/webapp/home.xhtml	2010-07-16 23:05:45 UTC (rev 6667)
@@ -1,69 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui:composition xmlns="http://www.w3.org/1999/xhtml"
-   xmlns:ui="http://java.sun.com/jsf/facelets"
-   xmlns:f="http://java.sun.com/jsf/core"
-   xmlns:h="http://java.sun.com/jsf/html"
-   template="/WEB-INF/templates/default.xhtml">
-   <ui:define name="content">
-      <h1>Welcome to Java EE 6!</h1>
-
-      <p>You have successfully deployed a Java EE 6 web application.</p>
-
-      <h:form id="reg">
-         <h2>Register (Bean Validation example)</h2>
-         <p>Enforces annotation-based constraints defined on the model class.</p>
-         <table>
-            <tr>
-               <th style="text-align: right;">
-                  <h:outputLabel for="name" value="Name:"/>
-               </th>
-               <td>
-                  <h:inputText id="name" value="#{newMember.name}"/>
-                  <h:message for="name" errorClass="invalid"/>
-               </td>
-            </tr>
-            <tr>
-               <th style="text-align: right;">
-                  <h:outputLabel for="email" value="Email:"/>
-               </th>
-               <td>
-                  <h:inputText id="email" value="#{newMember.email}"/>
-                  <h:message for="email" errorClass="invalid"/>
-               </td>
-            </tr>
-            <tr>
-               <th style="text-align: right;">
-                  <h:outputLabel for="phoneNumber" value="Phone #:"/>
-               </th>
-               <td>
-                  <h:inputText id="phoneNumber" value="#{newMember.phoneNumber}"/>
-                  <h:message for="phoneNumber" errorClass="invalid"/>
-               </td>
-            </tr>
-         </table>
-         <p>
-            <h:commandButton id="register" action="#{memberRegistration.register}" value="Register"/>
-            <h:outputText value=" Registered!" rendered="#{facesContext.postback and empty facesContext.messageList}" style="color: green;"/>
-         </p>
-      </h:form>
-      <h2>Members</h2>
-      <h:dataTable var="_member" value="#{members}">
-         <h:column>
-            <f:facet name="header">Id</f:facet>
-            #{_member.id}
-         </h:column>
-         <h:column>
-            <f:facet name="header">Name</f:facet>
-            #{_member.name}
-         </h:column>
-         <h:column>
-            <f:facet name="header">Email</f:facet>
-            #{_member.email}
-         </h:column>
-         <h:column>
-            <f:facet name="header">Phone #</f:facet>
-            #{_member.phoneNumber}
-         </h:column>
-      </h:dataTable>
-   </ui:define>
-</ui:composition>

Added: archetypes/javaee6-webapp/trunk/src/main/webapp/index.jsf
===================================================================
--- archetypes/javaee6-webapp/trunk/src/main/webapp/index.jsf	                        (rev 0)
+++ archetypes/javaee6-webapp/trunk/src/main/webapp/index.jsf	2010-07-16 23:05:45 UTC (rev 6667)
@@ -0,0 +1,6 @@
+The contents of this file will not be displayed!
+
+Having this file is trick to get JBoss AS to redirect to the path index.jsf
+when the root application URL is requested (or any subdirectory).
+
+See https://jira.jboss.org/browse/JBAS-8224

Deleted: archetypes/javaee6-webapp/trunk/src/main/webapp/index.jsp
===================================================================
--- archetypes/javaee6-webapp/trunk/src/main/webapp/index.jsp	2010-07-16 23:00:44 UTC (rev 6666)
+++ archetypes/javaee6-webapp/trunk/src/main/webapp/index.jsp	2010-07-16 23:05:45 UTC (rev 6667)
@@ -1 +0,0 @@
-<% response.sendRedirect("home.jsf"); %>

Copied: archetypes/javaee6-webapp/trunk/src/main/webapp/index.xhtml (from rev 6623, archetypes/javaee6-webapp/trunk/src/main/webapp/home.xhtml)
===================================================================
--- archetypes/javaee6-webapp/trunk/src/main/webapp/index.xhtml	                        (rev 0)
+++ archetypes/javaee6-webapp/trunk/src/main/webapp/index.xhtml	2010-07-16 23:05:45 UTC (rev 6667)
@@ -0,0 +1,79 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui:composition xmlns="http://www.w3.org/1999/xhtml"
+   xmlns:ui="http://java.sun.com/jsf/facelets"
+   xmlns:f="http://java.sun.com/jsf/core"
+   xmlns:h="http://java.sun.com/jsf/html"
+   template="/WEB-INF/templates/default.xhtml">
+   <ui:define name="content">
+      <h1>Welcome to Java EE 6!</h1>
+
+      <p>You have successfully deployed a Java EE 6 web application.</p>
+
+      <h:form id="reg">
+         <h2>Register (Bean Validation example)</h2>
+         <p>Enforces annotation-based constraints defined on the model class.</p>
+         <table>
+            <tr>
+               <th style="text-align: right;">
+                  <h:outputLabel for="name" value="Name:"/>
+               </th>
+               <td>
+                  <h:inputText id="name" value="#{newMember.name}"/>
+                  <h:message for="name" errorClass="invalid"/>
+               </td>
+            </tr>
+            <tr>
+               <th style="text-align: right;">
+                  <h:outputLabel for="email" value="Email:"/>
+               </th>
+               <td>
+                  <h:inputText id="email" value="#{newMember.email}"/>
+                  <h:message for="email" errorClass="invalid"/>
+               </td>
+            </tr>
+            <tr>
+               <th style="text-align: right;">
+                  <h:outputLabel for="phoneNumber" value="Phone #:"/>
+               </th>
+               <td>
+                  <h:inputText id="phoneNumber" value="#{newMember.phoneNumber}"/>
+                  <h:message for="phoneNumber" errorClass="invalid"/>
+               </td>
+            </tr>
+         </table>
+         <p>
+            <h:commandButton id="register" action="#{memberRegistration.register}" value="Register"/>
+            <h:outputText value=" Registered!" rendered="#{facesContext.postback and empty facesContext.messageList}" style="color: green;"/>
+         </p>
+      </h:form>
+      <h2>Members</h2>
+      <h:panelGroup rendered="#{empty members}">
+         <em>No registered members.</em>
+      </h:panelGroup>
+      <h:dataTable var="_member" value="#{members}" rendered="#{not empty members}">
+         <h:column>
+            <f:facet name="header">Id</f:facet>
+            #{_member.id}
+         </h:column>
+         <h:column>
+            <f:facet name="header">Name</f:facet>
+            #{_member.name}
+         </h:column>
+         <h:column>
+            <f:facet name="header">Email</f:facet>
+            #{_member.email}
+         </h:column>
+         <h:column>
+            <f:facet name="header">Phone #</f:facet>
+            #{_member.phoneNumber}
+         </h:column>
+         <h:column>
+            <f:facet name="header">REST URL</f:facet>
+            <a href="#{request.contextPath}/rest/members/#{_member.id}">/rest/members/#{_members.id}</a>
+         </h:column>
+         <f:facet name="footer">
+            REST URL for all members: <a href="#{request.contextPath}/rest/members">/rest/members</a>
+         </f:facet>
+      </h:dataTable>
+   </ui:define>
+</ui:composition>



More information about the weld-commits mailing list