struts-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jo...@apache.org
Subject [2/2] struts-examples git commit: Switch to log4j2 in all examples which are using log4j
Date Fri, 12 Jun 2015 14:27:18 GMT
Switch to log4j2 in all examples which are using log4j


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

Branch: refs/heads/master
Commit: a66c0865e8a3a8870c8e5183e439a08ee0a5b89e
Parents: c917927
Author: Johannes Geppert <jogep@apache.org>
Authored: Fri Jun 12 16:27:15 2015 +0200
Committer: Johannes Geppert <jogep@apache.org>
Committed: Fri Jun 12 16:27:15 2015 +0200

----------------------------------------------------------------------
 annotations/pom.xml                             |  61 +++--
 .../main/java/example/actions/HelloAction.java  |  65 +++---
 .../java/example/actions/RegisterAction.java    |  81 +++----
 .../src/main/java/example/model/Person.java     |  36 ++-
 annotations/src/main/resources/log4j.dtd        | 227 -------------------
 annotations/src/main/resources/log4j.xml        |  28 ---
 annotations/src/main/resources/log4j2.xml       |  16 ++
 .../webapp/WEB-INF/content/hello-success.jsp    |  11 +-
 .../src/main/webapp/WEB-INF/content/index.jsp   |   1 +
 .../webapp/WEB-INF/content/register-input.jsp   |  28 +--
 .../webapp/WEB-INF/content/register-success.jsp |  10 +-
 annotations/src/main/webapp/WEB-INF/web.xml     |  36 +--
 blank/src/main/webapp/WEB-INF/web.xml           |   2 +-
 .../apache/struts/edit/action/EditAction.java   |  60 +----
 exclude_parameters/src/main/resources/log4j.dtd | 227 -------------------
 exclude_parameters/src/main/resources/log4j.xml |  28 ---
 .../src/main/resources/log4j2.xml               |  16 ++
 pom.xml                                         |   7 +-
 .../apache/struts/edit/action/EditAction.java   | 191 +++++++---------
 .../src/main/resources/log4j.dtd                | 227 -------------------
 .../src/main/resources/log4j.xml                |  28 ---
 .../src/main/resources/log4j2.xml               |  16 ++
 .../org/apache/struts/example/MovieAction.java  |  19 +-
 .../src/main/resources/log4j.dtd                | 227 -------------------
 .../src/main/resources/log4j.xml                |  28 ---
 .../src/main/resources/log4j2.xml               |  16 ++
 wildcard_method_selection/pom.xml               |  54 +++--
 .../wildcardmethod/action/PersonAction.java     | 194 +++++++---------
 .../wildcardmethod/service/PersonService.java   |  73 ++----
 .../src/main/resources/log4j.dtd                | 227 -------------------
 .../src/main/resources/log4j.xml                |  35 ---
 .../src/main/resources/log4j2.xml               |  16 ++
 .../src/main/webapp/WEB-INF/web.xml             |   3 +-
 .../src/main/webapp/index.jsp                   |   1 +
 34 files changed, 467 insertions(+), 1828 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/struts-examples/blob/a66c0865/annotations/pom.xml
----------------------------------------------------------------------
diff --git a/annotations/pom.xml b/annotations/pom.xml
index 3396449..98a1d45 100644
--- a/annotations/pom.xml
+++ b/annotations/pom.xml
@@ -1,33 +1,46 @@
 <?xml version="1.0"?>
 <project
-	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
-	xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
-	<modelVersion>4.0.0</modelVersion>
-	<parent>
-		<groupId>struts.apache.org</groupId>
-		<artifactId>struts2examples</artifactId>
-		<version>1.0.0</version>
-	</parent>
+        xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
+        xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>struts.apache.org</groupId>
+        <artifactId>struts2examples</artifactId>
+        <version>1.0.0</version>
+    </parent>
 
-	<artifactId>annotations</artifactId>
+    <artifactId>annotations</artifactId>
 
-	<name>annotations</name>
+    <name>Annotations with Convention Plugin</name>
 
-	<description>Annotations example application for the 
-  Struts 2 getting started tutorials</description>
-	<packaging>war</packaging>
-	<build>
-		<finalName>annotations</finalName>
-	</build>
+    <description>Annotations example application for the Struts 2 getting started tutorials</description>
+    <packaging>war</packaging>
 
-	<dependencies>
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.struts</groupId>
+            <artifactId>struts2-convention-plugin</artifactId>
+            <version>${struts2.version}</version>
+        </dependency>
+    </dependencies>
 
-
-		<dependency>
-			<groupId>org.apache.struts</groupId>
-			<artifactId>struts2-convention-plugin</artifactId>
-			<version>${struts2.version}</version>
-		</dependency>
-	</dependencies>
+    <build>
+        <finalName>annotations</finalName>
+        <plugins>
+            <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>
+                    <scanIntervalSeconds>10</scanIntervalSeconds>
+                    <scanTargets>
+                        <scanTarget>src/main/webapp/WEB-INF/web.xml</scanTarget>
+                    </scanTargets>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
 
 </project>

http://git-wip-us.apache.org/repos/asf/struts-examples/blob/a66c0865/annotations/src/main/java/example/actions/HelloAction.java
----------------------------------------------------------------------
diff --git a/annotations/src/main/java/example/actions/HelloAction.java b/annotations/src/main/java/example/actions/HelloAction.java
index 03f7eab..91c2c9d 100644
--- a/annotations/src/main/java/example/actions/HelloAction.java
+++ b/annotations/src/main/java/example/actions/HelloAction.java
@@ -1,48 +1,41 @@
 package example.actions;
 
-import org.apache.log4j.Logger;
-
-
 import com.opensymphony.xwork2.ActionSupport;
-
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 /**
  * Acts as a controller to handle actions
  * related to registering a user.
- * @author bruce phillips
  *
+ * @author bruce phillips
  */
 public class HelloAction extends ActionSupport {
-	
-	private static final long serialVersionUID = 1L;
-	
-	private static final Logger logger = Logger.getLogger( HelloAction.class.getName() );
-	
-	private String message;
-	
-		
-	public String execute() throws Exception {
-		
-		logger.info("In execute method of class Hello");
-		
-		message = "Hello from Struts 2 with no XML configuration.";
-		
-		return SUCCESS;
-		
-	}
-
-
-	public void setMessage(String message) {
-		this.message = message;
-	}
-
-
-	public String getMessage() {
-		return message;
-	}
-	
-
-
-	
+
+    private static final long serialVersionUID = 1L;
+
+    private static final Logger log = LogManager.getLogger(HelloAction.class);
+
+    private String message;
+
+
+    public String execute() throws Exception {
+
+        log.info("In execute method of class Hello");
+
+        message = "Hello from Struts 2 with no XML configuration.";
+
+        return SUCCESS;
+    }
+
+
+    public void setMessage(String message) {
+        this.message = message;
+    }
+
+
+    public String getMessage() {
+        return message;
+    }
 
 
 }

http://git-wip-us.apache.org/repos/asf/struts-examples/blob/a66c0865/annotations/src/main/java/example/actions/RegisterAction.java
----------------------------------------------------------------------
diff --git a/annotations/src/main/java/example/actions/RegisterAction.java b/annotations/src/main/java/example/actions/RegisterAction.java
index 50d19ee..42e5f32 100644
--- a/annotations/src/main/java/example/actions/RegisterAction.java
+++ b/annotations/src/main/java/example/actions/RegisterAction.java
@@ -1,58 +1,49 @@
 package example.actions;
 
-import org.apache.log4j.Logger;
-import org.apache.struts2.convention.annotation.Action;
-
 import com.opensymphony.xwork2.ActionSupport;
-
 import example.model.Person;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
+import org.apache.struts2.convention.annotation.Action;
 
 /**
  * Acts as a controller to handle actions
  * related to registering a user.
- * @author bruce phillips
  *
+ * @author bruce phillips
  */
 public class RegisterAction extends ActionSupport {
-	
-	private static final long serialVersionUID = 1L;
-	
-	private static final Logger logger = Logger.getLogger( RegisterAction.class.getName() );
-	
-	private Person personBean;
-	
-	@Action("register-input")
-	public String input() throws Exception {
-
-		logger.info("In input method of class RegisterAction");
-		
-		return INPUT;
-
-	}
-
-	public String execute() throws Exception {
-		
-		logger.info("In execute method of class RegisterAction");
-		
-		//call Service class to store personBean's state in database
-		
-		return SUCCESS;
-		
-	}
-	
-
-
-	
-	public Person getPersonBean() {
-		
-		return personBean;
-		
-	}
-	
-	public void setPersonBean(Person person) {
-		
-		personBean = person;
-		
-	}
+
+    private static final long serialVersionUID = 1L;
+
+    private static final Logger log = LogManager.getLogger(RegisterAction.class);
+
+    private Person personBean;
+
+    @Action("register-input")
+    public String input() throws Exception {
+
+        log.info("In input method of class RegisterAction");
+
+        return INPUT;
+    }
+
+    public String execute() throws Exception {
+
+        log.info("In execute method of class RegisterAction");
+
+        //call Service class to store personBean's state in database
+
+        return SUCCESS;
+    }
+
+
+    public Person getPersonBean() {
+        return personBean;
+    }
+
+    public void setPersonBean(Person person) {
+        personBean = person;
+    }
 
 }

http://git-wip-us.apache.org/repos/asf/struts-examples/blob/a66c0865/annotations/src/main/java/example/model/Person.java
----------------------------------------------------------------------
diff --git a/annotations/src/main/java/example/model/Person.java b/annotations/src/main/java/example/model/Person.java
index 010f9ef..92669e3 100644
--- a/annotations/src/main/java/example/model/Person.java
+++ b/annotations/src/main/java/example/model/Person.java
@@ -3,60 +3,50 @@ package example.model;
 
 /**
  * Models a Person who registers.
- * @author bruce phillips
  *
+ * @author bruce phillips
  */
