You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by pl...@apache.org on 2006/04/25 05:11:21 UTC

svn commit: r396759 - in /incubator/webwork2: action/ webapps/showcase/ webapps/showcase/src/main/java/org/apache/struts/action2/showcase/sitemesh/ webapps/showcase/src/main/java/org/apache/struts/webwork/ webapps/showcase/src/main/webapp/WEB-INF/ weba...

Author: plightbo
Date: Mon Apr 24 20:11:16 2006
New Revision: 396759

URL: http://svn.apache.org/viewcvs?rev=396759&view=rev
Log:
more showcase cleanup

Added:
    incubator/webwork2/webapps/showcase/src/main/java/org/apache/struts/action2/showcase/sitemesh/
    incubator/webwork2/webapps/showcase/src/main/java/org/apache/struts/action2/showcase/sitemesh/NoneDecoratorMapper.java
Removed:
    incubator/webwork2/webapps/showcase/src/main/java/org/apache/struts/webwork/
    incubator/webwork2/webapps/showcase/src/main/webapp/ajax/lesson1/
    incubator/webwork2/webapps/showcase/src/main/webapp/ajax/lesson2/
    incubator/webwork2/webapps/showcase/src/main/webapp/ajax/lesson3/
    incubator/webwork2/webapps/showcase/src/main/webapp/ajax/lesson5/
    incubator/webwork2/webapps/showcase/src/main/webapp/ajax/lesson6/
Modified:
    incubator/webwork2/action/pom.xml
    incubator/webwork2/webapps/showcase/pom.xml
    incubator/webwork2/webapps/showcase/src/main/webapp/WEB-INF/sitemesh.xml
    incubator/webwork2/webapps/showcase/src/main/webapp/ajax/AjaxResult.jsp
    incubator/webwork2/webapps/showcase/src/main/webapp/ajax/AjaxResult3.jsp
    incubator/webwork2/webapps/showcase/src/main/webapp/ajax/testjs.jsp

Modified: incubator/webwork2/action/pom.xml
URL: http://svn.apache.org/viewcvs/incubator/webwork2/action/pom.xml?rev=396759&r1=396758&r2=396759&view=diff
==============================================================================
--- incubator/webwork2/action/pom.xml (original)
+++ incubator/webwork2/action/pom.xml Mon Apr 24 20:11:16 2006
@@ -97,7 +97,6 @@
 
         <!-- Sitemesh -->
         <dependency>
-            <!-- group should be com.opensymphony -->
             <groupId>opensymphony</groupId>
             <artifactId>sitemesh</artifactId>
             <optional>true</optional>

Modified: incubator/webwork2/webapps/showcase/pom.xml
URL: http://svn.apache.org/viewcvs/incubator/webwork2/webapps/showcase/pom.xml?rev=396759&r1=396758&r2=396759&view=diff
==============================================================================
--- incubator/webwork2/webapps/showcase/pom.xml (original)
+++ incubator/webwork2/webapps/showcase/pom.xml Mon Apr 24 20:11:16 2006
@@ -13,6 +13,16 @@
     <name>Showcase Webapp</name>
     <dependencies>
         <dependency>
+            <groupId>opensymphony</groupId>
+            <artifactId>sitemesh</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>uk.ltd.getahead</groupId>
+            <artifactId>dwr</artifactId>
+        </dependency>
+
+        <dependency>
             <groupId>log4j</groupId>
             <artifactId>log4j</artifactId>
         </dependency>

Added: incubator/webwork2/webapps/showcase/src/main/java/org/apache/struts/action2/showcase/sitemesh/NoneDecoratorMapper.java
URL: http://svn.apache.org/viewcvs/incubator/webwork2/webapps/showcase/src/main/java/org/apache/struts/action2/showcase/sitemesh/NoneDecoratorMapper.java?rev=396759&view=auto
==============================================================================
--- incubator/webwork2/webapps/showcase/src/main/java/org/apache/struts/action2/showcase/sitemesh/NoneDecoratorMapper.java (added)
+++ incubator/webwork2/webapps/showcase/src/main/java/org/apache/struts/action2/showcase/sitemesh/NoneDecoratorMapper.java Mon Apr 24 20:11:16 2006
@@ -0,0 +1,20 @@
+package org.apache.struts.action2.showcase.sitemesh;
+
+import com.opensymphony.module.sitemesh.Decorator;
+import com.opensymphony.module.sitemesh.Page;
+import com.opensymphony.module.sitemesh.mapper.AbstractDecoratorMapper;
+
+import javax.servlet.http.HttpServletRequest;
+
+/**
+ * @author Patrick Lightbody (plightbo at gmail dot com)
+ */
+public class NoneDecoratorMapper extends AbstractDecoratorMapper {
+    public Decorator getDecorator(HttpServletRequest req, Page page) {
+        if ("none".equals(req.getAttribute("decorator"))) {
+            return null;
+        }
+
+        return super.getDecorator(req, page);
+    }
+}

