struts-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lukaszlen...@apache.org
Subject [2/2] struts-examples git commit: Adjusts code to Struts 2.5
Date Fri, 04 Mar 2016 07:22:53 GMT
Adjusts code to Struts 2.5


Project: http://git-wip-us.apache.org/repos/asf/struts-examples/repo
Commit: http://git-wip-us.apache.org/repos/asf/struts-examples/commit/8a9466c9
Tree: http://git-wip-us.apache.org/repos/asf/struts-examples/tree/8a9466c9
Diff: http://git-wip-us.apache.org/repos/asf/struts-examples/diff/8a9466c9

Branch: refs/heads/master
Commit: 8a9466c905dcd2e0a6522d766ed5d3de08b91b5b
Parents: eed3bcd
Author: Lukasz Lenart <lukasz.lenart@gmail.com>
Authored: Fri Mar 4 08:22:41 2016 +0100
Committer: Lukasz Lenart <lukasz.lenart@gmail.com>
Committed: Fri Mar 4 08:22:41 2016 +0100

----------------------------------------------------------------------
 unknown-handler/pom.xml                                       | 2 --
 .../org/apache/strutsexamples/web/TilesUnknownHandler.java    | 7 +++++--
 2 files changed, 5 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/struts-examples/blob/8a9466c9/unknown-handler/pom.xml
----------------------------------------------------------------------
diff --git a/unknown-handler/pom.xml b/unknown-handler/pom.xml
index 1bb65a3..2bc9c4d 100644
--- a/unknown-handler/pom.xml
+++ b/unknown-handler/pom.xml
@@ -11,12 +11,10 @@
 
   <groupId>org.apache.org</groupId>
   <artifactId>unknown-handler</artifactId>
-  <version>1.0-SNAPSHOT</version>
   <packaging>war</packaging>
   <name>Unknown handler</name>
 
   <properties>
-    <struts2.version>2.3.24.1</struts2.version>
     <log4j2.version>2.2</log4j2.version>
     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
   </properties>

http://git-wip-us.apache.org/repos/asf/struts-examples/blob/8a9466c9/unknown-handler/src/main/java/org/apache/strutsexamples/web/TilesUnknownHandler.java
----------------------------------------------------------------------
diff --git a/unknown-handler/src/main/java/org/apache/strutsexamples/web/TilesUnknownHandler.java
b/unknown-handler/src/main/java/org/apache/strutsexamples/web/TilesUnknownHandler.java
index 9e1b2b8..a8884b5 100644
--- a/unknown-handler/src/main/java/org/apache/strutsexamples/web/TilesUnknownHandler.java
+++ b/unknown-handler/src/main/java/org/apache/strutsexamples/web/TilesUnknownHandler.java
@@ -11,6 +11,8 @@ import org.apache.struts2.ServletActionContext;
 import org.apache.struts2.views.tiles.TilesResult;
 import org.apache.tiles.TilesContainer;
 import org.apache.tiles.access.TilesAccess;
+import org.apache.tiles.request.servlet.ServletApplicationContext;
+import org.apache.tiles.request.servlet.ServletRequest;
 
 import javax.servlet.ServletContext;
 import javax.servlet.http.HttpServletRequest;
@@ -33,7 +35,8 @@ public class TilesUnknownHandler implements UnknownHandler {
         HttpServletRequest request = ServletActionContext.getRequest();
         HttpServletResponse response = ServletActionContext.getResponse();
 
-        TilesContainer container = TilesAccess.getContainer(servletContext);
+        ServletApplicationContext context = new ServletApplicationContext(servletContext);
+        TilesContainer container = TilesAccess.getContainer(context);
 
         String namespace = ServletActionContext.getActionMapping().getNamespace();
         Set<String> definitions = buildDefinitionNames(namespace, actionName, resultCode);
@@ -41,7 +44,7 @@ public class TilesUnknownHandler implements UnknownHandler {
         for (String definition : definitions) {
             LOG.debug("Looking for tiles definition: {}", definition);
 
-            if (container.isValidDefinition(definition, request, response)) {
+            if (container.isValidDefinition(definition, new ServletRequest(context, request,
response))) {
                 return new TilesResult(definition);
             }
         }


Mime
View raw message