-public class Person
-{
+public class Person {
     private String firstName;
     private String lastName;
     private String email;
     private int age;
 
-    public String getFirstName()
-    {
+    public String getFirstName() {
         return firstName;
     }
 
-    public void setFirstName(String firstName)
-    {
+    public void setFirstName(String firstName) {
         this.firstName = firstName;
     }
 
-    public String getLastName()
-    {
+    public String getLastName() {
         return lastName;
     }
 
-    public void setLastName(String lastName)
-    {
+    public void setLastName(String lastName) {
         this.lastName = lastName;
     }
 
-    public String getEmail()
-    {
+    public String getEmail() {
         return email;
     }
 
-    public void setEmail(String email)
-    {
+    public void setEmail(String email) {
         this.email = email;
     }
 
-    public int getAge()
-    {
+    public int getAge() {
         return age;
     }
 
-    public void setAge( int age)
-    {
+    public void setAge(int age) {
         this.age = age;
     }
 
 
-    public String toString()
-    {
-        return "First Name: " + getFirstName() + " Last Name:  " + getLastName() + 
-        " Email:      " + getEmail() + " Age:      " + getAge() ;
+    public String toString() {
+        return "First Name: " + getFirstName() + " Last Name:  " + getLastName() +
+                " Email:      " + getEmail() + " Age:      " + getAge();
     }
 }

http://git-wip-us.apache.org/repos/asf/struts-examples/blob/a66c0865/annotations/src/main/resources/log4j.dtd
----------------------------------------------------------------------
diff --git a/annotations/src/main/resources/log4j.dtd b/annotations/src/main/resources/log4j.dtd
deleted file mode 100644
index 1aabd96..0000000
--- a/annotations/src/main/resources/log4j.dtd
+++ /dev/null
@@ -1,227 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<!--
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements.  See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License.  You may obtain a copy of the License at
-
-      http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-
-<!-- Authors: Chris Taylor, Ceki Gulcu. -->
-
-<!-- Version: 1.2 -->
-
-<!-- A configuration element consists of optional renderer
-elements,appender elements, categories and an optional root
-element. -->
-
-<!ELEMENT log4j:configuration (renderer*, appender*,plugin*, (category|logger)*,root?,
-                               (categoryFactory|loggerFactory)?)>
-
-<!-- The "threshold" attribute takes a level value below which -->
-<!-- all logging statements are disabled. -->
-
-<!-- Setting the "debug" enable the printing of internal log4j logging   -->
-<!-- statements.                                                         -->
-
-<!-- By default, debug attribute is "null", meaning that we not do touch -->
-<!-- internal log4j logging settings. The "null" value for the threshold -->
-<!-- attribute can be misleading. The threshold field of a repository	 -->
-<!-- cannot be set to null. The "null" value for the threshold attribute -->
-<!-- simply means don't touch the threshold field, the threshold field   --> 
-<!-- keeps its old value.                                                -->
-     
-<!ATTLIST log4j:configuration
-  xmlns:log4j              CDATA #FIXED "http://jakarta.apache.org/log4j/" 
-  threshold                (all|trace|debug|info|warn|error|fatal|off|null) "null"
-  debug                    (true|false|null)  "null"
-  reset                    (true|false) "false"
->
-
-<!-- renderer elements allow the user to customize the conversion of  -->
-<!-- message objects to String.                                       -->
-
-<!ELEMENT renderer EMPTY>
-<!ATTLIST renderer
-  renderedClass  CDATA #REQUIRED
-  renderingClass CDATA #REQUIRED
->
-
-<!-- Appenders must have a name and a class. -->
-<!-- Appenders may contain an error handler, a layout, optional parameters -->
-<!-- and filters. They may also reference (or include) other appenders. -->
-<!ELEMENT appender (errorHandler?, param*,
-      rollingPolicy?, triggeringPolicy?, connectionSource?,
-      layout?, filter*, appender-ref*)>
-<!ATTLIST appender
-  name 		CDATA 	#REQUIRED
-  class 	CDATA	#REQUIRED
->
-
-<!ELEMENT layout (param*)>
-<!ATTLIST layout
-  class		CDATA	#REQUIRED
->
-
-<!ELEMENT filter (param*)>
-<!ATTLIST filter
-  class		CDATA	#REQUIRED
->
-
-<!-- ErrorHandlers can be of any class. They can admit any number of -->
-<!-- parameters. -->
-
-<!ELEMENT errorHandler (param*, root-ref?, logger-ref*,  appender-ref?)> 
-<!ATTLIST errorHandler
-   class        CDATA   #REQUIRED 
->
-
-<!ELEMENT root-ref EMPTY>
-
-<!ELEMENT logger-ref EMPTY>
-<!ATTLIST logger-ref
-  ref CDATA #REQUIRED
->
-
-<!ELEMENT param EMPTY>
-<!ATTLIST param
-  name		CDATA   #REQUIRED
-  value		CDATA	#REQUIRED
->
-
-
-<!-- The priority class is org.apache.log4j.Level by default -->
-<!ELEMENT priority (param*)>
-<!ATTLIST priority
-  class   CDATA	#IMPLIED
-  value	  CDATA #REQUIRED
->
-
-<!-- The level class is org.apache.log4j.Level by default -->
-<!ELEMENT level (param*)>
-<!ATTLIST level
-  class   CDATA	#IMPLIED
-  value	  CDATA #REQUIRED
->
-
-
-<!-- If no level element is specified, then the configurator MUST not -->
-<!-- touch the level of the named category. -->
-<!ELEMENT category (param*,(priority|level)?,appender-ref*)>
-<!ATTLIST category
-  class         CDATA   #IMPLIED
-  name		CDATA	#REQUIRED
-  additivity	(true|false) "true"  
->
-
-<!-- If no level element is specified, then the configurator MUST not -->
-<!-- touch the level of the named logger. -->
-<!ELEMENT logger (level?,appender-ref*)>
-<!ATTLIST logger
-  name		CDATA	#REQUIRED
-  additivity	(true|false) "true"  
->
-
-
-<!ELEMENT categoryFactory (param*)>
-<!ATTLIST categoryFactory 
-   class        CDATA #REQUIRED>
-
-<!ELEMENT loggerFactory (param*)>
-<!ATTLIST loggerFactory
-   class        CDATA #REQUIRED>
-
-<!ELEMENT appender-ref EMPTY>
-<!ATTLIST appender-ref
-  ref CDATA #REQUIRED
->
-
-<!-- plugins must have a name and class and can have optional parameters -->
-<!ELEMENT plugin (param*, connectionSource?)>
-<!ATTLIST plugin
-  name 		CDATA 	   #REQUIRED
-  class 	CDATA  #REQUIRED
->
-
-<!ELEMENT connectionSource (dataSource?, param*)>
-<!ATTLIST connectionSource
-  class        CDATA  #REQUIRED
->
-
-<!ELEMENT dataSource (param*)>
-<!ATTLIST dataSource
-  class        CDATA  #REQUIRED
->
-
-<!ELEMENT triggeringPolicy ((param|filter)*)>
-<!ATTLIST triggeringPolicy
-  name 		CDATA  #IMPLIED
-  class 	CDATA  #REQUIRED
->
-
-<!ELEMENT rollingPolicy (param*)>
-<!ATTLIST rollingPolicy
-  name 		CDATA  #IMPLIED
-  class 	CDATA  #REQUIRED
->
-
-
-<!-- If no priority element is specified, then the configurator MUST not -->
-<!-- touch the priority of root. -->
-<!-- The root category always exists and cannot be subclassed. -->
-<!ELEMENT root (param*, (priority|level)?, appender-ref*)>
-
-
-<!-- ==================================================================== -->
-<!--                       A logging event                                -->
-<!-- ==================================================================== -->
-<!ELEMENT log4j:eventSet (log4j:event*)>
-<!ATTLIST log4j:eventSet
-  xmlns:log4j             CDATA #FIXED "http://jakarta.apache.org/log4j/" 
-  version                (1.1|1.2) "1.2" 
-  includesLocationInfo   (true|false) "true"
->
-
-
-
-<!ELEMENT log4j:event (log4j:message, log4j:NDC?, log4j:throwable?, 
-                       log4j:locationInfo?, log4j:properties?) >
-
-<!-- The timestamp format is application dependent. -->
-<!ATTLIST log4j:event
-    logger     CDATA #REQUIRED
-    level      CDATA #REQUIRED
-    thread     CDATA #REQUIRED
-    timestamp  CDATA #REQUIRED
-    time       CDATA #IMPLIED
->
-
-<!ELEMENT log4j:message (#PCDATA)>
-<!ELEMENT log4j:NDC (#PCDATA)>
-
-<!ELEMENT log4j:throwable (#PCDATA)>
-
-<!ELEMENT log4j:locationInfo EMPTY>
-<!ATTLIST log4j:locationInfo
-  class  CDATA	#REQUIRED
-  method CDATA	#REQUIRED
-  file   CDATA	#REQUIRED
-  line   CDATA	#REQUIRED
->
-
-<!ELEMENT log4j:properties (log4j:data*)>
-
-<!ELEMENT log4j:data EMPTY>
-<!ATTLIST log4j:data
-  name   CDATA	#REQUIRED
-  value  CDATA	#REQUIRED
->

http://git-wip-us.apache.org/repos/asf/struts-examples/blob/a66c0865/annotations/src/main/resources/log4j.xml
----------------------------------------------------------------------
diff --git a/annotations/src/main/resources/log4j.xml b/annotations/src/main/resources/log4j.xml
deleted file mode 100644
index 2100cb2..0000000
--- a/annotations/src/main/resources/log4j.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<!DOCTYPE log4j:configuration PUBLIC "-//log4j/log4j Configuration//EN" "log4j.dtd">
-
-<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
-    
-    <appender name="STDOUT" class="org.apache.log4j.ConsoleAppender">
-       <layout class="org.apache.log4j.PatternLayout"> 
-          <param name="ConversionPattern" value="%d %-5p %c.%M:%L - %m%n"/> 
-       </layout> 
-    </appender>
- 
-    <!-- specify the logging level for loggers from other libraries -->
-    <logger name="com.opensymphony">
-    	<level value="DEBUG" />
-    </logger>
-
-    <logger name="org.apache.struts2">
-    	 <level value="DEBUG" />
-    </logger>
-  
-   <!-- for all other loggers log only debug and above log messages -->
-     <root>
-        <priority value="INFO"/> 
-        <appender-ref ref="STDOUT" /> 
-     </root> 
-    
-</log4j:configuration> 
-

http://git-wip-us.apache.org/repos/asf/struts-examples/blob/a66c0865/annotations/src/main/resources/log4j2.xml
----------------------------------------------------------------------
diff --git a/annotations/src/main/resources/log4j2.xml b/annotations/src/main/resources/log4j2.xml
new file mode 100644
index 0000000..3b08ab1
--- /dev/null
+++ b/annotations/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="example" level="debug"/>
+        <Root level="info">
+            <AppenderRef ref="STDOUT"/>
+        </Root>
+    </Loggers>
+</Configuration>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/struts-examples/blob/a66c0865/annotations/src/main/webapp/WEB-INF/content/hello-success.jsp
----------------------------------------------------------------------
diff --git a/annotations/src/main/webapp/WEB-INF/content/hello-success.jsp b/annotations/src/main/webapp/WEB-INF/content/hello-success.jsp
index 00119be..b02f233 100644
--- a/annotations/src/main/webapp/WEB-INF/content/hello-success.jsp
+++ b/annotations/src/main/webapp/WEB-INF/content/hello-success.jsp
@@ -1,19 +1,18 @@
 <?xml version="1.0" encoding="ISO-8859-1" ?>
 <%@ taglib prefix="s" uri="/struts-tags" %>
 <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
-    pageEncoding="ISO-8859-1"%>
+         pageEncoding="ISO-8859-1" %>
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml">
 <head>
-<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
-<title>Hello</title>
+    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
+    <title>Hello</title>
 </head>
 <body>
-<h3><s:property value="message" /></h3>
+<h3><s:property value="message"/></h3>
 
 
-
-<p><a href="index.jsp" >Return to home page</a>.</p>
+<p><a href="index.jsp">Return to home page</a>.</p>
 
 </body>
 </html>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/struts-examples/blob/a66c0865/annotations/src/main/webapp/WEB-INF/content/index.jsp
----------------------------------------------------------------------
diff --git a/annotations/src/main/webapp/WEB-INF/content/index.jsp b/annotations/src/main/webapp/WEB-INF/content/index.jsp
new file mode 100644
index 0000000..08ef1fc
--- /dev/null
+++ b/annotations/src/main/webapp/WEB-INF/content/index.jsp
@@ -0,0 +1 @@
+<% response.sendRedirect("/index.jsp"); %>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/struts-examples/blob/a66c0865/annotations/src/main/webapp/WEB-INF/content/register-input.jsp
----------------------------------------------------------------------
diff --git a/annotations/src/main/webapp/WEB-INF/content/register-input.jsp b/annotations/src/main/webapp/WEB-INF/content/register-input.jsp
index ab6562f..7ec62b7 100644
--- a/annotations/src/main/webapp/WEB-INF/content/register-input.jsp
+++ b/annotations/src/main/webapp/WEB-INF/content/register-input.jsp
@@ -1,27 +1,27 @@
 <?xml version="1.0" encoding="ISO-8859-1" ?>
 <%@ taglib prefix="s" uri="/struts-tags" %>
 <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
-    pageEncoding="ISO-8859-1"%>
+         pageEncoding="ISO-8859-1" %>
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml">
 <head>
-<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
-<title>Register</title>
-<s:head />
+    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
+    <title>Register</title>
+    <s:head/>
 </head>
 <body>
 <h3>Register for a prize by completing this form.</h3>
 
-<s:form action="register" >
+<s:form action="register">
+
+    <s:textfield name="personBean.firstName" label="First name"/>
+    <s:textfield name="personBean.lastName" label="Last name"/>
+    <s:textfield name="personBean.email" label="Email"/>
+    <s:textfield name="personBean.age" label="Age"/>
+
+    <s:submit/>
+
+</s:form>
 
- 	  <s:textfield name="personBean.firstName" label="First name" />
- 	  <s:textfield  name="personBean.lastName" label="Last name" />
- 	  <s:textfield name="personBean.email"  label ="Email"/>  
- 	  <s:textfield name="personBean.age"  label="Age"  />
- 	  
-   	  <s:submit/>
-   	  
-</s:form>	
- 
 </body>
 </html>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/struts-examples/blob/a66c0865/annotations/src/main/webapp/WEB-INF/content/register-success.jsp
----------------------------------------------------------------------
diff --git a/annotations/src/main/webapp/WEB-INF/content/register-success.jsp b/annotations/src/main/webapp/WEB-INF/content/register-success.jsp
index 174f0ad..c9c0e52 100644
--- a/annotations/src/main/webapp/WEB-INF/content/register-success.jsp
+++ b/annotations/src/main/webapp/WEB-INF/content/register-success.jsp
@@ -1,19 +1,19 @@
 <?xml version="1.0" encoding="ISO-8859-1" ?>
 <%@ taglib prefix="s" uri="/struts-tags" %>
 <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
-    pageEncoding="ISO-8859-1"%>
+         pageEncoding="ISO-8859-1" %>
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml">
 <head>
-<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
-<title>Registration Successful</title>
+    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
+    <title>Registration Successful</title>
 </head>
 <body>
 <h3>Thank you for registering for a prize.</h3>
 
-<p>Your registration information: <s:property value="personBean" /> </p>
+<p>Your registration information: <s:property value="personBean"/></p>
 
-<p><a href="index.jsp" >Return to home page</a>.</p>
+<p><a href="index.jsp">Return to home page</a>.</p>
 
 </body>
 </html>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/struts-examples/blob/a66c0865/annotations/src/main/webapp/WEB-INF/web.xml
----------------------------------------------------------------------
diff --git a/annotations/src/main/webapp/WEB-INF/web.xml b/annotations/src/main/webapp/WEB-INF/web.xml
index 84ed515..f67db04 100644
--- a/annotations/src/main/webapp/WEB-INF/web.xml
+++ b/annotations/src/main/webapp/WEB-INF/web.xml
@@ -1,25 +1,25 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <web-app id="WebApp_ID" 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>annotations</display-name>
-	<welcome-file-list>
-		<welcome-file>index.jsp</welcome-file>
-	</welcome-file-list>
+         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>annotations</display-name>
+    <welcome-file-list>
+        <welcome-file>index.jsp</welcome-file>
+    </welcome-file-list>
 
 
-	<filter>
-		<filter-name>struts2</filter-name>
-		<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
-		<init-param>
-			<param-name>struts.devMode</param-name>
-			<param-value>true</param-value>
-		</init-param>
-	</filter>
+    <filter>
+        <filter-name>struts2</filter-name>
+        <filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
+        <init-param>
+            <param-name>struts.devMode</param-name>
+            <param-value>true</param-value>
+        </init-param>
+    </filter>
 
-	<filter-mapping>
-		<filter-name>struts2</filter-name>
-		<url-pattern>/*</url-pattern>
-	</filter-mapping>
+    <filter-mapping>
+        <filter-name>struts2</filter-name>
+        <url-pattern>/*</url-pattern>
+    </filter-mapping>
 
 </web-app>

http://git-wip-us.apache.org/repos/asf/struts-examples/blob/a66c0865/blank/src/main/webapp/WEB-INF/web.xml
----------------------------------------------------------------------
diff --git a/blank/src/main/webapp/WEB-INF/web.xml b/blank/src/main/webapp/WEB-INF/web.xml
index f15252b..301bcb2 100644
--- a/blank/src/main/webapp/WEB-INF/web.xml
+++ b/blank/src/main/webapp/WEB-INF/web.xml
@@ -16,7 +16,7 @@
     </filter-mapping>
 
     <welcome-file-list>
-        <welcome-file>index.html</welcome-file>
+        <welcome-file>index.jsp</welcome-file>
     </welcome-file-list>
 
     <!-- Restricts access to pure JSP files - access available only via Struts action -->

http://git-wip-us.apache.org/repos/asf/struts-examples/blob/a66c0865/exclude_parameters/src/main/java/org/apache/struts/edit/action/EditAction.java
----------------------------------------------------------------------
diff --git a/exclude_parameters/src/main/java/org/apache/struts/edit/action/EditAction.java b/exclude_parameters/src/main/java/org/apache/struts/edit/action/EditAction.java
index a576a9d..0383bbc 100644
--- a/exclude_parameters/src/main/java/org/apache/struts/edit/action/EditAction.java
+++ b/exclude_parameters/src/main/java/org/apache/struts/edit/action/EditAction.java
@@ -1,10 +1,9 @@
 package org.apache.struts.edit.action;
 
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import org.apache.log4j.Logger;
+import com.opensymphony.xwork2.ActionSupport;
+import com.opensymphony.xwork2.Preparable;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.apache.struts.edit.model.Person;
 import org.apache.struts.edit.model.State;
 import org.apache.struts.edit.service.CarModelsService;
@@ -12,8 +11,9 @@ import org.apache.struts.edit.service.CarModelsServiceHardCoded;
 import org.apache.struts.edit.service.EditService;
 import org.apache.struts.edit.service.EditServiceInMemory;
 
-import com.opensymphony.xwork2.ActionSupport;
-import com.opensymphony.xwork2.Preparable;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
 
 /**
  * Acts as a controller to handle actions
@@ -22,98 +22,64 @@ import com.opensymphony.xwork2.Preparable;
  *
  */
 public class EditAction extends ActionSupport implements Preparable {
-	
-	private static Logger log = Logger.getLogger( EditAction.class.getName() );
-	
+
+	private static Logger log = LogManager.getLogger(EditAction.class);
 	private static final long serialVersionUID = 1L;
 	
 	private EditService editService = new EditServiceInMemory();
-	
 	private CarModelsService carModelsService = new CarModelsServiceHardCoded() ;
 	
 	private Person personBean;
-	
 	private String [] sports = {"football", "baseball", "basketball" };
-	
 	private String [] genders = {"male", "female", "not sure" };
-	
 	private List<State> states ;
-
 	private String [] carModelsAvailable ;
-	
-	
 
 	@Override
 	public void prepare() throws Exception {
-		
 		log.info("In prepare method...");
-		
 		carModelsAvailable = carModelsService.getCarModels() ;
-		
 		setPersonBean( editService.getPerson() );
-
 	}
 
 	public void prepareExecute() {
-		
 		log.info("In prepareExecute method...");
-		
-		
 	}
 	
 	public String execute() throws Exception {
-		
 		log.info ("In execute method...");
-		
 	    editService.savePerson( getPersonBean() );
-		
 		return SUCCESS;
-		
 	}
 	
 	public void prepareInput() {
-		
 		log.info("In prepareInput method...");
-		
 	}
 	
 	public String input() throws Exception {
-		
 		log.info("In input method...");
-		
-		
 		return INPUT;
 	}
 	
 	public Person getPersonBean() {
-		
-		
 		return personBean;
-		
 	}
 	
 	public void setPersonBean(Person person) {
-		
 		personBean = person;
-		
 	}
 
-
 	public List<String> getSports() {
 		return Arrays.asList(sports);
 	}
 	
 	public List<String> getGenders() {
-		
 		return Arrays.asList(genders);
-		
 	}
 
-
-
 	public List<State> getStates() {
-		
-		states = new ArrayList<State>();
+
+		states = new ArrayList<>();
 		states.add( new State("AZ", "Arizona") );
 		states.add( new State("CA", "California") );
 		states.add( new State("FL", "Florida") );
@@ -123,11 +89,7 @@ public class EditAction extends ActionSupport implements Preparable {
 		return states;
 	}
 
-
-
 	public String [] getCarModelsAvailable() {
 		return carModelsAvailable;
 	}
-
-
 }

http://git-wip-us.apache.org/repos/asf/struts-examples/blob/a66c0865/exclude_parameters/src/main/resources/log4j.dtd
----------------------------------------------------------------------
diff --git a/exclude_parameters/src/main/resources/log4j.dtd b/exclude_parameters/src/main/resources/log4j.dtd
deleted file mode 100644
index 1aabd96..0000000
--- a/exclude_parameters/src/main/resources/log4j.dtd
+++ /dev/null
@@ -1,227 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<!--
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements.  See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License.  You may obtain a copy of the License at
-
-      http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-
-<!-- Authors: Chris Taylor, Ceki Gulcu. -->
-
-<!-- Version: 1.2 -->
-
-<!-- A configuration element consists of optional renderer
-elements,appender elements, categories and an optional root
-element. -->
-
-<!ELEMENT log4j:configuration (renderer*, appender*,plugin*, (category|logger)*,root?,
-                               (categoryFactory|loggerFactory)?)>
-
-<!-- The "threshold" attribute takes a level value below which -->
-<!-- all logging statements are disabled. -->
-
-<!-- Setting the "debug" enable the printing of internal log4j logging   -->
-<!-- statements.                                                         -->
-
-<!-- By default, debug attribute is "null", meaning that we not do touch -->
-<!-- internal log4j logging settings. The "null" value for the threshold -->
-<!-- attribute can be misleading. The threshold field of a repository	 -->
-<!-- cannot be set to null. The "null" value for the threshold attribute -->
-<!-- simply means don't touch the threshold field, the threshold field   --> 
-<!-- keeps its old value.                                                -->
-     
-<!ATTLIST log4j:configuration
-  xmlns:log4j              CDATA #FIXED "http://jakarta.apache.org/log4j/" 
-  threshold                (all|trace|debug|info|warn|error|fatal|off|null) "null"
-  debug                    (true|false|null)  "null"
-  reset                    (true|false) "false"
->
-
-<!-- renderer elements allow the user to customize the conversion of  -->
-<!-- message objects to String.                                       -->
-
-<!ELEMENT renderer EMPTY>
-<!ATTLIST renderer
-  renderedClass  CDATA #REQUIRED
-  renderingClass CDATA #REQUIRED
->
-
-<!-- Appenders must have a name and a class. -->
-<!-- Appenders may contain an error handler, a layout, optional parameters -->
-<!-- and filters. They may also reference (or include) other appenders. -->
-<!ELEMENT appender (errorHandler?, param*,
-      rollingPolicy?, triggeringPolicy?, connectionSource?,
-      layout?, filter*, appender-ref*)>
-<!ATTLIST appender
-  name 		CDATA 	#REQUIRED
-  class 	CDATA	#REQUIRED
->
-
-<!ELEMENT layout (param*)>
-<!ATTLIST layout
-  class		CDATA	#REQUIRED
->
-
-<!ELEMENT filter (param*)>
-<!ATTLIST filter
-  class		CDATA	#REQUIRED
->
-
-<!-- ErrorHandlers can be of any class. They can admit any number of -->
-<!-- parameters. -->
-
-<!ELEMENT errorHandler (param*, root-ref?, logger-ref*,  appender-ref?)> 
-<!ATTLIST errorHandler
-   class        CDATA   #REQUIRED 
->
-
-<!ELEMENT root-ref EMPTY>
-
-<!ELEMENT logger-ref EMPTY>
-<!ATTLIST logger-ref
-  ref CDATA #REQUIRED
->
-
-<!ELEMENT param EMPTY>
-<!ATTLIST param
-  name		CDATA   #REQUIRED
-  value		CDATA	#REQUIRED
->
-
-
-<!-- The priority class is org.apache.log4j.Level by default -->
-<!ELEMENT priority (param*)>
-<!ATTLIST priority
-  class   CDATA	#IMPLIED
-  value	  CDATA #REQUIRED
->
-
-<!-- The level class is org.apache.log4j.Level by default -->
-<!ELEMENT level (param*)>
-<!ATTLIST level
-  class   CDATA	#IMPLIED
-  value	  CDATA #REQUIRED
->
-
-
-<!-- If no level element is specified, then the configurator MUST not -->
-<!-- touch the level of the named category. -->
-<!ELEMENT category (param*,(priority|level)?,appender-ref*)>
-<!ATTLIST category
-  class         CDATA   #IMPLIED
-  name		CDATA	#REQUIRED
-  additivity	(true|false) "true"  
->
-
-<!-- If no level element is specified, then the configurator MUST not -->
-<!-- touch the level of the named logger. -->
-<!ELEMENT logger (level?,appender-ref*)>
-<!ATTLIST logger
-  name		CDATA	#REQUIRED
-  additivity	(true|false) "true"  
->
-
-
-<!ELEMENT categoryFactory (param*)>
-<!ATTLIST categoryFactory 
-   class        CDATA #REQUIRED>
-
-<!ELEMENT loggerFactory (param*)>
-<!ATTLIST loggerFactory
-   class        CDATA #REQUIRED>
-
-<!ELEMENT appender-ref EMPTY>
-<!ATTLIST appender-ref
-  ref CDATA #REQUIRED
->
-
-<!-- plugins must have a name and class and can have optional parameters -->
-<!ELEMENT plugin (param*, connectionSource?)>
-<!ATTLIST plugin
-  name 		CDATA 	   #REQUIRED
-  class 	CDATA  #REQUIRED
->
-
-<!ELEMENT connectionSource (dataSource?, param*)>
-<!ATTLIST connectionSource
-  class        CDATA  #REQUIRED
->
-
-<!ELEMENT dataSource (param*)>
-<!ATTLIST dataSource
-  class        CDATA  #REQUIRED
->
-
-<!ELEMENT triggeringPolicy ((param|filter)*)>
-<!ATTLIST triggeringPolicy
-  name 		CDATA  #IMPLIED
-  class 	CDATA  #REQUIRED
->
-
-<!ELEMENT rollingPolicy (param*)>
-<!ATTLIST rollingPolicy
-  name 		CDATA  #IMPLIED
-  class 	CDATA  #REQUIRED
->
-
-
-<!-- If no priority element is specified, then the configurator MUST not -->
-<!-- touch the priority of root. -->
-<!-- The root category always exists and cannot be subclassed. -->
-<!ELEMENT root (param*, (priority|level)?, appender-ref*)>
-
-
-<!-- ==================================================================== -->
-<!--                       A logging event                                -->
-<!-- ==================================================================== -->
-<!ELEMENT log4j:eventSet (log4j:event*)>
-<!ATTLIST log4j:eventSet
-  xmlns:log4j             CDATA #FIXED "http://jakarta.apache.org/log4j/" 
-  version                (1.1|1.2) "1.2" 
-  includesLocationInfo   (true|false) "true"
->
-
-
-
-<!ELEMENT log4j:event (log4j:message, log4j:NDC?, log4j:throwable?, 
-                       log4j:locationInfo?, log4j:properties?) >
-
-<!-- The timestamp format is application dependent. -->
-<!ATTLIST log4j:event
-    logger     CDATA #REQUIRED
-    level      CDATA #REQUIRED
-    thread     CDATA #REQUIRED
-    timestamp  CDATA #REQUIRED
-    time       CDATA #IMPLIED
->
-
-<!ELEMENT log4j:message (#PCDATA)>
-<!ELEMENT log4j:NDC (#PCDATA)>
-
-<!ELEMENT log4j:throwable (#PCDATA)>
-
-<!ELEMENT log4j:locationInfo EMPTY>
-<!ATTLIST log4j:locationInfo
-  class  CDATA	#REQUIRED
-  method CDATA	#REQUIRED
-  file   CDATA	#REQUIRED
-  line   CDATA	#REQUIRED
->
-
-<!ELEMENT log4j:properties (log4j:data*)>
-
-<!ELEMENT log4j:data EMPTY>
-<!ATTLIST log4j:data
-  name   CDATA	#REQUIRED
-  value  CDATA	#REQUIRED
->

http://git-wip-us.apache.org/repos/asf/struts-examples/blob/a66c0865/exclude_parameters/src/main/resources/log4j.xml
----------------------------------------------------------------------
diff --git a/exclude_parameters/src/main/resources/log4j.xml b/exclude_parameters/src/main/resources/log4j.xml
deleted file mode 100644
index 2100cb2..0000000
--- a/exclude_parameters/src/main/resources/log4j.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<!DOCTYPE log4j:configuration PUBLIC "-//log4j/log4j Configuration//EN" "log4j.dtd">
-
-<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
-    
-    <appender name="STDOUT" class="org.apache.log4j.ConsoleAppender">
-       <layout class="org.apache.log4j.PatternLayout"> 
-          <param name="ConversionPattern" value="%d %-5p %c.%M:%L - %m%n"/> 
-       </layout> 
-    </appender>
- 
-    <!-- specify the logging level for loggers from other libraries -->
-    <logger name="com.opensymphony">
-    	<level value="DEBUG" />
-    </logger>
-
-    <logger name="org.apache.struts2">
-    	 <level value="DEBUG" />
-    </logger>
-  
-   <!-- for all other loggers log only debug and above log messages -->
-     <root>
-        <priority value="INFO"/> 
-        <appender-ref ref="STDOUT" /> 
-     </root> 
-    
-</log4j:configuration> 
-

http://git-wip-us.apache.org/repos/asf/struts-examples/blob/a66c0865/exclude_parameters/src/main/resources/log4j2.xml
----------------------------------------------------------------------
diff --git a/exclude_parameters/src/main/resources/log4j2.xml b/exclude_parameters/src/main/resources/log4j2.xml
new file mode 100644
index 0000000..d7c09f9
--- /dev/null
+++ b/exclude_parameters/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.struts2.edit" 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/a66c0865/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 2e355a9..86ee2cb 100644
--- a/pom.xml
+++ b/pom.xml
@@ -15,7 +15,6 @@
     <properties>
         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
         <struts2.version>2.3.25-SNAPSHOT</struts2.version>
-        <log4j.version>1.2.17</log4j.version>
         <log4j2.version>2.3</log4j2.version>
     </properties>
 
@@ -78,9 +77,9 @@
         </dependency>
 
         <dependency>
-            <groupId>log4j</groupId>
-            <artifactId>log4j</artifactId>
-            <version>${log4j.version}</version>
+            <groupId>org.apache.logging.log4j</groupId>
+            <artifactId>log4j-core</artifactId>
+            <version>${log4j2.version}</version>
         </dependency>
 
     </dependencies>

http://git-wip-us.apache.org/repos/asf/struts-examples/blob/a66c0865/preparable_interface/src/main/java/org/apache/struts/edit/action/EditAction.java
----------------------------------------------------------------------
diff --git a/preparable_interface/src/main/java/org/apache/struts/edit/action/EditAction.java b/preparable_interface/src/main/java/org/apache/struts/edit/action/EditAction.java
index a576a9d..1d9f288 100644
--- a/preparable_interface/src/main/java/org/apache/struts/edit/action/EditAction.java
+++ b/preparable_interface/src/main/java/org/apache/struts/edit/action/EditAction.java
@@ -1,10 +1,9 @@
 package org.apache.struts.edit.action;
 
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import org.apache.log4j.Logger;
+import com.opensymphony.xwork2.ActionSupport;
+import com.opensymphony.xwork2.Preparable;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.apache.struts.edit.model.Person;
 import org.apache.struts.edit.model.State;
 import org.apache.struts.edit.service.CarModelsService;
@@ -12,122 +11,86 @@ import org.apache.struts.edit.service.CarModelsServiceHardCoded;
 import org.apache.struts.edit.service.EditService;
 import org.apache.struts.edit.service.EditServiceInMemory;
 
-import com.opensymphony.xwork2.ActionSupport;
-import com.opensymphony.xwork2.Preparable;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
 
 /**
  * Acts as a controller to handle actions
  * related to editing a Person.
- * @author bruce phillips
  *
+ * @author bruce phillips
  */
 public class EditAction extends ActionSupport implements Preparable {
-	
-	private static Logger log = Logger.getLogger( EditAction.class.getName() );
-	
-	private static final long serialVersionUID = 1L;
-	
-	private EditService editService = new EditServiceInMemory();
-	
-	private CarModelsService carModelsService = new CarModelsServiceHardCoded() ;
-	
-	private Person personBean;
-	
-	private String [] sports = {"football", "baseball", "basketball" };
-	
-	private String [] genders = {"male", "female", "not sure" };
-	
-	private List<State> states ;
-
-	private String [] carModelsAvailable ;
-	
-	
-
-	@Override
-	public void prepare() throws Exception {
-		
-		log.info("In prepare method...");
-		
-		carModelsAvailable = carModelsService.getCarModels() ;
-		
-		setPersonBean( editService.getPerson() );
-
-	}
-
-	public void prepareExecute() {
-		
-		log.info("In prepareExecute method...");
-		
-		
-	}
-	
-	public String execute() throws Exception {
-		
-		log.info ("In execute method...");
-		
-	    editService.savePerson( getPersonBean() );
-		
-		return SUCCESS;
-		
-	}
-	
-	public void prepareInput() {
-		
-		log.info("In prepareInput method...");
-		
-	}
-	
-	public String input() throws Exception {
-		
-		log.info("In input method...");
-		
-		
-		return INPUT;
-	}
-	
-	public Person getPersonBean() {
-		
-		
-		return personBean;
-		
-	}
-	
-	public void setPersonBean(Person person) {
-		
-		personBean = person;
-		
-	}
-
-
-	public List<String> getSports() {
-		return Arrays.asList(sports);
-	}
-	
-	public List<String> getGenders() {
-		
-		return Arrays.asList(genders);
-		
-	}
-
-
-
-	public List<State> getStates() {
-		
-		states = new ArrayList<State>();
-		states.add( new State("AZ", "Arizona") );
-		states.add( new State("CA", "California") );
-		states.add( new State("FL", "Florida") );
-		states.add( new State("KS", "Kansas") );
-		states.add( new State("NY", "New York") );
-		
-		return states;
-	}
-
-
-
-	public String [] getCarModelsAvailable() {
-		return carModelsAvailable;
-	}
 
+    private static Logger log = LogManager.getLogger(EditAction.class);
+    private static final long serialVersionUID = 1L;
+
+    private EditService editService = new EditServiceInMemory();
+    private CarModelsService carModelsService = new CarModelsServiceHardCoded();
+
+    private Person personBean;
+    private String[] sports = {"football", "baseball", "basketball"};
+    private String[] genders = {"male", "female", "not sure"};
+    private List<State> states;
+    private String[] carModelsAvailable;
+
+
+    @Override
+    public void prepare() throws Exception {
+        log.debug("In prepare method...");
+        carModelsAvailable = carModelsService.getCarModels();
+        setPersonBean(editService.getPerson());
+    }
+
+    public void prepareExecute() {
+        log.debug("In prepareExecute method...");
+    }
+
+    public String execute() throws Exception {
+        log.debug("In execute method...");
+        editService.savePerson(getPersonBean());
+        return SUCCESS;
+    }
+
+    public void prepareInput() {
+        log.debug("In prepareInput method...");
+    }
+
+    public String input() throws Exception {
+        log.debug("In input method...");
+        return INPUT;
+    }
+
+    public Person getPersonBean() {
+        return personBean;
+    }
+
+    public void setPersonBean(Person person) {
+        personBean = person;
+    }
+
+    public List<String> getSports() {
+        return Arrays.asList(sports);
+    }
+
+    public List<String> getGenders() {
+        return Arrays.asList(genders);
+    }
+
+    public List<State> getStates() {
+
+        states = new ArrayList<>();
+        states.add(new State("AZ", "Arizona"));
+        states.add(new State("CA", "California"));
+        states.add(new State("FL", "Florida"));
+        states.add(new State("KS", "Kansas"));
+        states.add(new State("NY", "New York"));
+
+        return states;
+    }
 
+    public String[] getCarModelsAvailable() {
+        return carModelsAvailable;
+    }
 }

http://git-wip-us.apache.org/repos/asf/struts-examples/blob/a66c0865/preparable_interface/src/main/resources/log4j.dtd
----------------------------------------------------------------------
diff --git a/preparable_interface/src/main/resources/log4j.dtd b/preparable_interface/src/main/resources/log4j.dtd
deleted file mode 100644
index 1aabd96..0000000
--- a/preparable_interface/src/main/resources/log4j.dtd
+++ /dev/null
@@ -1,227 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<!--
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements.  See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License.  You may obtain a copy of the License at
-
-      http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-
-<!-- Authors: Chris Taylor, Ceki Gulcu. -->
-
-<!-- Version: 1.2 -->
-
-<!-- A configuration element consists of optional renderer
-elements,appender elements, categories and an optional root
-element. -->
-
-<!ELEMENT log4j:configuration (renderer*, appender*,plugin*, (category|logger)*,root?,
-                               (categoryFactory|loggerFactory)?)>
-
-<!-- The "threshold" attribute takes a level value below which -->
-<!-- all logging statements are disabled. -->
-
-<!-- Setting the "debug" enable the printing of internal log4j logging   -->
-<!-- statements.                                                         -->
-
-<!-- By default, debug attribute is "null", meaning that we not do touch -->
-<!-- internal log4j logging settings. The "null" value for the threshold -->
-<!-- attribute can be misleading. The threshold field of a repository	 -->
-<!-- cannot be set to null. The "null" value for the threshold attribute -->
-<!-- simply means don't touch the threshold field, the threshold field   --> 
-<!-- keeps its old value.                                                -->
-     
-<!ATTLIST log4j:configuration
-  xmlns:log4j              CDATA #FIXED "http://jakarta.apache.org/log4j/" 
-  threshold                (all|trace|debug|info|warn|error|fatal|off|null) "null"
-  debug                    (true|false|null)  "null"
-  reset                    (true|false) "false"
->
-
-<!-- renderer elements allow the user to customize the conversion of  -->
-<!-- message objects to String.                                       -->
-
-<!ELEMENT renderer EMPTY>
-<!ATTLIST renderer
-  renderedClass  CDATA #REQUIRED
-  renderingClass CDATA #REQUIRED
->
-
-<!-- Appenders must have a name and a class. -->
-<!-- Appenders may contain an error handler, a layout, optional parameters -->
-<!-- and filters. They may also reference (or include) other appenders. -->
-<!ELEMENT appender (errorHandler?, param*,
-      rollingPolicy?, triggeringPolicy?, connectionSource?,
-      layout?, filter*, appender-ref*)>
-<!ATTLIST appender
-  name 		CDATA 	#REQUIRED
-  class 	CDATA	#REQUIRED
->
-
-<!ELEMENT layout (param*)>
-<!ATTLIST layout
-  class		CDATA	#REQUIRED
->
-
-<!ELEMENT filter (param*)>
-<!ATTLIST filter
-  class		CDATA	#REQUIRED
->
-
-<!-- ErrorHandlers can be of any class. They can admit any number of -->
-<!-- parameters. -->
-
-<!ELEMENT errorHandler (param*, root-ref?, logger-ref*,  appender-ref?)> 
-<!ATTLIST errorHandler
-   class        CDATA   #REQUIRED 
->
-
-<!ELEMENT root-ref EMPTY>
-
-<!ELEMENT logger-ref EMPTY>
-<!ATTLIST logger-ref
-  ref CDATA #REQUIRED
->
-
-<!ELEMENT param EMPTY>
-<!ATTLIST param
-  name		CDATA   #REQUIRED
-  value		CDATA	#REQUIRED
->
-
-
-<!-- The priority class is org.apache.log4j.Level by default -->
-<!ELEMENT priority (param*)>
-<!ATTLIST priority
-  class   CDATA	#IMPLIED
-  value	  CDATA #REQUIRED
->
-
-<!-- The level class is org.apache.log4j.Level by default -->
-<!ELEMENT level (param*)>
-<!ATTLIST level
-  class   CDATA	#IMPLIED
-  value	  CDATA #REQUIRED
->
-
-
-<!-- If no level element is specified, then the configurator MUST not -->
-<!-- touch the level of the named category. -->
-<!ELEMENT category (param*,(priority|level)?,appender-ref*)>
-<!ATTLIST category
-  class         CDATA   #IMPLIED
-  name		CDATA	#REQUIRED
-  additivity	(true|false) "true"  
->
-
-<!-- If no level element is specified, then the configurator MUST not -->
-<!-- touch the level of the named logger. -->
-<!ELEMENT logger (level?,appender-ref*)>
-<!ATTLIST logger
-  name		CDATA	#REQUIRED
-  additivity	(true|false) "true"  
->
-
-
-<!ELEMENT categoryFactory (param*)>
-<!ATTLIST categoryFactory 
-   class        CDATA #REQUIRED>
-
-<!ELEMENT loggerFactory (param*)>
-<!ATTLIST loggerFactory
-   class        CDATA #REQUIRED>
-
-<!ELEMENT appender-ref EMPTY>
-<!ATTLIST appender-ref
-  ref CDATA #REQUIRED
->
-
-<!-- plugins must have a name and class and can have optional parameters -->
-<!ELEMENT plugin (param*, connectionSource?)>
-<!ATTLIST plugin
-  name 		CDATA 	   #REQUIRED
-  class 	CDATA  #REQUIRED
->
-
-<!ELEMENT connectionSource (dataSource?, param*)>
-<!ATTLIST connectionSource
-  class        CDATA  #REQUIRED
->
-
-<!ELEMENT dataSource (param*)>
-<!ATTLIST dataSource
-  class        CDATA  #REQUIRED
->
-
-<!ELEMENT triggeringPolicy ((param|filter)*)>
-<!ATTLIST triggeringPolicy
-  name 		CDATA  #IMPLIED
-  class 	CDATA  #REQUIRED
->
-
-<!ELEMENT rollingPolicy (param*)>
-<!ATTLIST rollingPolicy
-  name 		CDATA  #IMPLIED
-  class 	CDATA  #REQUIRED
->
-
-
-<!-- If no priority element is specified, then the configurator MUST not -->
-<!-- touch the priority of root. -->
-<!-- The root category always exists and cannot be subclassed. -->
-<!ELEMENT root (param*, (priority|level)?, appender-ref*)>
-
-
-<!-- ==================================================================== -->
-<!--                       A logging event                                -->
-<!-- ==================================================================== -->
-<!ELEMENT log4j:eventSet (log4j:event*)>
-<!ATTLIST log4j:eventSet
-  xmlns:log4j             CDATA #FIXED "http://jakarta.apache.org/log4j/" 
-  version                (1.1|1.2) "1.2" 
-  includesLocationInfo   (true|false) "true"
->
-
-
-
-<!ELEMENT log4j:event (log4j:message, log4j:NDC?, log4j:throwable?, 
-                       log4j:locationInfo?, log4j:properties?) >
-
-<!-- The timestamp format is application dependent. -->
-<!ATTLIST log4j:event
-    logger     CDATA #REQUIRED
-    level      CDATA #REQUIRED
-    thread     CDATA #REQUIRED
-    timestamp  CDATA #REQUIRED
-    time       CDATA #IMPLIED
->
-
-<!ELEMENT log4j:message (#PCDATA)>
-<!ELEMENT log4j:NDC (#PCDATA)>
-
-<!ELEMENT log4j:throwable (#PCDATA)>
-
-<!ELEMENT log4j:locationInfo EMPTY>
-<!ATTLIST log4j:locationInfo
-  class  CDATA	#REQUIRED
-  method CDATA	#REQUIRED
-  file   CDATA	#REQUIRED
-  line   CDATA	#REQUIRED
->
-
-<!ELEMENT log4j:properties (log4j:data*)>
-
-<!ELEMENT log4j:data EMPTY>
-<!ATTLIST log4j:data
-  name   CDATA	#REQUIRED
-  value  CDATA	#REQUIRED
->

http://git-wip-us.apache.org/repos/asf/struts-examples/blob/a66c0865/preparable_interface/src/main/resources/log4j.xml
----------------------------------------------------------------------
diff --git a/preparable_interface/src/main/resources/log4j.xml b/preparable_interface/src/main/resources/log4j.xml
deleted file mode 100644
index 2100cb2..0000000
--- a/preparable_interface/src/main/resources/log4j.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<!DOCTYPE log4j:configuration PUBLIC "-//log4j/log4j Configuration//EN" "log4j.dtd">
-
-<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
-    
-    <appender name="STDOUT" class="org.apache.log4j.ConsoleAppender">
-       <layout class="org.apache.log4j.PatternLayout"> 
-          <param name="ConversionPattern" value="%d %-5p %c.%M:%L - %m%n"/> 
-       </layout> 
-    </appender>
- 
-    <!-- specify the logging level for loggers from other libraries -->
-    <logger name="com.opensymphony">
-    	<level value="DEBUG" />
-    </logger>
-
-    <logger name="org.apache.struts2">
-    	 <level value="DEBUG" />
-    </logger>
-  
-   <!-- for all other loggers log only debug and above log messages -->
-     <root>
-        <priority value="INFO"/> 
-        <appender-ref ref="STDOUT" /> 
-     </root> 
-    
-</log4j:configuration> 
-

http://git-wip-us.apache.org/repos/asf/struts-examples/blob/a66c0865/preparable_interface/src/main/resources/log4j2.xml
----------------------------------------------------------------------
diff --git a/preparable_interface/src/main/resources/log4j2.xml b/preparable_interface/src/main/resources/log4j2.xml
new file mode 100644
index 0000000..d7c09f9
--- /dev/null
+++ b/preparable_interface/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.struts2.edit" 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/a66c0865/restful2actionmapper/src/main/java/org/apache/struts/example/MovieAction.java
----------------------------------------------------------------------
diff --git a/restful2actionmapper/src/main/java/org/apache/struts/example/MovieAction.java b/restful2actionmapper/src/main/java/org/apache/struts/example/MovieAction.java
index 82773ae..76b1cfb 100644
--- a/restful2actionmapper/src/main/java/org/apache/struts/example/MovieAction.java
+++ b/restful2actionmapper/src/main/java/org/apache/struts/example/MovieAction.java
@@ -1,13 +1,12 @@
 package org.apache.struts.example;
 
-import org.apache.log4j.Logger;
-
 import com.opensymphony.xwork2.ActionSupport;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 
 public class MovieAction extends ActionSupport {
-	
-	private static final Logger LOGGER = Logger.getLogger(MovieAction.class.getName() );
 
+	private static final Logger log = LogManager.getLogger(MovieAction.class.getName());
 	private static final long serialVersionUID = 1L;
 	
 	private String id;
@@ -19,11 +18,8 @@ public class MovieAction extends ActionSupport {
 	 * @return success
 	 */
 	public String view() {
-		
-		LOGGER.debug("Value of id is " + id);
-		
+		log.debug("Value of id is " + id);
 		return SUCCESS;
-		
 	}
 	
 	/**
@@ -32,12 +28,8 @@ public class MovieAction extends ActionSupport {
 	 * @return
 	 */
 	public String index() {
-		
-		
-		LOGGER.debug("Value of id is " + id);
-		
+		log.debug("Value of id is " + id);
 		return SUCCESS;
-		
 	}
 
 	public String getId() {
@@ -47,5 +39,4 @@ public class MovieAction extends ActionSupport {
 	public void setId(String id) {
 		this.id = id;
 	}
-
 }

http://git-wip-us.apache.org/repos/asf/struts-examples/blob/a66c0865/restful2actionmapper/src/main/resources/log4j.dtd
----------------------------------------------------------------------
diff --git a/restful2actionmapper/src/main/resources/log4j.dtd b/restful2actionmapper/src/main/resources/log4j.dtd
deleted file mode 100755
index 1aabd96..0000000
--- a/restful2actionmapper/src/main/resources/log4j.dtd
+++ /dev/null
@@ -1,227 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<!--
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements.  See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License.  You may obtain a copy of the License at
-
-      http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-
-<!-- Authors: Chris Taylor, Ceki Gulcu. -->
-
-<!-- Version: 1.2 -->
-
-<!-- A configuration element consists of optional renderer
-elements,appender elements, categories and an optional root
-element. -->
-
-<!ELEMENT log4j:configuration (renderer*, appender*,plugin*, (category|logger)*,root?,
-                               (categoryFactory|loggerFactory)?)>
-
-<!-- The "threshold" attribute takes a level value below which -->
-<!-- all logging statements are disabled. -->
-
-<!-- Setting the "debug" enable the printing of internal log4j logging   -->
-<!-- statements.                                                         -->
-
-<!-- By default, debug attribute is "null", meaning that we not do touch -->
-<!-- internal log4j logging settings. The "null" value for the threshold -->
-<!-- attribute can be misleading. The threshold field of a repository	 -->
-<!-- cannot be set to null. The "null" value for the threshold attribute -->
-<!-- simply means don't touch the threshold field, the threshold field   --> 
-<!-- keeps its old value.                                                -->
-     
-<!ATTLIST log4j:configuration
-  xmlns:log4j              CDATA #FIXED "http://jakarta.apache.org/log4j/" 
-  threshold                (all|trace|debug|info|warn|error|fatal|off|null) "null"
-  debug                    (true|false|null)  "null"
-  reset                    (true|false) "false"
->
-
-<!-- renderer elements allow the user to customize the conversion of  -->
-<!-- message objects to String.                                       -->
-
-<!ELEMENT renderer EMPTY>
-<!ATTLIST renderer
-  renderedClass  CDATA #REQUIRED
-  renderingClass CDATA #REQUIRED
->
-
-<!-- Appenders must have a name and a class. -->
-<!-- Appenders may contain an error handler, a layout, optional parameters -->
-<!-- and filters. They may also reference (or include) other appenders. -->
-<!ELEMENT appender (errorHandler?, param*,
-      rollingPolicy?, triggeringPolicy?, connectionSource?,
-      layout?, filter*, appender-ref*)>
-<!ATTLIST appender
-  name 		CDATA 	#REQUIRED
-  class 	CDATA	#REQUIRED
->
-
-<!ELEMENT layout (param*)>
-<!ATTLIST layout
-  class		CDATA	#REQUIRED
->
-
-<!ELEMENT filter (param*)>
-<!ATTLIST filter
-  class		CDATA	#REQUIRED
->
-
-<!-- ErrorHandlers can be of any class. They can admit any number of -->
-<!-- parameters. -->
-
-<!ELEMENT errorHandler (param*, root-ref?, logger-ref*,  appender-ref?)> 
-<!ATTLIST errorHandler
-   class        CDATA   #REQUIRED 
->
-
-<!ELEMENT root-ref EMPTY>
-
-<!ELEMENT logger-ref EMPTY>
-<!ATTLIST logger-ref
-  ref CDATA #REQUIRED
->
-
-<!ELEMENT param EMPTY>
-<!ATTLIST param
-  name		CDATA   #REQUIRED
-  value		CDATA	#REQUIRED
->
-
-
-<!-- The priority class is org.apache.log4j.Level by default -->
-<!ELEMENT priority (param*)>
-<!ATTLIST priority
-  class   CDATA	#IMPLIED
-  value	  CDATA #REQUIRED
->
-
-<!-- The level class is org.apache.log4j.Level by default -->
-<!ELEMENT level (param*)>
-<!ATTLIST level
-  class   CDATA	#IMPLIED
-  value	  CDATA #REQUIRED
->
-
-
-<!-- If no level element is specified, then the configurator MUST not -->
-<!-- touch the level of the named category. -->
-<!ELEMENT category (param*,(priority|level)?,appender-ref*)>
-<!ATTLIST category
-  class         CDATA   #IMPLIED
-  name		CDATA	#REQUIRED
-  additivity	(true|false) "true"  
->
-
-<!-- If no level element is specified, then the configurator MUST not -->
-<!-- touch the level of the named logger. -->
-<!ELEMENT logger (level?,appender-ref*)>
-<!ATTLIST logger
-  name		CDATA	#REQUIRED
-  additivity	(true|false) "true"  
->
-
-
-<!ELEMENT categoryFactory (param*)>
-<!ATTLIST categoryFactory 
-   class        CDATA #REQUIRED>
-
-<!ELEMENT loggerFactory (param*)>
-<!ATTLIST loggerFactory
-   class        CDATA #REQUIRED>
-
-<!ELEMENT appender-ref EMPTY>
-<!ATTLIST appender-ref
-  ref CDATA #REQUIRED
->
-
-<!-- plugins must have a name and class and can have optional parameters -->
-<!ELEMENT plugin (param*, connectionSource?)>
-<!ATTLIST plugin
-  name 		CDATA 	   #REQUIRED
-  class 	CDATA  #REQUIRED
->
-
-<!ELEMENT connectionSource (dataSource?, param*)>
-<!ATTLIST connectionSource
-  class        CDATA  #REQUIRED
->
-
-<!ELEMENT dataSource (param*)>
-<!ATTLIST dataSource
-  class        CDATA  #REQUIRED
->
-
-<!ELEMENT triggeringPolicy ((param|filter)*)>
-<!ATTLIST triggeringPolicy
-  name 		CDATA  #IMPLIED
-  class 	CDATA  #REQUIRED
->
-
-<!ELEMENT rollingPolicy (param*)>
-<!ATTLIST rollingPolicy
-  name 		CDATA  #IMPLIED
-  class 	CDATA  #REQUIRED
->
-
-
-<!-- If no priority element is specified, then the configurator MUST not -->
-<!-- touch the priority of root. -->
-<!-- The root category always exists and cannot be subclassed. -->
-<!ELEMENT root (param*, (priority|level)?, appender-ref*)>
-
-
-<!-- ==================================================================== -->
-<!--                       A logging event                                -->
-<!-- ==================================================================== -->
-<!ELEMENT log4j:eventSet (log4j:event*)>
-<!ATTLIST log4j:eventSet
-  xmlns:log4j             CDATA #FIXED "http://jakarta.apache.org/log4j/" 
-  version                (1.1|1.2) "1.2" 
-  includesLocationInfo   (true|false) "true"
->
-
-
-
-<!ELEMENT log4j:event (log4j:message, log4j:NDC?, log4j:throwable?, 
-                       log4j:locationInfo?, log4j:properties?) >
-
-<!-- The timestamp format is application dependent. -->
-<!ATTLIST log4j:event
-    logger     CDATA #REQUIRED
-    level      CDATA #REQUIRED
-    thread     CDATA #REQUIRED
-    timestamp  CDATA #REQUIRED
-    time       CDATA #IMPLIED
->
-
-<!ELEMENT log4j:message (#PCDATA)>
-<!ELEMENT log4j:NDC (#PCDATA)>
-
-<!ELEMENT log4j:throwable (#PCDATA)>
-
-<!ELEMENT log4j:locationInfo EMPTY>
-<!ATTLIST log4j:locationInfo
-  class  CDATA	#REQUIRED
-  method CDATA	#REQUIRED
-  file   CDATA	#REQUIRED
-  line   CDATA	#REQUIRED
->
-
-<!ELEMENT log4j:properties (log4j:data*)>
-
-<!ELEMENT log4j:data EMPTY>
-<!ATTLIST log4j:data
-  name   CDATA	#REQUIRED
-  value  CDATA	#REQUIRED
->

http://git-wip-us.apache.org/repos/asf/struts-examples/blob/a66c0865/restful2actionmapper/src/main/resources/log4j.xml
----------------------------------------------------------------------
diff --git a/restful2actionmapper/src/main/resources/log4j.xml b/restful2actionmapper/src/main/resources/log4j.xml
deleted file mode 100755
index aac92af..0000000
--- a/restful2actionmapper/src/main/resources/log4j.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<!DOCTYPE log4j:configuration PUBLIC "-//log4j/log4j Configuration//EN" "log4j.dtd">
-
-<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
-    
-    <appender name="STDOUT" class="org.apache.log4j.ConsoleAppender">
-       <layout class="org.apache.log4j.PatternLayout"> 
-          <param name="ConversionPattern" value="%d %-5p %c.%M:%L - %m%n"/> 
-       </layout> 
-    </appender>
- 
-    <!-- specify the logging level for loggers from other libraries -->
-    <logger name="com.opensymphony">
-    	<level value="DEBUG" />
-    </logger>
-
-    <logger name="org.apache.struts.example">
-    	 <level value="DEBUG" />
-    </logger>
-  
-   <!-- for all other loggers log only debug and above log messages -->
-     <root>
-        <priority value="INFO"/> 
-        <appender-ref ref="STDOUT" /> 
-     </root> 
-    
-</log4j:configuration> 
-

http://git-wip-us.apache.org/repos/asf/struts-examples/blob/a66c0865/restful2actionmapper/src/main/resources/log4j2.xml
----------------------------------------------------------------------
diff --git a/restful2actionmapper/src/main/resources/log4j2.xml b/restful2actionmapper/src/main/resources/log4j2.xml
new file mode 100644
index 0000000..b92f2ea
--- /dev/null
+++ b/restful2actionmapper/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.struts2.example" 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/a66c0865/wildcard_method_selection/pom.xml
----------------------------------------------------------------------
diff --git a/wildcard_method_selection/pom.xml b/wildcard_method_selection/pom.xml
index d8c0881..a76d999 100644
--- a/wildcard_method_selection/pom.xml
+++ b/wildcard_method_selection/pom.xml
@@ -1,22 +1,40 @@
 <?xml version="1.0"?>
-<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
-    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
-  <modelVersion>4.0.0</modelVersion>
-  <parent>
-    <groupId>struts.apache.org</groupId>
-    <artifactId>struts2examples</artifactId>
-    <version>1.0.0</version>
-  </parent>
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
+         xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>struts.apache.org</groupId>
+        <artifactId>struts2examples</artifactId>
+        <version>1.0.0</version>
+    </parent>
 
-  <artifactId>wildcard_method_selection</artifactId>
+    <artifactId>wildcard_method_selection</artifactId>
+
+    <name>Wildcard Method Selection</name>
+
+    <description>Wildcard method selection example application for the
+        Struts 2 getting started tutorials
+    </description>
+    <packaging>war</packaging>
+
+    <build>
+        <finalName>wildcard_method_selection</finalName>
+        <plugins>
+            <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>
+                    <scanIntervalSeconds>10</scanIntervalSeconds>
+                    <scanTargets>
+                        <scanTarget>src/main/webapp/WEB-INF/web.xml</scanTarget>
+                    </scanTargets>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
 
-  <name>wildcard method selection</name>
- 
-   <description>Wildcard method selection example application for the 
-  Struts 2 getting started tutorials</description>
-  <packaging>war</packaging>
-      <build>
-		<finalName>wildcard_method_selection</finalName>
-	</build>
- 
 </project>

http://git-wip-us.apache.org/repos/asf/struts-examples/blob/a66c0865/wildcard_method_selection/src/main/java/org/apache/struts/tutorials/wildcardmethod/action/PersonAction.java
----------------------------------------------------------------------
diff --git a/wildcard_method_selection/src/main/java/org/apache/struts/tutorials/wildcardmethod/action/PersonAction.java b/wildcard_method_selection/src/main/java/org/apache/struts/tutorials/wildcardmethod/action/PersonAction.java
index 55cdfda..ac3bf53 100644
--- a/wildcard_method_selection/src/main/java/org/apache/struts/tutorials/wildcardmethod/action/PersonAction.java
+++ b/wildcard_method_selection/src/main/java/org/apache/struts/tutorials/wildcardmethod/action/PersonAction.java
@@ -1,129 +1,93 @@
 package org.apache.struts.tutorials.wildcardmethod.action;
 
-import java.util.List;
-
-import org.apache.log4j.Logger;
+import com.opensymphony.xwork2.ActionSupport;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.apache.struts.tutorials.wildcardmethod.model.Person;
 import org.apache.struts.tutorials.wildcardmethod.service.PersonService;
 
+import java.util.List;
 
 
+public class PersonAction extends ActionSupport {
 
+    //Create a Logger object
+    private static final Logger log = LogManager.getLogger(PersonAction.class);
+    private static final long serialVersionUID = 1L;
 
-import com.opensymphony.xwork2.ActionSupport;
+    Person person;
+    int id;
+    List<Person> personList = PersonService.getPersons();
+    PersonService personService = new PersonService();
 
+    public String execute() throws Exception {
+        log.debug("In execute method");
+        return SUCCESS;
+    }
 
+    public String create() {
+        log.debug("In create method");
+        person = new Person();
+
+        return INPUT;
+    }
+
+    public String edit() {
+        log.debug("In edit method");
+        person = personService.getPerson(id);
+
+        return INPUT;
+    }
+
+    public String saveOrUpdate() {
+        log.debug("In saveOrUpdate method");
+        if (person.getId() > -1) {
+            personService.update(person);
+        } else {
+            personService.save(person);
+        }
+
+        personList = PersonService.getPersons();
+        return SUCCESS;
+    }
+
+
+    public String delete() {
+        log.debug("In delete method");
+        personService.deletePerson(id);
+
+        personList = PersonService.getPersons();
+
+        return SUCCESS;
+    }
+
+
+    public Person getPerson() {
+        return person;
+    }
+
+
+    public void setPerson(Person person) {
+        this.person = person;
+    }
+
+
+    public List<Person> getPersonList() {
+        return personList;
+    }
+
+
+    public void setPersonList(List<Person> personList) {
+        this.personList = personList;
+    }
+
+
+    public int getId() {
+        return id;
+    }
 
-public class PersonAction extends ActionSupport {
-	
-	//Create a Logger object
-	private static final Logger logger = Logger.getLogger( PersonAction.class.getName() );
-
-	
-	private static final long serialVersionUID = 1L;
-
-	Person person ;
-	
-	int id ;
-	
-	List<Person> personList = PersonService.getPersons();
-	
-	PersonService personService = new PersonService();
-	
-	public String execute() throws Exception {
-	
-		logger.debug("In execute method");
-		return SUCCESS;
-	}
-	
-	
-	public String create() {
-		
-		logger.debug("In create method");
-		person = new Person();
-		
-		return INPUT;
-		
-		
-	}
-	
-	
-	public String edit() {
-		
-		    logger.debug("In edit method");
-		    person = personService.getPerson(id);
-		
-			return INPUT;
-
-		
-	}
-	
-	
-	public String saveOrUpdate() {
-		
-
-		logger.debug("In saveOrUpdate method");
-		if ( person.getId()  > -1 ) {
-			
-			personService.update(person) ;
-			
-			
-		} else {
-			
-			personService.save(person);
-		}
-		
-		
-		personList = PersonService.getPersons() ;
-		
-		return SUCCESS;
-
-	
-	}
-	
-	
-	public String delete() {
-		
-		logger.debug("In delete method");
-		personService.deletePerson(id);
-		
-		personList = PersonService.getPersons() ;
-		
-		return SUCCESS;
-	}
-
-
-	public Person getPerson() {
-		return person;
-	}
-
-
-	public void setPerson(Person person) {
-		this.person = person;
-	}
-
-
-	public List<Person> getPersonList() {
-		return personList;
-	}
-
-
-	public void setPersonList(List<Person> personList) {
-		this.personList = personList;
-	}
-
-
-	public int getId() {
-		return id;
-	}
-
-
-	public void setId(int id) {
-		this.id = id;
-	}
-	
-	
-	
-	
 
+    public void setId(int id) {
+        this.id = id;
+    }
 }

http://git-wip-us.apache.org/repos/asf/struts-examples/blob/a66c0865/wildcard_method_selection/src/main/java/org/apache/struts/tutorials/wildcardmethod/service/PersonService.java
----------------------------------------------------------------------
diff --git a/wildcard_method_selection/src/main/java/org/apache/struts/tutorials/wildcardmethod/service/PersonService.java b/wildcard_method_selection/src/main/java/org/apache/struts/tutorials/wildcardmethod/service/PersonService.java
index 4e85eb7..0aa657c 100644
--- a/wildcard_method_selection/src/main/java/org/apache/struts/tutorials/wildcardmethod/service/PersonService.java
+++ b/wildcard_method_selection/src/main/java/org/apache/struts/tutorials/wildcardmethod/service/PersonService.java
@@ -1,133 +1,88 @@
 package org.apache.struts.tutorials.wildcardmethod.service;
 
-import java.util.ArrayList;
-import java.util.List;
-import java.util.NoSuchElementException;
-import java.util.SortedMap;
-import java.util.TreeMap;
-
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
 import org.apache.struts.tutorials.wildcardmethod.model.Person;
 
+import java.util.*;
+
 
 
 public class PersonService {
 	
 	//Create a Logger object
-	private static final Logger logger = Logger.getLogger( PersonService.class.getName() );
+	private static final Logger log = LogManager.getLogger(PersonService.class);
 
-	
-	private static SortedMap<Integer, Person> people = new TreeMap<Integer, Person>();
+	private static SortedMap<Integer, Person> people = new TreeMap<>();
 	
 	static {
-		
 		people.put(0, new Person(0, "Steve", "Smith") );
 		people.put(1, new Person(1, "Sue", "Jones") );
-		
-		
 	}
-	
-	
-	private static List<Person> personList = new ArrayList<Person>();
+
+
+	private static List<Person> personList = new ArrayList<>();
 	
 	static{
-		
 		for (Integer id : people.keySet() ) {
-			
 			personList.add( people.get(id));
-			
 		}
-	
 	}
 	
 	
 	public static List<Person> getPersons() {
-		
 		return personList;
-		
 	}
 	
 	
     public  void save(Person person) {
-    	
     	int newId = getNewId();
-    	
     	person.setId( newId );
-
     	people.put( newId, person);
-    	
     	rebuildPersonList();
-    	
     }
     
     
     private int getNewId() {
-	
     	int newId = 0;
     	
     	try {
-    		
     	  newId = people.lastKey() + 1;
-    	 
     	} catch (NoSuchElementException ex) {
-    		
-    		logger.info("Id value set to 0");
-    		
-    	}
+			log.info("Id value set to 0");
+		}
  
     	return newId;
-    	
-    	
 	}
 
 
 	public  void update(Person person) {
-    	
-    	
-    	
     	Person tempPerson = people.get( person.getId() );
     	
     	tempPerson.setFirstName( person.getFirstName() );
     	tempPerson.setLastName(person.getLastName() );
     	
     	rebuildPersonList();
-     	
-    	
     }
 
 
 	public void deletePerson(int ID) {
-		
-		
 		people.remove(ID);
 		
 		rebuildPersonList();
-		
 	}
 
 
 	public Person getPerson(int id) {
-
 		return people.get(id);
-		
 	}
 	
  
 	public static void rebuildPersonList() {
-		
-		
-    	personList = new ArrayList<Person>();
-    	
-        for (Integer id : people.keySet() ) {
- 			
+		personList = new ArrayList<>();
+
+		for (Integer id : people.keySet() ) {
  			personList.add( people.get(id));
- 			
  		}
-        
-        
-		
-		
 	}
-	
-
 }


Mime
View raw message