You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@continuum.apache.org by ke...@apache.org on 2006/08/16 17:59:30 UTC

svn commit: r431931 - in /maven/continuum/trunk/continuum-webapp/src/main: java/org/apache/maven/continuum/web/action/ webapp/ webapp/WEB-INF/

Author: kenney
Date: Wed Aug 16 08:59:29 2006
New Revision: 431931

URL: http://svn.apache.org/viewvc?rev=431931&view=rev
Log:
Upgraded web.xml to servlet spec 2.4 (the servlet-api already is 2.4).
This fixes various jstl and webwork problems when evaluating expressions
in tomcat.

Updated all c:url's to use ww:url (mostly actions), and use ww:param to set
projectId parameters e.a.

Removed unused/unnessesary projectName getters/setters from BuildResultsListAction
and use continuum to get the project name from a projectId in WorkingCopyAction.
(Actions should just need the ID, not a projectName parameter in the URL to render stuff).

TODO: test the notifier list - tried to add a notifier but that gave an NPE.

Modified:
    maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildResultsListAction.java
    maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/WorkingCopyAction.java
    maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/web.xml
    maven/continuum/trunk/continuum-webapp/src/main/webapp/buildResults.jsp
    maven/continuum/trunk/continuum-webapp/src/main/webapp/groupSummary.jsp
    maven/continuum/trunk/continuum-webapp/src/main/webapp/projectView.jsp
    maven/continuum/trunk/continuum-webapp/src/main/webapp/schedules.jsp
    maven/continuum/trunk/continuum-webapp/src/main/webapp/summary.jsp
    maven/continuum/trunk/continuum-webapp/src/main/webapp/workingCopy.jsp

Modified: maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildResultsListAction.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildResultsListAction.java?rev=431931&r1=431930&r2=431931&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildResultsListAction.java (original)
+++ maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildResultsListAction.java Wed Aug 16 08:59:29 2006
@@ -35,8 +35,6 @@
 
     private int projectId;
 
