struts-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lukaszlen...@apache.org
Subject [1/2] struts-examples git commit: WW-4470 Adds simple demo how to use unknown handler
Date Fri, 04 Mar 2016 07:22:52 GMT
Repository: struts-examples
Updated Branches:
  refs/heads/master 544e0730a -> 8a9466c90


WW-4470 Adds simple demo how to use unknown handler


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

Branch: refs/heads/master
Commit: eed3bcdaab000f1301d3476256e90c6729c8b59b
Parents: 544e073
Author: Lukasz Lenart <lukasz.lenart@gmail.com>
Authored: Fri Mar 4 08:06:17 2016 +0100
Committer: Lukasz Lenart <lukasz.lenart@gmail.com>
Committed: Fri Mar 4 08:06:17 2016 +0100

----------------------------------------------------------------------
 pom.xml                                         |   1 +
 unknown-handler/pom.xml                         | 117 +++++++++++++++++++
 .../org/apache/strutsexamples/actions/Home.java |  11 ++
 .../apache/strutsexamples/actions/Index.java    |  11 ++
 .../apache/strutsexamples/actions/Login.java    |  51 ++++++++
 .../strutsexamples/actions/admin/Users.java     |  11 ++
 .../strutsexamples/web/TilesUnknownHandler.java |  83 +++++++++++++
 unknown-handler/src/main/resources/log4j2.xml   |  16 +++
 unknown-handler/src/main/resources/struts.xml   |  35 ++++++
 .../src/main/webapp/WEB-INF/tiles.xml           |  27 +++++
 .../main/webapp/WEB-INF/tiles/admin/users.jsp   |   7 ++
 .../src/main/webapp/WEB-INF/tiles/home.jsp      |   7 ++
 .../src/main/webapp/WEB-INF/tiles/layout.jsp    |  59 ++++++++++
 .../src/main/webapp/WEB-INF/tiles/login.jsp     |  10 ++
 unknown-handler/src/main/webapp/WEB-INF/web.xml |  27 +++++
 unknown-handler/src/main/webapp/index.html      |  10 ++
 16 files changed, 483 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/struts-examples/blob/eed3bcda/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 553a596..940d175 100644
--- a/pom.xml
+++ b/pom.xml
@@ -77,6 +77,7 @@
         <module>message-store</module>
         <module>type-conversion</module>
         <module>wildcard-regex</module>
+        <module>unknown-handler</module>
   </modules>
 
     <dependencies>