Modified: incubator/webwork2/webapps/showcase/src/main/webapp/WEB-INF/sitemesh.xml
URL: http://svn.apache.org/viewcvs/incubator/webwork2/webapps/showcase/src/main/webapp/WEB-INF/sitemesh.xml?rev=396759&r1=396758&r2=396759&view=diff
==============================================================================
--- incubator/webwork2/webapps/showcase/src/main/webapp/WEB-INF/sitemesh.xml (original)
+++ incubator/webwork2/webapps/showcase/src/main/webapp/WEB-INF/sitemesh.xml Mon Apr 24 20:11:16 2006
@@ -47,6 +47,9 @@
         <mapper class="com.opensymphony.module.sitemesh.mapper.FileDecoratorMapper">
         </mapper>
 
+        <mapper class="org.apache.struts.action2.showcase.sitemesh.NoneDecoratorMapper">
+        </mapper>
+
         <mapper class="com.opensymphony.module.sitemesh.mapper.ConfigDecoratorMapper">
             <param name="config" value="${decorators-file}"/>
         </mapper>

Modified: incubator/webwork2/webapps/showcase/src/main/webapp/ajax/AjaxResult.jsp
URL: http://svn.apache.org/viewcvs/incubator/webwork2/webapps/showcase/src/main/webapp/ajax/AjaxResult.jsp?rev=396759&r1=396758&r2=396759&view=diff
==============================================================================
--- incubator/webwork2/webapps/showcase/src/main/webapp/ajax/AjaxResult.jsp (original)
+++ incubator/webwork2/webapps/showcase/src/main/webapp/ajax/AjaxResult.jsp Mon Apr 24 20:11:16 2006
@@ -1,9 +1,10 @@
 <%@ taglib prefix="saf" uri="/struts-action" %>
 
 <%
-response.setHeader("Cache-Control","no-cache"); //HTTP 1.1
-response.setHeader("Pragma","no-cache"); //HTTP 1.0
-response.setDateHeader ("Expires", 0); //prevents caching at the proxy server
+    request.setAttribute("decorator", "none");
+    response.setHeader("Cache-Control","no-cache"); //HTTP 1.1
+    response.setHeader("Pragma","no-cache"); //HTTP 1.0
+    response.setDateHeader ("Expires", 0); //prevents caching at the proxy server
 %>
 
 Result: <saf:property value="count"/> @ <saf:property value="serverTime"/>

Modified: incubator/webwork2/webapps/showcase/src/main/webapp/ajax/AjaxResult3.jsp
URL: http://svn.apache.org/viewcvs/incubator/webwork2/webapps/showcase/src/main/webapp/ajax/AjaxResult3.jsp?rev=396759&r1=396758&r2=396759&view=diff
==============================================================================
--- incubator/webwork2/webapps/showcase/src/main/webapp/ajax/AjaxResult3.jsp (original)
+++ incubator/webwork2/webapps/showcase/src/main/webapp/ajax/AjaxResult3.jsp Mon Apr 24 20:11:16 2006
@@ -1,9 +1,10 @@
 <%@ taglib prefix="saf" uri="/struts-action" %>
 
 <%
-response.setHeader("Cache-Control","no-cache"); //HTTP 1.1
-response.setHeader("Pragma","no-cache"); //HTTP 1.0
-response.setDateHeader ("Expires", 0); //prevents caching at the proxy server
+    request.setAttribute("decorator", "none");
+    response.setHeader("Cache-Control","no-cache"); //HTTP 1.1
+    response.setHeader("Pragma","no-cache"); //HTTP 1.0
+    response.setDateHeader ("Expires", 0); //prevents caching at the proxy server
 %>
 
 Result: <saf:property value="count"/> @ <saf:property value="serverTime"/>

Modified: incubator/webwork2/webapps/showcase/src/main/webapp/ajax/testjs.jsp
URL: http://svn.apache.org/viewcvs/incubator/webwork2/webapps/showcase/src/main/webapp/ajax/testjs.jsp?rev=396759&r1=396758&r2=396759&view=diff
==============================================================================
--- incubator/webwork2/webapps/showcase/src/main/webapp/ajax/testjs.jsp (original)
+++ incubator/webwork2/webapps/showcase/src/main/webapp/ajax/testjs.jsp Mon Apr 24 20:11:16 2006
@@ -1,4 +1,5 @@
 <%
+    request.setAttribute("decorator", "none");
     response.setHeader("Cache-Control","no-cache"); //HTTP 1.1
     response.setHeader("Pragma","no-cache"); //HTTP 1.0
     response.setDateHeader ("Expires", 0); //prevents caching at the proxy server



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org