-    private String projectName;
-
     public String execute()
         throws ContinuumException
     {
@@ -53,16 +51,6 @@
     public void setProjectId( int projectId )
     {
         this.projectId = projectId;
-    }
-
-    public String getProjectName()
-    {
-        return projectName;
-    }
-
-    public void setProjectName( String projectName )
-    {
-        this.projectName = projectName;
     }
 
     public Collection getBuildResults()

Modified: maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/WorkingCopyAction.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/WorkingCopyAction.java?rev=431931&r1=431930&r2=431931&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/WorkingCopyAction.java (original)
+++ maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/WorkingCopyAction.java Wed Aug 16 08:59:29 2006
@@ -16,10 +16,8 @@
  * limitations under the License.
  */
 
-import org.apache.maven.continuum.Continuum;
 import org.apache.maven.continuum.ContinuumException;
 import org.apache.maven.continuum.web.util.WorkingCopyContentGenerator;
-import org.apache.maven.continuum.web.action.ContinuumActionSupport;
 
 import com.opensymphony.webwork.ServletActionContext;
 import com.opensymphony.webwork.views.util.UrlHelper;
@@ -45,8 +43,6 @@
 
     private int projectId;
 
-    private String projectName;
-
     private String userDirectory;
 
     private String currentFile;
@@ -57,11 +53,15 @@
 
     private String output;
 
+    private String projectName;
+
     public String execute()
         throws ContinuumException
     {
         files = continuum.getFiles( projectId, userDirectory );
 
+        projectName = continuum.getProject( projectId ).getName();
+
         HashMap params = new HashMap();
 
         params.put( "projectId", new Integer( projectId ) );
@@ -97,11 +97,6 @@
     public String getProjectName()
     {
         return projectName;
-    }
-
-    public void setProjectName( String projectName )
-    {
-        this.projectName = projectName;
     }
 
     public String getUserDirectory()

Modified: maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/web.xml?rev=431931&r1=431930&r2=431931&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/web.xml (original)
+++ maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/web.xml Wed Aug 16 08:59:29 2006
@@ -1,10 +1,6 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
+<?xml version="1.0"?>
 
-<!DOCTYPE web-app PUBLIC
-    "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
-    "http://java.sun.com/dtd/web-app_2_3.dtd">
-
-<web-app>
+<web-app xmlns="http://java.sun.com/xml/ns/j2ee" version="2.4">
 
   <display-name>Continuum Webapp</display-name>
 

Modified: maven/continuum/trunk/continuum-webapp/src/main/webapp/buildResults.jsp
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/webapp/buildResults.jsp?rev=431931&r1=431930&r2=431931&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/webapp/buildResults.jsp (original)
+++ maven/continuum/trunk/continuum-webapp/src/main/webapp/buildResults.jsp Wed Aug 16 08:59:29 2006
@@ -39,12 +39,11 @@
             <ec:column property="endTime" title="buildResults.endTime" cell="date"/>
             <ec:column property="state" title="buildResults.state" cell="org.apache.maven.continuum.web.view.buildresults.StateCell"/>
             <ec:column property="actions" title="&nbsp;">
-              <c:url var="buildResultUrl" value="/buildResult.action">
-                <c:param name="projectId" value="projectId"/>
-                <c:param name="projectName" value="projectName"/>
-                <c:param name="buildId" value="${buildResult.id}"/>
-              </c:url>
-              <a href="<c:out value='${buildResultUrl}'/>">Result</a>
+              <a href='<ww:url action="buildResult">
+                <ww:param name="projectId" value="${projectId}"/>
+                <ww:param name="projectName" value="${projectName}"/>
+                <ww:param name="buildId" value="${buildResult.id}"/>
+              </ww:url>'>Result</a>
             </ec:column>
           </ec:row>
         </ec:table>

Modified: maven/continuum/trunk/continuum-webapp/src/main/webapp/groupSummary.jsp
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/webapp/groupSummary.jsp?rev=431931&r1=431930&r2=431931&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/webapp/groupSummary.jsp (original)
+++ maven/continuum/trunk/continuum-webapp/src/main/webapp/groupSummary.jsp Wed Aug 16 08:59:29 2006
@@ -28,10 +28,9 @@
         <ec:row highlightRow="true">
           <ec:column property="state" title="&nbsp;" width="1%" cell="org.apache.maven.continuum.web.view.StateCell"/>
           <ec:column property="name" title="summary.projectTable.name" width="48%">
-            <c:url var="projectViewUrl" value="/projectView.action">
-              <c:param name="projectId" value="${project.id}"/>
-            </c:url>
-            <a href="<c:out value='${projectViewUrl}'/>">${project.name}</a>
+            <a href='<ww:url action="projectView">
+              <ww:param name="projectId" value="${project.id}"/>
+            </ww:url>'>${project.name}</a>
           </ec:column>
           <ec:column property="version" title="summary.projectTable.version" width="13%"/>
           <ec:column property="buildNumber" title="summary.projectTable.build" width="5%"

Modified: maven/continuum/trunk/continuum-webapp/src/main/webapp/projectView.jsp
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/webapp/projectView.jsp?rev=431931&r1=431930&r2=431931&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/webapp/projectView.jsp (original)
+++ maven/continuum/trunk/continuum-webapp/src/main/webapp/projectView.jsp Wed Aug 16 08:59:29 2006
@@ -70,17 +70,15 @@
             </ec:column>
             <ec:column property="actions" title="&nbsp;">
                 <!-- TODO: REPLACE THIS WITH A NEW CELL CLASS -->
-                <c:url var="buildDefinitionEditUrl" value="/buildDefinitionEdit!default.action">
-                  <c:param name="projectId" value="project.id"/>
-                  <c:param name="buildDefinitionId" value="${buildDefinition.id}"/>
-                </c:url>
-                <a href="<c:out value='${buildDefinitionEditUrl}'/>"><ww:text name="edit"/></a>
+                <a href='<ww:url value="/buildDefinitionEdit!default.action">
+                  <ww:param name="projectId" value="project.id"/>
+                  <ww:param name="buildDefinitionId" value="${buildDefinition.id}"/>
+                </ww:url>'><ww:text name="edit"/></a>
                 &nbsp;
-                <c:url var="deleteBuildDefinitionUrl" value="/deleteBuildDefinition!default.action">
-                  <c:param name="projectId" value="project.id"/>
-                  <c:param name="buildDefinitionId" value="${buildDefinition.id}"/>
-                </c:url>
-                <a href="<c:out value='${deleteBuildDefinitionUrl}'/>"><ww:text name="delete"/></a>
+                <a href='<ww:url value="/deleteBuildDefinition!default.action">
+                  <ww:param name="projectId" value="project.id"/>
+                  <ww:param name="buildDefinitionId" value="${buildDefinition.id}"/>
+                </ww:url>'><ww:text name="delete"/></a>
             </ec:column>
           </ec:row>
         </ec:table>
@@ -107,23 +105,19 @@
             <ec:column property="from" title="projectView.notifier.from" cell="org.apache.maven.continuum.web.view.projectview.NotifierFromCell"/>
             <ec:column property="actions" title="&nbsp;">
                 <c:if test="${!pageScope.notifier.fromProject}">
-                    <c:url var="notifierEditUrl" value="${notifier.type}NotifierEdit!default.action">
-                      <c:param name="projectId" value="project.id"/>
-                      <c:param name="notifierId" value="${notifier.id}"/>
-                    </c:url>
-                    <c:url var="imgEditUrl" value="/images/edit.gif" />
-                    <a href="<c:out value='${notifierEditUrl}'/>">
-                      <img src="<c:out value='${imgEditUrl}'/>" alt="<ww:text name="edit"/>" title="<ww:text name="edit"/>" border="0">
+                    <a href='<ww:url value="${notifier.type}NotifierEdit!default.action">
+                      <ww:param name="projectId" value="project.id"/>
+                      <ww:param name="notifierId" value="${notifier.id}"/>
+                    </ww:url>'>
+                      <img src="<ww:url value='/images/edit.gif'/>" alt="<ww:text name='edit'/>" title="<ww:text name='edit'/>" border="0" />
                     </a>
                     &nbsp;
-                    <c:url var="notifierDeleteUrl" value="/deleteNotifier!default.action">
-                      <c:param name="projectId" value="project.id"/>
-                      <c:param name="notifierId" value="${notifier.id}"/>
-                      <c:param name="notifierType" value="${notifier.type}"/>
-                    </c:url>
-                    <c:url var="imgDeleteUrl" value="/images/delete.gif" />
-                    <a href="<c:out value='${notifierDeleteUrl}'/>">
-                      <img src="<c:out value='${imgDeleteUrl}'/>" alt="<ww:text name="delete"/>" title="<ww:text name="delete"/>" border="0">
+                    <a href='<ww:url value="/deleteNotifier!default.action">
+                      <ww:param name="projectId" value="project.id"/>
+                      <ww:param name="notifierId" value="${notifier.id}"/>
+                      <ww:param name="notifierType" value="${notifier.type}"/>
+                    </ww:url>'>
+                      <img src="<ww:url value='/images/delete.gif'/>" alt="<ww:text name='delete'/>" title="<ww:text name='delete'/>" border="0">
                     </a>
                 </c:if>
             </ec:column>

Modified: maven/continuum/trunk/continuum-webapp/src/main/webapp/schedules.jsp
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/webapp/schedules.jsp?rev=431931&r1=431930&r2=431931&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/webapp/schedules.jsp (original)
+++ maven/continuum/trunk/continuum-webapp/src/main/webapp/schedules.jsp Wed Aug 16 08:59:29 2006
@@ -22,10 +22,9 @@
             <ec:column property="delay" title="schedules.table.delay"/>
             <ec:column property="cronExpression" title="schedules.table.cronExpression"/>
             <ec:column property="actions" title="&nbsp;">
-                <c:url var="editScheduleUrl" value="/editSchedule!edit.action">
-                  <c:param name="id" value="${schedule.id}"/>
-                </c:url>
-                <a href="<c:out value='${editScheduleUrl}'/>"><ww:text name="edit"/></a>
+                <a href='<ww:url value="/editSchedule!edit.action">
+                  <ww:param name="id" value="${schedule.id}"/>
+                </ww:url>'><ww:text name="edit"/></a>
                 &nbsp;
                 <ww:text name="delete"/>
             </ec:column>

Modified: maven/continuum/trunk/continuum-webapp/src/main/webapp/summary.jsp
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/webapp/summary.jsp?rev=431931&r1=431930&r2=431931&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/webapp/summary.jsp (original)
+++ maven/continuum/trunk/continuum-webapp/src/main/webapp/summary.jsp Wed Aug 16 08:59:29 2006
@@ -19,8 +19,9 @@
           <ec:row highlightRow="true">
             <ec:column property="state" title="&nbsp;" width="1%" cell="org.apache.maven.continuum.web.view.StateCell"/>
             <ec:column property="name" title="summary.projectTable.name" width="48%">
-                <c:url var="projectViewUrl" value="/projectView.action"/>
-                <a href="<c:out value='${projectViewUrl}?projectId=${project.id}'/>">${project.name}</a>
+                <a href="<ww:url action="projectView">
+									<ww:param name="projectId" value="${project.id}"/>
+								</ww:url>">${project.name}</a>
             </ec:column>
             <ec:column property="version" title="summary.projectTable.version" width="13%"/>
             <ec:column property="buildNumber" title="summary.projectTable.build" width="5%" cell="org.apache.maven.continuum.web.view.BuildCell"/>
@@ -29,37 +30,39 @@
             <ec:column property="buildHistoryAction" title="&nbsp;" width="1%" sortable="false">
               <c:choose>
                 <c:when test="${pageScope.project.latestBuildId > 0}">
-                  <a href="<ww:url value="/buildResults.action?projectId="/>${pageScope.project.id}&projectName=${pageScope.project.name}"><img src="<ww:url value="/images/buildhistory.gif"/>" alt="Build History" title="Build History" border="0"></a>
+                  <a href='<ww:url action="buildResults">
+											<ww:param name="projectId" value="${project.id}"/>
+										</ww:url>'><img src="<ww:url value='/images/buildhistory.gif'/>" alt="Build History" title="Build History" border="0"></a>
                 </c:when>
                 <c:otherwise>
-                  <img src="<ww:url value="/images/buildhistory_disabled.gif"/>" alt="Build History" title="Build History" border="0">
+                  <img src="<ww:url value='/images/buildhistory_disabled.gif'/>" alt="Build History" title="Build History" border="0">
                 </c:otherwise>
               </c:choose>
             </ec:column>
             <ec:column property="workingCopyAction" title="&nbsp;" width="1%" sortable="false">
               <c:choose>
                 <c:when test="${pageScope.project.state == 10 || pageScope.project.state == 2 || pageScope.project.state == 3 || pageScope.project.state == 4 || pageScope.project.state == 6}">
-                  <a href="<ww:url value="/workingCopy.action?projectId="/>${pageScope.project.id}&projectName=${pageScope.project.name}"><img src="<ww:url value="/images/workingcopy.gif"/>" alt="Working Copy" title="Working Copy" border="0"></a>
+                  <a href='<ww:url action="workingCopy">
+											<ww:param name="projectId" value="${project.id}"/>
+										</ww:url>'><img src="<ww:url value='/images/workingcopy.gif'/>" alt="Working Copy" title="Working Copy" border="0"></a>
                 </c:when>
                 <c:otherwise>
-                  <img src="<ww:url value="/images/workingcopy_disabled.gif"/>" alt="Working Copy" title="Working Copy" border="0">
+                  <img src="<ww:url value='/images/workingcopy_disabled.gif'/>" alt="Working Copy" title="Working Copy" border="0">
                 </c:otherwise>
               </c:choose>
             </ec:column>
             <ec:column property="deleteAction" title="&nbsp;" width="1%" sortable="false">
               <c:choose>
                 <c:when test="${pageScope.project.state == 1 || pageScope.project.state == 10 || pageScope.project.state == 2 || pageScope.project.state == 3 || pageScope.project.state == 4}">
-                  <c:url var="deleteProjectUrl" value="/deleteProject!default.action">
-                    <c:param name="projectId" value="${project.id}"/>
-                    <c:param name="projectName" value="${project.name}"/>
-                  </c:url>
-                  <c:url var="imgDeleteUrl" value="/images/delete.gif" />
-                  <a href="<c:out value='${deleteProjectUrl}'/>">
-                    <img src="<c:out value='${imgDeleteUrl}'/>" alt="Delete" title="Delete" border="0">
+                  <a href='<ww:url value="/deleteProject!default.action">
+                    <ww:param name="projectId" value="${project.id}"/>
+                    <ww:param name="projectName" value="${project.name}"/>
+                  </ww:url>'>
+                    <img src="<ww:url value='/images/delete.gif'/>" alt="Delete" title="Delete" border="0">
                   </a>
                 </c:when>
                 <c:otherwise>
-                  <img src="<ww:url value="/images/delete_disabled.gif"/>" alt="Delete" title="Delete" border="0">
+                  <img src="<ww:url value='/images/delete_disabled.gif'/>" alt="Delete" title="Delete" border="0">
                 </c:otherwise>
               </c:choose>
             </ec:column>
@@ -69,9 +72,9 @@
           <ww:form action="buildProject.action" method="post">
             <ww:submit value="%{getText('summary.buildAll')}">
               <ww:param name="before">
-                <img src="<ww:url value="/images/icon_success_sml.gif"/>" alt="<ww:text name="message.success"/>" title="<ww:text name="message.success"/>"/> <ww:property value="nbSuccesses"/>
-                <img src="<ww:url value="/images/icon_warning_sml.gif"/>" alt="<ww:text name="message.failed"/>" title="<ww:text name="message.failed"/>"/> <ww:property value="nbFailures"/>
-                <img src="<ww:url value="/images/icon_error_sml.gif"/>" alt="<ww:text name="message.error"/>" title="<ww:text name="message.error"/>"/> <ww:property value="nbErrors"/>
+                <img src="<ww:url value='/images/icon_success_sml.gif'/>" alt="<ww:text name='message.success'/>" title="<ww:text name='message.success'/>"/> <ww:property value="nbSuccesses"/>
+                <img src="<ww:url value='/images/icon_warning_sml.gif'/>" alt="<ww:text name='message.failed'/>" title="<ww:text name='message.failed'/>"/> <ww:property value="nbFailures"/>
+                <img src="<ww:url value='/images/icon_error_sml.gif'/>" alt="<ww:text name='message.error'/>" title="<ww:text name='message.error'/>"/> <ww:property value="nbErrors"/>
               </ww:param>
             </ww:submit>
           </ww:form>

Modified: maven/continuum/trunk/continuum-webapp/src/main/webapp/workingCopy.jsp
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/webapp/workingCopy.jsp?rev=431931&r1=431930&r2=431931&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/webapp/workingCopy.jsp (original)
+++ maven/continuum/trunk/continuum-webapp/src/main/webapp/workingCopy.jsp Wed Aug 16 08:59:29 2006
@@ -8,8 +8,18 @@
       <div id="h3">
         <div>
           <p style="border-top: 1px solid transparent; border-bottom: 1px solid #DFDEDE;">
-            <a style="border: 1px solid #DFDEDE; padding-left: 1em; padding-right: 1em; text-decoration: none;" href="<ww:url value="/projectView.action?projectId="/><ww:property value="projectId"/>&projectName=<ww:property value="projectName"/>"><ww:text name="info"/></a>
-            <a style="border: 1px solid #DFDEDE; padding-left: 1em; padding-right: 1em; text-decoration: none;" href="<ww:url value="/buildResults.action?projectId="/><ww:property value="projectId"/>&projectName=<ww:property value="projectName"/>"><ww:text name="builds"/></a>
+            <a style="border: 1px solid #DFDEDE; padding-left: 1em; padding-right: 1em; text-decoration: none;"
+							href='<ww:url action="projectView">
+									<ww:param name="projectId" value="projectId"/>
+								</ww:url>'>
+							<ww:text name="info"/>
+						</a>
+            <a style="border: 1px solid #DFDEDE; padding-left: 1em; padding-right: 1em; text-decoration: none;"
+							href='<ww:url action="buildResults">
+									<ww:param name="projectId" value="projectId"/>
+								</ww:url>'>
+							<ww:text name="builds"/>
+						</a>
             <b style="border: 1px solid #DFDEDE; padding-left: 1em; padding-right: 1em;"><ww:text name="workingCopy"/></b>
           </p>
         </div>
@@ -20,7 +30,7 @@
             </ww:text>
         </h3>
 
-        <ww:property value="output"/>
+        <ww:property value="output" escape="false"/>
 
         <%
             if ( request.getParameter( "file" ) != null )