http://git-wip-us.apache.org/repos/asf/struts-examples/blob/eed3bcda/unknown-handler/pom.xml
----------------------------------------------------------------------
diff --git a/unknown-handler/pom.xml b/unknown-handler/pom.xml
new file mode 100644
index 0000000..1bb65a3
--- /dev/null
+++ b/unknown-handler/pom.xml
@@ -0,0 +1,117 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+
+  <parent>
+    <artifactId>struts-examples</artifactId>
+    <groupId>org.apache.struts</groupId>
+    <version>1.0.0</version>
+  </parent>
+
+  <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>
+
+  <dependencies>
+
+    <dependency>
+      <groupId>org.apache.struts</groupId>
+      <artifactId>struts2-core</artifactId>
+      <version>${struts2.version}</version>
+    </dependency>
+
+    <dependency>
+      <groupId>org.apache.struts</groupId>
+      <artifactId>struts2-convention-plugin</artifactId>
+      <version>${struts2.version}</version>
+    </dependency>
+
+    <dependency>
+      <groupId>org.apache.struts</groupId>
+      <artifactId>struts2-tiles-plugin</artifactId>
+      <version>${struts2.version}</version>
+    </dependency>
+
+    <dependency>
+      <groupId>org.apache.struts</groupId>
+      <artifactId>struts2-config-browser-plugin</artifactId>
+      <version>${struts2.version}</version>
+    </dependency>
+
+    <dependency>
+      <groupId>org.apache.logging.log4j</groupId>
+      <artifactId>log4j-api</artifactId>
+      <version>${log4j2.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.logging.log4j</groupId>
+      <artifactId>log4j-core</artifactId>
+      <version>${log4j2.version}</version>
+    </dependency>
+
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <version>4.5</version>
+      <scope>test</scope>
+    </dependency>
+
+    <dependency>
+      <groupId>javax.servlet</groupId>
+      <artifactId>servlet-api</artifactId>
+      <version>2.4</version>
+      <scope>provided</scope>
+    </dependency>
+
+    <dependency>
+      <groupId>javax.servlet</groupId>
+      <artifactId>jsp-api</artifactId>
+      <version>2.0</version>
+      <scope>provided</scope>
+    </dependency>
+
+  </dependencies>
+
+  <build>
+    <plugins>
+      <plugin>
+        <artifactId>maven-compiler-plugin</artifactId>
+        <version>3.3</version>
+        <configuration>
+          <encoding>UTF-8</encoding>
+          <source>1.5</source>
+          <target>1.5</target>
+        </configuration>
+      </plugin>
+      <plugin>
+        <groupId>org.mortbay.jetty</groupId>
+        <artifactId>jetty-maven-plugin</artifactId>
+        <version>8.1.16.v20140903</version>
+        <configuration>
+          <stopKey>CTRL+C</stopKey>
+          <stopPort>8999</stopPort>
+          <systemProperties>
+            <systemProperty>
+              <name>xwork.loggerFactory</name>
+              <value>com.opensymphony.xwork2.util.logging.log4j2.Log4j2LoggerFactory</value>
+            </systemProperty>
+          </systemProperties>
+          <scanIntervalSeconds>10</scanIntervalSeconds>
+          <webAppSourceDirectory>${basedir}/src/main/webapp/</webAppSourceDirectory>
+          <webAppConfig>
+            <descriptor>${basedir}/src/main/webapp/WEB-INF/web.xml</descriptor>
+          </webAppConfig>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+</project>

http://git-wip-us.apache.org/repos/asf/struts-examples/blob/eed3bcda/unknown-handler/src/main/java/org/apache/strutsexamples/actions/Home.java
----------------------------------------------------------------------
diff --git a/unknown-handler/src/main/java/org/apache/strutsexamples/actions/Home.java b/unknown-handler/src/main/java/org/apache/strutsexamples/actions/Home.java
new file mode 100644
index 0000000..c9e654d
--- /dev/null
+++ b/unknown-handler/src/main/java/org/apache/strutsexamples/actions/Home.java
@@ -0,0 +1,11 @@
+package org.apache.strutsexamples.actions;
+
+import com.opensymphony.xwork2.ActionSupport;
+
+public class Home extends ActionSupport {
+
+    public String execute() throws Exception {
+        return SUCCESS;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/struts-examples/blob/eed3bcda/unknown-handler/src/main/java/org/apache/strutsexamples/actions/Index.java
----------------------------------------------------------------------
diff --git a/unknown-handler/src/main/java/org/apache/strutsexamples/actions/Index.java b/unknown-handler/src/main/java/org/apache/strutsexamples/actions/Index.java
new file mode 100644
index 0000000..114ad2e
--- /dev/null
+++ b/unknown-handler/src/main/java/org/apache/strutsexamples/actions/Index.java
@@ -0,0 +1,11 @@
+package org.apache.strutsexamples.actions;
+
+import com.opensymphony.xwork2.ActionSupport;
+
+public class Index extends ActionSupport {
+
+    public String execute() {
+        return "home";
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/struts-examples/blob/eed3bcda/unknown-handler/src/main/java/org/apache/strutsexamples/actions/Login.java
----------------------------------------------------------------------
diff --git a/unknown-handler/src/main/java/org/apache/strutsexamples/actions/Login.java b/unknown-handler/src/main/java/org/apache/strutsexamples/actions/Login.java
new file mode 100644
index 0000000..ec59735
--- /dev/null
+++ b/unknown-handler/src/main/java/org/apache/strutsexamples/actions/Login.java
@@ -0,0 +1,51 @@
+package org.apache.strutsexamples.actions;
+
+import com.opensymphony.xwork2.ActionSupport;
+import org.apache.struts2.convention.annotation.Action;
+import org.apache.struts2.interceptor.SessionAware;
+
+import java.util.Map;
+
+public class Login extends ActionSupport implements SessionAware {
+
+    private Map<String, Object> session;
+
+    private String email;
+    private String password;
+
+    public String execute() {
+        return SUCCESS;
+    }
+
+    @Action(value = "login-submit")
+    public String submit() {
+        if ("lukasz@demo.org".equals(email) && "secret".equals(password)) {
+            session.put("logged", Boolean.TRUE);
+            addActionMessage("Logged in!");
+            return "home";
+        } else {
+            addActionError("Cannot login!");
+            return "login";
+        }
+    }
+
+    public void setSession(Map<String, Object> session) {
+        this.session = session;
+    }
+
+    public String getEmail() {
+        return email;
+    }
+
+    public void setEmail(String email) {
+        this.email = email;
+    }
+
+    public String getPassword() {
+        return password;
+    }
+
+    public void setPassword(String password) {
+        this.password = password;
+    }
+}

http://git-wip-us.apache.org/repos/asf/struts-examples/blob/eed3bcda/unknown-handler/src/main/java/org/apache/strutsexamples/actions/admin/Users.java
----------------------------------------------------------------------
diff --git a/unknown-handler/src/main/java/org/apache/strutsexamples/actions/admin/Users.java
b/unknown-handler/src/main/java/org/apache/strutsexamples/actions/admin/Users.java
new file mode 100644
index 0000000..8a923f2
--- /dev/null
+++ b/unknown-handler/src/main/java/org/apache/strutsexamples/actions/admin/Users.java
@@ -0,0 +1,11 @@
+package org.apache.strutsexamples.actions.admin;
+
+import com.opensymphony.xwork2.ActionSupport;
+
+public class Users extends ActionSupport {
+
+    public String execute() {
+        return "users";
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/struts-examples/blob/eed3bcda/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
new file mode 100644
index 0000000..9e1b2b8
--- /dev/null
+++ b/unknown-handler/src/main/java/org/apache/strutsexamples/web/TilesUnknownHandler.java
@@ -0,0 +1,83 @@
+package org.apache.strutsexamples.web;
+
+import com.opensymphony.xwork2.ActionContext;
+import com.opensymphony.xwork2.Result;
+import com.opensymphony.xwork2.UnknownHandler;
+import com.opensymphony.xwork2.XWorkException;
+import com.opensymphony.xwork2.config.entities.ActionConfig;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
+import org.apache.struts2.ServletActionContext;
+import org.apache.struts2.views.tiles.TilesResult;
+import org.apache.tiles.TilesContainer;
+import org.apache.tiles.access.TilesAccess;
+
+import javax.servlet.ServletContext;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.util.LinkedHashSet;
+import java.util.Objects;
+import java.util.Set;
+
+public class TilesUnknownHandler implements UnknownHandler {
+
+    private static Logger LOG = LogManager.getLogger(TilesUnknownHandler.class);
+
+    public ActionConfig handleUnknownAction(String namespace, String actionName) throws XWorkException
{
+        return null;
+    }
+
+    public Result handleUnknownResult(ActionContext actionContext, String actionName, ActionConfig
actionConfig, String resultCode) throws XWorkException {
+
+        ServletContext servletContext = ServletActionContext.getServletContext();
+        HttpServletRequest request = ServletActionContext.getRequest();
+        HttpServletResponse response = ServletActionContext.getResponse();
+
+        TilesContainer container = TilesAccess.getContainer(servletContext);
+
+        String namespace = ServletActionContext.getActionMapping().getNamespace();
+        Set<String> definitions = buildDefinitionNames(namespace, actionName, resultCode);
+
+        for (String definition : definitions) {
+            LOG.debug("Looking for tiles definition: {}", definition);
+
+            if (container.isValidDefinition(definition, request, response)) {
+                return new TilesResult(definition);
+            }
+        }
+
+        LOG.warn("Couldn't find tiles definition for namespace {}, action name {} and result
code {}", namespace, actionName, resultCode);
+        return null;
+    }
+
+    protected Set<String> buildDefinitionNames(String namespace, String actionName,
String resultCode) {
+        Set<String> definitions = new LinkedHashSet<String>();
+
+        if (namespace.startsWith("/")) {
+            namespace = namespace.substring(1);
+        }
+
+        if (!Objects.equals(namespace, "") && !Objects.equals(namespace, "/")){
+            if (namespace.endsWith("/")) {
+                definitions.add(namespace + actionName);
+                definitions.add(namespace + actionName + "-" + resultCode);
+                definitions.add(namespace + resultCode);
+            } else {
+                definitions.add(namespace + "/" + actionName);
+                definitions.add(namespace + "/" + actionName + "-" + resultCode);
+                definitions.add(namespace + "/" + resultCode);
+            }
+        }
+
+        definitions.add(actionName);
+        definitions.add(actionName + "-" + resultCode);
+
+        LOG.debug("Possible definition's names {}", definitions);
+
+        return definitions;
+    }
+
+    public Object handleUnknownActionMethod(Object action, String methodName) {
+        return null;
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/struts-examples/blob/eed3bcda/unknown-handler/src/main/resources/log4j2.xml
----------------------------------------------------------------------
diff --git a/unknown-handler/src/main/resources/log4j2.xml b/unknown-handler/src/main/resources/log4j2.xml
new file mode 100644
index 0000000..043ce96
--- /dev/null
+++ b/unknown-handler/src/main/resources/log4j2.xml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Configuration>
+    <Appenders>
+        <Console name="STDOUT" target="SYSTEM_OUT">
+            <PatternLayout pattern="%d %-5p [%t] %C{2} (%F:%L) - %m%n"/>
+        </Console>
+    </Appenders>
+    <Loggers>
+        <Logger name="com.opensymphony.xwork2" level="info"/>
+        <Logger name="org.apache.struts2" level="info"/>
+        <Logger name="org.apache.org" level="debug"/>
+        <Root level="warn">
+            <AppenderRef ref="STDOUT"/>
+        </Root>
+    </Loggers>
+</Configuration>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/struts-examples/blob/eed3bcda/unknown-handler/src/main/resources/struts.xml
----------------------------------------------------------------------
diff --git a/unknown-handler/src/main/resources/struts.xml b/unknown-handler/src/main/resources/struts.xml
new file mode 100644
index 0000000..d03c7aa
--- /dev/null
+++ b/unknown-handler/src/main/resources/struts.xml
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE struts PUBLIC
+    "-//Apache Software Foundation//DTD Struts Configuration 2.3//EN"
+    "http://struts.apache.org/dtds/struts-2.3.dtd">
+<struts>
+  <constant name="struts.enable.DynamicMethodInvocation" value="false"/>
+  <constant name="struts.devMode" value="true"/>
+
+  <constant name="struts.convention.action.packages" value="org.apache.strutsexamples.web.actions"/>
+  <constant name="struts.convention.default.parent.package" value="default"/>
+
+  <bean type="com.opensymphony.xwork2.UnknownHandler" name="tiles-convention" class="org.apache.strutsexamples.web.TilesUnknownHandler"/>
+
+  <package name="default" namespace="/" extends="struts-default">
+
+    <result-types>
+      <result-type name="tiles" class="org.apache.struts2.views.tiles.TilesResult" default="true"
/>
+    </result-types>
+
+    <default-action-ref name="index"/>
+
+    <global-results>
+      <result name="home" type="redirectAction">
+        <param name="actionName">home</param>
+        <param name="namespace">/</param>
+      </result>
+    </global-results>
+
+  </package>
+
+  <unknown-handler-stack>
+    <unknown-handler-ref name="tiles-convention"/>
+  </unknown-handler-stack>
+
+</struts>

http://git-wip-us.apache.org/repos/asf/struts-examples/blob/eed3bcda/unknown-handler/src/main/webapp/WEB-INF/tiles.xml
----------------------------------------------------------------------
diff --git a/unknown-handler/src/main/webapp/WEB-INF/tiles.xml b/unknown-handler/src/main/webapp/WEB-INF/tiles.xml
new file mode 100644
index 0000000..35d3bd0
--- /dev/null
+++ b/unknown-handler/src/main/webapp/WEB-INF/tiles.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!DOCTYPE tiles-definitions PUBLIC
+    "-//Apache Software Foundation//DTD Tiles Configuration 2.0//EN"
+    "http://tiles.apache.org/dtds/tiles-config_2_0.dtd">
+<tiles-definitions>
+
+  <definition name="baseLayout" template="/WEB-INF/tiles/layout.jsp">
+    <put-attribute name="title" value="Template"/>
+    <put-attribute name="body" value="/WEB-INF/tiles/body.jsp"/>
+  </definition>
+
+  <definition name="home" extends="baseLayout">
+    <put-attribute name="title" value="Home" />
+    <put-attribute name="body" value="/WEB-INF/tiles/home.jsp"/>
+  </definition>
+
+  <definition name="login" extends="baseLayout">
+    <put-attribute name="title" value="Login" />
+    <put-attribute name="body" value="/WEB-INF/tiles/login.jsp"/>
+  </definition>
+
+  <definition name="admin/users" extends="baseLayout">
+    <put-attribute name="title" value="Users"/>
+    <put-attribute name="body" value="/WEB-INF/tiles/admin/users.jsp"/>
+  </definition>
+
+</tiles-definitions>

http://git-wip-us.apache.org/repos/asf/struts-examples/blob/eed3bcda/unknown-handler/src/main/webapp/WEB-INF/tiles/admin/users.jsp
----------------------------------------------------------------------
diff --git a/unknown-handler/src/main/webapp/WEB-INF/tiles/admin/users.jsp b/unknown-handler/src/main/webapp/WEB-INF/tiles/admin/users.jsp
new file mode 100644
index 0000000..a45e74f
--- /dev/null
+++ b/unknown-handler/src/main/webapp/WEB-INF/tiles/admin/users.jsp
@@ -0,0 +1,7 @@
+<%@ page contentType="text/html; charset=UTF-8" %>
+<%@ taglib prefix="s" uri="/struts-tags" %>
+<%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles" %>
+
+<div class="row">
+  Users
+</div>

http://git-wip-us.apache.org/repos/asf/struts-examples/blob/eed3bcda/unknown-handler/src/main/webapp/WEB-INF/tiles/home.jsp
----------------------------------------------------------------------
diff --git a/unknown-handler/src/main/webapp/WEB-INF/tiles/home.jsp b/unknown-handler/src/main/webapp/WEB-INF/tiles/home.jsp
new file mode 100644
index 0000000..65bc9b9
--- /dev/null
+++ b/unknown-handler/src/main/webapp/WEB-INF/tiles/home.jsp
@@ -0,0 +1,7 @@
+<%@ page contentType="text/html; charset=UTF-8" %>
+<%@ taglib prefix="s" uri="/struts-tags" %>
+<%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles" %>
+
+<div class="row">
+  home
+</div>

http://git-wip-us.apache.org/repos/asf/struts-examples/blob/eed3bcda/unknown-handler/src/main/webapp/WEB-INF/tiles/layout.jsp
----------------------------------------------------------------------
diff --git a/unknown-handler/src/main/webapp/WEB-INF/tiles/layout.jsp b/unknown-handler/src/main/webapp/WEB-INF/tiles/layout.jsp
new file mode 100644
index 0000000..2569198
--- /dev/null
+++ b/unknown-handler/src/main/webapp/WEB-INF/tiles/layout.jsp
@@ -0,0 +1,59 @@
+<%@ taglib prefix="s" uri="/struts-tags" %>
+<%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles" %>
+<%@ page contentType="text/html; charset=UTF-8" %>
+<!DOCTYPE html>
+
+<html>
+<head>
+  <meta charset="utf-8">
+  <meta http-equiv="X-UA-Compatible" content="IE=edge">
+  <meta name="viewport" content="width=device-width, initial-scale=1">
+  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+  <title>
+    <tiles:insertAttribute name="title" ignore="true"/>
+  </title>
+  <link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css">
+
+  <!-- Le HTML5 shim, for IE6-8 support of HTML elements -->
+  <!--[if lt IE 9]>
+  <script src="//html5shim.googlecode.com/svn/trunk/html5.js"></script>
+  <![endif]-->
+
+</head>
+<body>
+<nav class="navbar navbar-inverse">
+  <div class="container">
+    <div class="navbar-header">
+      <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar"
+              aria-expanded="false" aria-controls="navbar">
+        <span class="sr-only">Toggle navigation</span>
+        <span class="icon-bar"></span>
+        <span class="icon-bar"></span>
+        <span class="icon-bar"></span>
+      </button>
+      <a class="navbar-brand" href="/">Home</a>
+    </div>
+    <div id="navbar" class="collapse navbar-collapse">
+      <ul class="nav navbar-nav">
+        <li>
+          <s:url var="login" action="login" namespace="/"/>
+          <s:a href="%{login}">Login</s:a>
+        </li>
+        <li>
+          <s:url var="users" action="users" namespace="/admin"/>
+          <s:a href="%{users}">Users</s:a>
+        </li>
+        <li><a href="#contact">Contact</a></li>
+      </ul>
+    </div><!--/.nav-collapse -->
+  </div>
+</nav>
+
+<div class="container">
+  <div class="row">
+    <h2><tiles:insertAttribute name="title"/></h2>
+  </div>
+  <tiles:insertAttribute name="body"/>
+</div>
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/struts-examples/blob/eed3bcda/unknown-handler/src/main/webapp/WEB-INF/tiles/login.jsp
----------------------------------------------------------------------
diff --git a/unknown-handler/src/main/webapp/WEB-INF/tiles/login.jsp b/unknown-handler/src/main/webapp/WEB-INF/tiles/login.jsp
new file mode 100644
index 0000000..ac1df08
--- /dev/null
+++ b/unknown-handler/src/main/webapp/WEB-INF/tiles/login.jsp
@@ -0,0 +1,10 @@
+<%@ page contentType="text/html; charset=UTF-8" %>
+<%@ taglib prefix="s" uri="/struts-tags" %>
+
+<s:actionerror/>
+
+<s:form action="login-submit" method="POST" class="form-horizontal col-sm-4">
+  <s:textfield name="email" label="E-mail"/>
+  <s:password name="password" label="Password" />
+  <s:submit label="Login" class="btn btn-default col-sm-offset-3"/>
+</s:form>

http://git-wip-us.apache.org/repos/asf/struts-examples/blob/eed3bcda/unknown-handler/src/main/webapp/WEB-INF/web.xml
----------------------------------------------------------------------
diff --git a/unknown-handler/src/main/webapp/WEB-INF/web.xml b/unknown-handler/src/main/webapp/WEB-INF/web.xml
new file mode 100644
index 0000000..bb76a73
--- /dev/null
+++ b/unknown-handler/src/main/webapp/WEB-INF/web.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<web-app id="struts_blank" version="2.4"
+         xmlns="http://java.sun.com/xml/ns/j2ee" 
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
+  <display-name>Struts Blank</display-name>
+
+  <listener>
+    <listener-class>org.apache.struts2.tiles.StrutsTilesListener</listener-class>
+  </listener>
+
+  <filter>
+    <filter-name>struts2</filter-name>
+    <filter-class>
+      org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter
+    </filter-class>
+  </filter>
+
+  <filter-mapping>
+    <filter-name>struts2</filter-name>
+    <url-pattern>/*</url-pattern>
+  </filter-mapping>
+
+  <welcome-file-list>
+    <welcome-file>index.html</welcome-file>
+  </welcome-file-list>
+</web-app>

http://git-wip-us.apache.org/repos/asf/struts-examples/blob/eed3bcda/unknown-handler/src/main/webapp/index.html
----------------------------------------------------------------------
diff --git a/unknown-handler/src/main/webapp/index.html b/unknown-handler/src/main/webapp/index.html
new file mode 100644
index 0000000..abdee36
--- /dev/null
+++ b/unknown-handler/src/main/webapp/index.html
@@ -0,0 +1,10 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<html>
+<head>
+    <META HTTP-EQUIV="Refresh" CONTENT="0;URL=index.action">
+</head>
+
+<body>
+<p>Loading ...</p>
+</body>
+</html>


Mime
View raw message