diff --git a/action-chaining/pom.xml b/action-chaining/pom.xml index f75624d7..4891543e 100644 --- a/action-chaining/pom.xml +++ b/action-chaining/pom.xml @@ -5,11 +5,10 @@ struts-examples org.apache.struts - 1.0.0 + 1.1.0 action-chaining - 1.0-SNAPSHOT war Action chaining diff --git a/annotations/pom.xml b/annotations/pom.xml index 14b36182..3b8a987a 100644 --- a/annotations/pom.xml +++ b/annotations/pom.xml @@ -6,13 +6,11 @@ org.apache.struts struts-examples - 1.0.0 + 1.1.0 annotations - Annotations with Convention Plugin - Annotations example application for the Struts 2 getting started tutorials war diff --git a/basic-struts/pom.xml b/basic-struts/pom.xml index 652fa075..ec76d2d1 100644 --- a/basic-struts/pom.xml +++ b/basic-struts/pom.xml @@ -6,8 +6,9 @@ org.apache.struts struts-examples - 1.0.0 + 1.1.0 + basic-struts Basic Struts2 Example Basic Struts 2 example application diff --git a/bean-validation/pom.xml b/bean-validation/pom.xml index 86281874..70bef071 100755 --- a/bean-validation/pom.xml +++ b/bean-validation/pom.xml @@ -4,10 +4,10 @@ org.apache.struts struts-examples - 1.0.0 + 1.1.0 - bean-validation + bean-validation Bean Validation bean (JSR 303) validation example application for the Struts 2 getting started tutorials diff --git a/blank/pom.xml b/blank/pom.xml index ebcbd0bc..db02817b 100644 --- a/blank/pom.xml +++ b/blank/pom.xml @@ -24,7 +24,7 @@ org.apache.struts struts-examples - 1.0.0 + 1.1.0 blank diff --git a/coding-actions/pom.xml b/coding-actions/pom.xml index 428e2de7..50efd0ad 100644 --- a/coding-actions/pom.xml +++ b/coding-actions/pom.xml @@ -6,7 +6,7 @@ org.apache.struts struts-examples - 1.0.0 + 1.1.0 coding-actions diff --git a/control-tags/pom.xml b/control-tags/pom.xml index fea5ddd8..444a101e 100755 --- a/control-tags/pom.xml +++ b/control-tags/pom.xml @@ -6,13 +6,13 @@ org.apache.struts struts-examples - 1.0.0 + 1.1.0 - control-tags + control-tags Control Tags - Control tags example application for the Struts 2 getting started tutorials + war diff --git a/crud/pom.xml b/crud/pom.xml index 74ded106..75f6bb46 100755 --- a/crud/pom.xml +++ b/crud/pom.xml @@ -7,11 +7,10 @@ org.apache.struts struts-examples - 1.0.0 + 1.1.0 crud - 1.0-SNAPSHOT war CRUD Example diff --git a/debugging-struts/pom.xml b/debugging-struts/pom.xml index 9b1b3c07..e1873319 100644 --- a/debugging-struts/pom.xml +++ b/debugging-struts/pom.xml @@ -5,15 +5,15 @@ org.apache.struts struts-examples - 1.0.0 + 1.1.0 debugging-struts - Debugging Struts - Exception handling example application for the Struts 2 getting started tutorials + war + org.apache.struts diff --git a/exception-handling/pom.xml b/exception-handling/pom.xml index db94e26b..d2dd35a2 100644 --- a/exception-handling/pom.xml +++ b/exception-handling/pom.xml @@ -6,14 +6,13 @@ org.apache.struts struts-examples - 1.0.0 + 1.1.0 exception-handling - Exception handling - Exception handling example application for the Struts 2 getting started tutorials + war diff --git a/exclude-parameters/pom.xml b/exclude-parameters/pom.xml index e956863b..c28f0a09 100644 --- a/exclude-parameters/pom.xml +++ b/exclude-parameters/pom.xml @@ -6,12 +6,13 @@ org.apache.struts struts-examples - 1.0.0 + 1.1.0 exclude-parameters Exclude Parameters Struts 2 example application for the exclude parameters getting started tutorial + war diff --git a/file-upload/pom.xml b/file-upload/pom.xml index e2eff5be..52ec261b 100644 --- a/file-upload/pom.xml +++ b/file-upload/pom.xml @@ -6,13 +6,13 @@ struts-examples org.apache.struts - 1.0.0 + 1.1.0 file-upload - File upload Simple file upload example + war diff --git a/form-processing/pom.xml b/form-processing/pom.xml index 9a0e46ac..544038e1 100644 --- a/form-processing/pom.xml +++ b/form-processing/pom.xml @@ -6,12 +6,11 @@ org.apache.struts struts-examples - 1.0.0 + 1.1.0 - form-processing + form-processing Form Processing - Form processing example application for the Struts 2 getting started tutorials war diff --git a/form-tags/pom.xml b/form-tags/pom.xml index 7c1c12e5..3dae605d 100644 --- a/form-tags/pom.xml +++ b/form-tags/pom.xml @@ -6,13 +6,11 @@ org.apache.struts struts-examples - 1.0.0 + 1.1.0 form-tags - Form Tags - Form tags example application for the Struts 2 getting started tutorials war diff --git a/form-validation/pom.xml b/form-validation/pom.xml index 8bbdf856..e0f722f0 100644 --- a/form-validation/pom.xml +++ b/form-validation/pom.xml @@ -6,13 +6,11 @@ org.apache.struts struts-examples - 1.0.0 + 1.1.0 form-validation - Form validation - Form validation example application for the Struts 2 getting started tutorials war diff --git a/form-xml-validation/pom.xml b/form-xml-validation/pom.xml index 8fb82a63..e29a2e61 100644 --- a/form-xml-validation/pom.xml +++ b/form-xml-validation/pom.xml @@ -6,14 +6,13 @@ org.apache.struts struts-examples - 1.0.0 + 1.1.0 form-xml-validation - XML based form validation - Form XML validation example application for the Struts 2 getting started tutorials + war diff --git a/helloworld/pom.xml b/helloworld/pom.xml index def4eefe..4c681d90 100644 --- a/helloworld/pom.xml +++ b/helloworld/pom.xml @@ -6,16 +6,15 @@ org.apache.struts struts-examples - 1.0.0 + 1.1.0 helloworld - war - Hello World Struts 2 Example Application - Hello world example application for the Struts 2 Getting Started tutorials + war + hello-world diff --git a/http-session/pom.xml b/http-session/pom.xml index 1409ab3c..5b3936f3 100644 --- a/http-session/pom.xml +++ b/http-session/pom.xml @@ -6,12 +6,13 @@ org.apache.struts struts-examples - 1.0.0 + 1.1.0 http-session Http Session Struts 2 example application for the HTTP Session getting started tutorial + war diff --git a/interceptors/pom.xml b/interceptors/pom.xml index 2cf5f9ed..a3e46d0b 100644 --- a/interceptors/pom.xml +++ b/interceptors/pom.xml @@ -6,13 +6,11 @@ org.apache.struts struts-examples - 1.0.0 + 1.1.0 interceptors - Struts 2 Interceptors - Form XML validation example application for the Struts 2 getting started tutorials war diff --git a/json-customize/pom.xml b/json-customize/pom.xml index 9a441ff5..e03f6358 100644 --- a/json-customize/pom.xml +++ b/json-customize/pom.xml @@ -5,15 +5,14 @@ struts-examples org.apache.struts - 1.0.0 + 1.1.0 - org.demo json-customize - 1.0-SNAPSHOT - war Customized JSON produce + war + UTF-8 diff --git a/json/pom.xml b/json/pom.xml index 4e5b8271..b39117f1 100644 --- a/json/pom.xml +++ b/json/pom.xml @@ -5,15 +5,14 @@ struts-examples org.apache.struts - 1.0.0 + 1.1.0 - org.demo json - 1.0-SNAPSHOT - war JSON produce/consume + war + UTF-8 diff --git a/mailreader/src/main/webapp/META-INF/context.xml b/mailreader/src/main/webapp/META-INF/context.xml deleted file mode 100644 index 9b0b5d00..00000000 --- a/mailreader/src/main/webapp/META-INF/context.xml +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/mailreader/README.txt b/mailreader2/README.txt similarity index 100% rename from mailreader/README.txt rename to mailreader2/README.txt diff --git a/mailreader/pom.xml b/mailreader2/pom.xml similarity index 83% rename from mailreader/pom.xml rename to mailreader2/pom.xml index 7b52560e..5f2d7327 100644 --- a/mailreader/pom.xml +++ b/mailreader2/pom.xml @@ -25,15 +25,27 @@ org.apache.struts struts-examples - 1.0.0 + 1.1.0 - mailreader - war + mailreader2 Struts 2 Mail Reader Webapp + war + + + org.apache.struts + struts2-config-browser-plugin + + + + commons-digester + commons-digester + 2.1 + + javax.servlet javax.servlet-api @@ -41,24 +53,9 @@ provided - - org.apache.struts - struts-mailreader-dao - 1.3.5 - - - - - src/main/java - - **/*.xml - **/*.properties - - - org.eclipse.jetty diff --git a/mailreader/src/main/java/mailreader2/ApplicationListener.java b/mailreader2/src/main/java/org/apache/struts/examples/mailreader2/ApplicationListener.java similarity index 90% rename from mailreader/src/main/java/mailreader2/ApplicationListener.java rename to mailreader2/src/main/java/org/apache/struts/examples/mailreader2/ApplicationListener.java index fe347ba3..0d7664d0 100644 --- a/mailreader/src/main/java/mailreader2/ApplicationListener.java +++ b/mailreader2/src/main/java/org/apache/struts/examples/mailreader2/ApplicationListener.java @@ -17,11 +17,11 @@ * under the License. */ -package mailreader2; +package org.apache.struts.examples.mailreader2; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -import org.apache.struts.apps.mailreader.dao.impl.memory.MemoryUserDatabase; +import org.apache.struts.examples.mailreader2.dao.impl.memory.MemoryUserDatabase; import javax.servlet.ServletContext; import javax.servlet.ServletContextEvent; @@ -55,47 +55,34 @@ * DEVELOPMENT NOTE - Another approach would be to instantiate the database via Spring. *

*/ - public final class ApplicationListener implements ServletContextListener { - // ------------------------------------------------------ Manifest Constants - - /** *

Appication scope attribute key under which the in-memory version of * our database is stored.

*/ public static final String DATABASE_KEY = "database"; - /** *

Application scope attribute key under which the valid selection * items for the protocol property is stored.

*/ public static final String PROTOCOLS_KEY = "protocols"; - // ------------------------------------------------------ Instance Variables - - /** *

The ServletContext for this web application.

*/ private ServletContext context = null; - /** * The {@link MemoryUserDatabase} object we construct and make available. */ private MemoryUserDatabase database = null; - /** *

Logging output for this plug in instance.

*/ - private Logger log = LogManager.getLogger(this.getClass()); - - // ------------------------------------------------------------- Properties - + private Logger log = LogManager.getLogger(ApplicationListener.class); /** *

The web application resource path of our persistent database storage @@ -121,9 +108,6 @@ public void setPathname(String pathname) { this.pathname = pathname; } - // ------------------------------------------ ServletContextListener Methods - - /** *

Gracefully shut down this database, releasing any resources that * were allocated at initialization.

@@ -131,7 +115,6 @@ public void setPathname(String pathname) { * @param event ServletContextEvent to process */ public void contextDestroyed(ServletContextEvent event) { - log.info("Finalizing memory database plug in"); if (database != null) { @@ -146,10 +129,8 @@ public void contextDestroyed(ServletContextEvent event) { context.removeAttribute(PROTOCOLS_KEY); database = null; context = null; - } - /** *

Initialize and load our initial database from persistent * storage.

@@ -157,9 +138,7 @@ public void contextDestroyed(ServletContextEvent event) { * @param event The context initialization event */ public void contextInitialized(ServletContextEvent event) { - - log.info("Initializing memory database plug in from '" + - pathname + "'"); + log.info("Initializing memory database plug in from '" + pathname + "'"); // Remember our associated ServletContext this.context = event.getServletContext(); @@ -179,12 +158,8 @@ public void contextInitialized(ServletContextEvent event) { pathname + "': " + e); } context.setAttribute(DATABASE_KEY, database); - } - // -------------------------------------------------------- Private Methods - - /** *

Calculate and return an absolute pathname to the XML file to contain * our persistent storage information.

@@ -192,7 +167,6 @@ public void contextInitialized(ServletContextEvent event) { * @throws Exception if an input/output error occurs */ private String calculatePath() throws Exception { - // Can we access the database via file I/O? String path = context.getRealPath(pathname); if (path != null) { @@ -200,8 +174,7 @@ private String calculatePath() throws Exception { } // Does a copy of this file already exist in our temporary directory - File dir = (File) - context.getAttribute("javax.servlet.context.tempdir"); + File dir = (File) context.getAttribute("javax.servlet.context.tempdir"); File file = new File(dir, "struts-example-database.xml"); if (file.exists()) { return (file.getAbsolutePath()); @@ -225,8 +198,6 @@ private String calculatePath() throws Exception { bos.close(); bis.close(); return (file.getAbsolutePath()); - } - } diff --git a/mailreader/src/main/java/mailreader2/AuthenticationInterceptor.java b/mailreader2/src/main/java/org/apache/struts/examples/mailreader2/AuthenticationInterceptor.java similarity index 88% rename from mailreader/src/main/java/mailreader2/AuthenticationInterceptor.java rename to mailreader2/src/main/java/org/apache/struts/examples/mailreader2/AuthenticationInterceptor.java index 0984a2e7..bb0b5186 100644 --- a/mailreader/src/main/java/mailreader2/AuthenticationInterceptor.java +++ b/mailreader2/src/main/java/org/apache/struts/examples/mailreader2/AuthenticationInterceptor.java @@ -16,12 +16,12 @@ * specific language governing permissions and limitations * under the License. */ -package mailreader2; +package org.apache.struts.examples.mailreader2; import com.opensymphony.xwork2.Action; import com.opensymphony.xwork2.ActionInvocation; import com.opensymphony.xwork2.interceptor.Interceptor; -import org.apache.struts.apps.mailreader.dao.User; +import org.apache.struts.examples.mailreader2.dao.User; import java.util.Map; @@ -32,11 +32,8 @@ public void destroy () {} public void init() {} public String intercept(ActionInvocation actionInvocation) throws Exception { - - Map session = actionInvocation.getInvocationContext().getSession(); - + Map session = actionInvocation.getInvocationContext().getSession(); User user = (User) session.get(Constants.USER_KEY); - boolean isAuthenticated = (null!=user) && (null!=user.getDatabase()); if (!isAuthenticated) { @@ -45,6 +42,6 @@ public String intercept(ActionInvocation actionInvocation) throws Exception { else { return actionInvocation.invoke(); } - } + } diff --git a/mailreader/src/main/java/mailreader2/Constants.java b/mailreader2/src/main/java/org/apache/struts/examples/mailreader2/Constants.java similarity index 95% rename from mailreader/src/main/java/mailreader2/Constants.java rename to mailreader2/src/main/java/org/apache/struts/examples/mailreader2/Constants.java index 98ff5386..662a9ff2 100644 --- a/mailreader/src/main/java/mailreader2/Constants.java +++ b/mailreader2/src/main/java/org/apache/struts/examples/mailreader2/Constants.java @@ -17,7 +17,7 @@ * under the License. */ -package mailreader2; +package org.apache.struts.examples.mailreader2; /** *

Manifest constants for the MailReader application.

@@ -52,11 +52,6 @@ public final class Constants { */ public static final String EDIT = "Edit"; - /** - *

The package name for this application.

- */ - public static final String PACKAGE = "org.apache.struts.apps.mailreader"; - /** *

The session scope attribute under which the Subscription object * currently selected by our logged-in User is stored.

diff --git a/mailreader/src/main/java/mailreader2/Login.java b/mailreader2/src/main/java/org/apache/struts/examples/mailreader2/LoginAction.java similarity index 78% rename from mailreader/src/main/java/mailreader2/Login.java rename to mailreader2/src/main/java/org/apache/struts/examples/mailreader2/LoginAction.java index 14e24fd1..6ec7da00 100644 --- a/mailreader/src/main/java/mailreader2/Login.java +++ b/mailreader2/src/main/java/org/apache/struts/examples/mailreader2/LoginAction.java @@ -17,30 +17,25 @@ * under the License. */ -package mailreader2; +package org.apache.struts.examples.mailreader2; -import org.apache.struts.apps.mailreader.dao.ExpiredPasswordException; -import org.apache.struts.apps.mailreader.dao.User; +import org.apache.struts.examples.mailreader2.dao.ExpiredPasswordException; +import org.apache.struts.examples.mailreader2.dao.User; /** *

Validate a user login.

*/ -public final class Login extends MailreaderSupport { - - public String execute() throws ExpiredPasswordException { +public final class LoginAction extends MailreaderSupport { + public String execute() throws ExpiredPasswordException { User user = findUser(getUsername(), getPassword()); - if (user != null) { setUser(user); } - if (hasErrors()) { return INPUT; } - return SUCCESS; - } } diff --git a/mailreader/src/main/java/mailreader2/Logout.java b/mailreader2/src/main/java/org/apache/struts/examples/mailreader2/LogoutAction.java similarity index 90% rename from mailreader/src/main/java/mailreader2/Logout.java rename to mailreader2/src/main/java/org/apache/struts/examples/mailreader2/LogoutAction.java index 564a0315..c7464b93 100644 --- a/mailreader/src/main/java/mailreader2/Logout.java +++ b/mailreader2/src/main/java/org/apache/struts/examples/mailreader2/LogoutAction.java @@ -17,17 +17,16 @@ * under the License. */ -package mailreader2; +package org.apache.struts.examples.mailreader2; /** *

Log user out of the current session.

*/ -public class Logout extends MailreaderSupport { +public class LogoutAction extends MailreaderSupport { public String execute() { - setUser(null); - return SUCCESS; } + } diff --git a/mailreader/src/main/java/mailreader2/MailreaderSupport.java b/mailreader2/src/main/java/org/apache/struts/examples/mailreader2/MailreaderSupport.java similarity index 95% rename from mailreader/src/main/java/mailreader2/MailreaderSupport.java rename to mailreader2/src/main/java/org/apache/struts/examples/mailreader2/MailreaderSupport.java index 5b916942..b6cdcbd8 100644 --- a/mailreader/src/main/java/mailreader2/MailreaderSupport.java +++ b/mailreader2/src/main/java/org/apache/struts/examples/mailreader2/MailreaderSupport.java @@ -17,17 +17,17 @@ * under the License. */ -package mailreader2; +package org.apache.struts.examples.mailreader2; import com.opensymphony.xwork2.ActionSupport; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -import org.apache.struts.apps.mailreader.dao.ExpiredPasswordException; -import org.apache.struts.apps.mailreader.dao.Subscription; -import org.apache.struts.apps.mailreader.dao.User; -import org.apache.struts.apps.mailreader.dao.UserDatabase; -import org.apache.struts.apps.mailreader.dao.impl.memory.MemorySubscription; -import org.apache.struts.apps.mailreader.dao.impl.memory.MemoryUser; +import org.apache.struts.examples.mailreader2.dao.ExpiredPasswordException; +import org.apache.struts.examples.mailreader2.dao.Subscription; +import org.apache.struts.examples.mailreader2.dao.User; +import org.apache.struts.examples.mailreader2.dao.UserDatabase; +import org.apache.struts.examples.mailreader2.dao.impl.memory.MemorySubscription; +import org.apache.struts.examples.mailreader2.dao.impl.memory.MemoryUser; import org.apache.struts2.interceptor.ApplicationAware; import org.apache.struts2.interceptor.SessionAware; @@ -49,8 +49,7 @@ * the temporary object, and the new object is saved. It's kludge, but it * avoids creating unnecessary local properties. Pick your poison.

*/ -public class MailreaderSupport extends ActionSupport - implements SessionAware, ApplicationAware { +public class MailreaderSupport extends ActionSupport implements SessionAware, ApplicationAware { /** * Return CANCEL so apropriate result can be selected. @@ -385,7 +384,7 @@ public User findUser(String username, String password) /** *

Log instance for this application.

*/ - protected Logger log = LogManager.getLogger(Constants.PACKAGE); + private Logger log = LogManager.getLogger(MailreaderSupport.class); /** *

Persist the User object, including subscriptions, to the database. @@ -489,9 +488,7 @@ public void setSubscription(Subscription subscription) { * @return The matching Subscription or null */ public Subscription findSubscription(String host) { - Subscription subscription; - subscription = getUser().findSubscription(host); - return subscription; + return getUser().findSubscription(host); } /** diff --git a/mailreader/src/main/java/mailreader2/Registration.java b/mailreader2/src/main/java/org/apache/struts/examples/mailreader2/RegistrationAction.java similarity index 95% rename from mailreader/src/main/java/mailreader2/Registration.java rename to mailreader2/src/main/java/org/apache/struts/examples/mailreader2/RegistrationAction.java index 41e985b7..bdf1a720 100644 --- a/mailreader/src/main/java/mailreader2/Registration.java +++ b/mailreader2/src/main/java/org/apache/struts/examples/mailreader2/RegistrationAction.java @@ -17,15 +17,14 @@ * under the License. */ -package mailreader2; - -import org.apache.struts.apps.mailreader.dao.User; +package org.apache.struts.examples.mailreader2; +import org.apache.struts.examples.mailreader2.dao.User; /** *

Insert or update a User object to the persistent store.

*/ -public class Registration extends MailreaderSupport { +public class RegistrationAction extends MailreaderSupport { /** *

Double check that there is not a valid User login.

diff --git a/mailreader/src/main/java/mailreader2/Subscription.java b/mailreader2/src/main/java/org/apache/struts/examples/mailreader2/SubscriptionAction.java similarity index 89% rename from mailreader/src/main/java/mailreader2/Subscription.java rename to mailreader2/src/main/java/org/apache/struts/examples/mailreader2/SubscriptionAction.java index df12d524..e4a50536 100644 --- a/mailreader/src/main/java/mailreader2/Subscription.java +++ b/mailreader2/src/main/java/org/apache/struts/examples/mailreader2/SubscriptionAction.java @@ -17,9 +17,10 @@ * under the License. */ -package mailreader2; +package org.apache.struts.examples.mailreader2; import com.opensymphony.xwork2.Preparable; +import org.apache.struts.examples.mailreader2.dao.Subscription; import java.util.LinkedHashMap; import java.util.Map; @@ -28,20 +29,19 @@ *

Provide an Edit method for retrieving an existing subscription, and a * Save method for updating or inserting a subscription.

*/ -public class Subscription extends MailreaderSupport - implements Preparable { +public class SubscriptionAction extends MailreaderSupport implements Preparable { /** *

Field to store list of MailServer types

*/ - private Map types = null; + private Map types = null; /** *

Provide the list of MailServer types.

* * @return List of MailServer types */ - public Map getTypes() { + public Map getTypes() { return types; } @@ -51,7 +51,7 @@ public Map getTypes() { */ public void prepare() { - Map m = new LinkedHashMap(); + Map m = new LinkedHashMap<>(); m.put("imap", "IMAP Protocol"); m.put("pop3", "POP3 Protocol"); types = m; @@ -80,18 +80,13 @@ public String input() { * @return INPUT or Error, if Subscription is not found */ public String find() { - - org.apache.struts.apps.mailreader.dao.Subscription - sub = findSubscription(); - + Subscription sub = findSubscription(); if (sub == null) { return ERROR; } setSubscription(sub); - return INPUT; - } /** @@ -101,7 +96,6 @@ public String find() { * @return INPUT or Error, if Subscription is not found */ public String delete() { - setTask(Constants.DELETE); return find(); } @@ -112,7 +106,6 @@ public String delete() { * @return INPUT or Error, if Subscription is not found */ public String edit() { - setTask(Constants.EDIT); return find(); } @@ -125,7 +118,6 @@ public String edit() { * @throws Exception on a database error */ public String save() throws Exception { - if (Constants.DELETE.equals(getTask())) { removeSubscription(); } diff --git a/mailreader/src/main/java/mailreader2/Welcome.java b/mailreader2/src/main/java/org/apache/struts/examples/mailreader2/WelcomeAction.java similarity index 93% rename from mailreader/src/main/java/mailreader2/Welcome.java rename to mailreader2/src/main/java/org/apache/struts/examples/mailreader2/WelcomeAction.java index 428ca513..fd31373e 100644 --- a/mailreader/src/main/java/mailreader2/Welcome.java +++ b/mailreader2/src/main/java/org/apache/struts/examples/mailreader2/WelcomeAction.java @@ -17,12 +17,12 @@ * under the License. */ -package mailreader2; +package org.apache.struts.examples.mailreader2; /** * Verify that essential resources are available. */ -public class Welcome extends MailreaderSupport { +public class WelcomeAction extends MailreaderSupport { public String execute() { diff --git a/mailreader2/src/main/java/org/apache/struts/examples/mailreader2/dao/ExpiredPasswordException.java b/mailreader2/src/main/java/org/apache/struts/examples/mailreader2/dao/ExpiredPasswordException.java new file mode 100644 index 00000000..3c397eac --- /dev/null +++ b/mailreader2/src/main/java/org/apache/struts/examples/mailreader2/dao/ExpiredPasswordException.java @@ -0,0 +1,37 @@ +/* + * 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. + */ + +package org.apache.struts.examples.mailreader2.dao; + +/** + * Example of an application-specific exception for which a handler + * can be configured. + */ +public class ExpiredPasswordException extends Exception { + + /** + * Construct a new instance of this exception for the specified username. + * + * @param username Username whose password has expired + */ + public ExpiredPasswordException(String username) { + super("Password for " + username + " has expired."); + } + +} diff --git a/mailreader2/src/main/java/org/apache/struts/examples/mailreader2/dao/Subscription.java b/mailreader2/src/main/java/org/apache/struts/examples/mailreader2/dao/Subscription.java new file mode 100644 index 00000000..64015d56 --- /dev/null +++ b/mailreader2/src/main/java/org/apache/struts/examples/mailreader2/dao/Subscription.java @@ -0,0 +1,90 @@ +/* + * 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. + */ + +package org.apache.struts.examples.mailreader2.dao; + +/** + *

A Subscription which is stored, along with the + * associated {@link User}, in a {@link UserDatabase}.

+ * + * @version $Rev$ $Date$ + */ +public interface Subscription { + + // ------------------------------------------------------------- Properties + + /** + * Return the auto-connect flag. + */ + boolean getAutoConnect(); + + /** + * Set the auto-connect flag. + * + * @param autoConnect The new auto-connect flag + */ + void setAutoConnect(boolean autoConnect); + + /** + * Return the host name. + */ + String getHost(); + + /** + * Return the password. + */ + String getPassword(); + + /** + * Set the password. + * + * @param password The new password + */ + void setPassword(String password); + + /** + * Return the subscription type. + */ + String getType(); + + /** + * Set the subscription type. + * + * @param type The new subscription type + */ + void setType(String type); + + /** + * Return the {@link User} owning this Subscription. + */ + User getUser(); + + /** + * Return the username. + */ + String getUsername(); + + /** + * Set the username. + * + * @param username The new username + */ + void setUsername(String username); + +} diff --git a/mailreader2/src/main/java/org/apache/struts/examples/mailreader2/dao/User.java b/mailreader2/src/main/java/org/apache/struts/examples/mailreader2/dao/User.java new file mode 100644 index 00000000..6dd91244 --- /dev/null +++ b/mailreader2/src/main/java/org/apache/struts/examples/mailreader2/dao/User.java @@ -0,0 +1,126 @@ +/* + * 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. + */ + +package org.apache.struts.examples.mailreader2.dao; + +/** + *

A User which is stored, along with his or her + * associated {@link Subscription}s, in a {@link UserDatabase}.

+ */ +public interface User { + + // ------------------------------------------------------------- Properties + + /** + * Return the {@link UserDatabase} with which we are associated. + */ + UserDatabase getDatabase(); + + /** + * Return the from address. + */ + String getFromAddress(); + + /** + * Set the from address. + * + * @param fromAddress The new from address + */ + void setFromAddress(String fromAddress); + + /** + * Return the full name. + */ + String getFullName(); + + /** + * Set the full name. + * + * @param fullName The new full name + */ + void setFullName(String fullName); + + /** + * Return the password. + */ + String getPassword(); + + /** + * Set the password. + * + * @param password The new password + */ + void setPassword(String password); + + /** + * Return the reply-to address. + */ + String getReplyToAddress(); + + /** + * Set the reply-to address. + * + * @param replyToAddress The new reply-to address + */ + void setReplyToAddress(String replyToAddress); + + /** + * Find and return all {@link Subscription}s associated with this user. + * If there are none, a zero-length array is returned. + */ + Subscription[] getSubscriptions(); + + /** + * Return the username. + */ + String getUsername(); + + // --------------------------------------------------------- Public Methods + + /** + * Create and return a new {@link Subscription} associated with this + * User, for the specified host name. + * + * @param host Host name for which to create a subscription + * + * @exception IllegalArgumentException if the host name is not unique + * for this user + */ + Subscription createSubscription(String host); + + /** + * Find and return the {@link Subscription} associated with the specified + * host. If none is found, return null. + * + * @param host Host name to look up + */ + Subscription findSubscription(String host); + + /** + * Remove the specified {@link Subscription} from being associated + * with this User. + * + * @param subscription Subscription to be removed + * + * @exception IllegalArgumentException if the specified subscription is not + * associated with this User + */ + void removeSubscription(Subscription subscription); + +} diff --git a/mailreader2/src/main/java/org/apache/struts/examples/mailreader2/dao/UserDatabase.java b/mailreader2/src/main/java/org/apache/struts/examples/mailreader2/dao/UserDatabase.java new file mode 100644 index 00000000..154e66e6 --- /dev/null +++ b/mailreader2/src/main/java/org/apache/struts/examples/mailreader2/dao/UserDatabase.java @@ -0,0 +1,96 @@ +/* + * 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. + */ +package org.apache.struts.examples.mailreader2.dao; + +/** + *

A Data Access Object (DAO) interface describing + * the available operations for retrieving and storing {@link User}s + * (and their associated {@link Subscription}s) in some persistence layer + * whose characteristics are not specified here. One or more implementations + * will be created to perform the actual I/O that is required.

+ */ +public interface UserDatabase { + + // --------------------------------------------------------- Public Methods + + /** + *

Create and return a new {@link User} defined in this user database. + *

+ * + * @param username Username of the new user + * + * @exception IllegalArgumentException if the specified username + * is not unique + */ + User createUser(String username); + + /** + *

Finalize access to the underlying persistence layer.

+ * + * @exception Exception if a database access error occurs + */ + void close() throws Exception; + + /** + *

Return the existing {@link User} with the specified username, + * if any; otherwise return null.

+ * + * @param username Username of the user to retrieve + * @throws ExpiredPasswordException if user password has expired + * and must be changed + */ + User findUser(String username) throws ExpiredPasswordException; + + /** + *

Return the set of {@link User}s defined in this user database.

+ */ + User[] findUsers(); + + /** + *

Return true if open() has been called.

+ * + * @exception Exception if a database access error occurs + */ + boolean isOpen(); + + /** + *

Initiate access to the underlying persistence layer.

+ * + * @exception Exception if a database access error occurs + */ + void open() throws Exception; + + /** + * Remove the specified {@link User} from this database. + * + * @param user User to be removed + * + * @exception IllegalArgumentException if the specified user is not + * associated with this database + */ + void removeUser(User user); + + /** + *

Save any pending changes to the underlying persistence layer.

+ * + * @exception Exception if a database access error occurs + */ + void save() throws Exception; + +} \ No newline at end of file diff --git a/mailreader2/src/main/java/org/apache/struts/examples/mailreader2/dao/impl/AbstractSubscription.java b/mailreader2/src/main/java/org/apache/struts/examples/mailreader2/dao/impl/AbstractSubscription.java new file mode 100644 index 00000000..c327c8dc --- /dev/null +++ b/mailreader2/src/main/java/org/apache/struts/examples/mailreader2/dao/impl/AbstractSubscription.java @@ -0,0 +1,179 @@ +/* + * 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. + */ + + +package org.apache.struts.examples.mailreader2.dao.impl; + +import org.apache.struts.examples.mailreader2.dao.Subscription; +import org.apache.struts.examples.mailreader2.dao.User; + +/** + *

Concrete implementation of {@link AbstractSubscription}.

+ * + * @version $Rev$ + * @since Struts 1.1 + */ + +public class AbstractSubscription implements Subscription { + + + // ----------------------------------------------------------- Constructors + + + /** + *

Construct a new Subscription associated with the specified + * {@link User}. + * + * @param user The user with which we are associated + * @param host The mail host for this subscription + */ + public AbstractSubscription(User user, String host) { + + super(); + this.user = user; + this.host = host; + + } + + + // ----------------------------------------------------- Instance Variables + + + /** + * The mail host for this subscription. + */ + private String host = null; + + + /** + * The {@link User} with which we are associated. + */ + private User user = null; + + + // ------------------------------------------------------------- Properties + + + /** + * Should we auto-connect at startup time? + */ + private boolean autoConnect = false; + + public boolean getAutoConnect() { + return (this.autoConnect); + } + + public void setAutoConnect(boolean autoConnect) { + this.autoConnect = autoConnect; + } + + + /** + * The mail host for this subscription. + */ + public String getHost() { + return (this.host); + } + + + /** + * The password (in clear text) for this subscription. + */ + private String password = null; + + public String getPassword() { + return (this.password); + } + + public void setPassword(String password) { + this.password = password; + } + + + /** + * The subscription type ("imap" or "pop3"). + */ + private String type = "imap"; + + public String getType() { + return (this.type); + } + + public void setType(String type) { + this.type = type; + } + + + /** + * The User owning this Subscription. + */ + public User getUser() { + return (this.user); + } + + + /** + * The username for this subscription. + */ + private String username = null; + + public String getUsername() { + return (this.username); + } + + public void setUsername(String username) { + this.username = username; + } + + + // --------------------------------------------------------- Public Methods + + + /** + * Return a String representation of this object. + */ + public String toString() { + + StringBuffer sb = new StringBuffer(""); + return (sb.toString()); + + } + + +} \ No newline at end of file diff --git a/mailreader2/src/main/java/org/apache/struts/examples/mailreader2/dao/impl/AbstractUser.java b/mailreader2/src/main/java/org/apache/struts/examples/mailreader2/dao/impl/AbstractUser.java new file mode 100644 index 00000000..f01c90bb --- /dev/null +++ b/mailreader2/src/main/java/org/apache/struts/examples/mailreader2/dao/impl/AbstractUser.java @@ -0,0 +1,236 @@ +/* + * 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. + */ + + +package org.apache.struts.examples.mailreader2.dao.impl; + +import org.apache.struts.examples.mailreader2.dao.Subscription; +import org.apache.struts.examples.mailreader2.dao.User; +import org.apache.struts.examples.mailreader2.dao.UserDatabase; + +import java.util.HashMap; + +/** + *

Concrete implementation of {@link AbstractUser}.

+ * + * @version $Rev$ + * @since Struts 1.1 + */ + +public abstract class AbstractUser implements User { + + + // ----------------------------------------------------------- Constructors + + + /** + *

Construct a new User associated with the specified + * {@link UserDatabase}. + * + * @param database The user database with which we are associated + * @param username The username of this user + */ + public AbstractUser(UserDatabase database, String username) { + + super(); + this.database = database; + this.username = username; + + } + + + // ----------------------------------------------------- Instance Variables + + + /** + * The {@link UserDatabase} with which we are associated. + */ + private UserDatabase database = null; + + + /** + * The {@link Subscription}s for this User, keyed by hostname. + */ + private HashMap subscriptions = new HashMap(); + + + /** + * The username for this user. + */ + private String username = null; + + + // ------------------------------------------------------------- Properties + + + /** + * The {@link UserDatabase} with which we are associated. + */ + public UserDatabase getDatabase() { + return (this.database); + } + + + /** + * The email address from which messages are sent. + */ + private String fromAddress = null; + + public String getFromAddress() { + return (this.fromAddress); + } + + public void setFromAddress(String fromAddress) { + this.fromAddress = fromAddress; + } + + + /** + * The full name of this user, included in from addresses. + */ + private String fullName = null; + + public String getFullName() { + return (this.fullName); + } + + public void setFullName(String fullName) { + this.fullName = fullName; + } + + + /** + * The password (in clear text). + */ + private String password = null; + + public String getPassword() { + return (this.password); + } + + public void setPassword(String password) { + this.password = password; + } + + + /** + * The EMAIL address to which replies should be sent. + */ + private String replyToAddress = null; + + public String getReplyToAddress() { + return (this.replyToAddress); + } + + public void setReplyToAddress(String replyToAddress) { + this.replyToAddress = replyToAddress; + } + + + /** + * Find and return all {@link Subscription}s associated with this user. + * If there are none, a zero-length array is returned. + */ + public Subscription[] getSubscriptions() { + + synchronized (subscriptions) { + Subscription results[] = new Subscription[subscriptions.size()]; + return ((Subscription[]) subscriptions.values().toArray(results)); + } + + } + + + /** + * The username (must be unique). + */ + public String getUsername() { + return (this.username); + } + + + // --------------------------------------------------------- Public Methods + + + /** + * Create and return a new {@link Subscription} associated with this + * User, for the specified host name. + * + * @param host Host name for which to create a subscription + * + * @exception IllegalArgumentException if the host name is not unique + * for this user + */ + public Subscription createSubscription(String host) { + + synchronized (subscriptions) { + if (subscriptions.get(host) != null) { + throw new IllegalArgumentException("Duplicate host '" + host + + "' for user '" + + username + "'"); + } + Subscription subscription = + new AbstractSubscription(this, host); + synchronized (subscriptions) { + subscriptions.put(host, subscription); + } + return (subscription); + } + + } + + + /** + * Find and return the {@link Subscription} associated with the specified + * host. If none is found, return null. + * + * @param host Host name to look up + */ + public Subscription findSubscription(String host) { + + synchronized (subscriptions) { + return ((Subscription) subscriptions.get(host)); + } + + } + + + /** + * Remove the specified {@link Subscription} from being associated + * with this User. + * + * @param subscription Subscription to be removed + * + * @exception IllegalArgumentException if the specified subscription is not + * associated with this User + */ + public void removeSubscription(Subscription subscription) { + + if (!(this == subscription.getUser())) { + throw new IllegalArgumentException + ("Subscription not associated with this user"); + } + synchronized (subscriptions) { + subscriptions.remove(subscription.getHost()); + } + + } + + +} \ No newline at end of file diff --git a/mailreader2/src/main/java/org/apache/struts/examples/mailreader2/dao/impl/memory/MemorySubscription.java b/mailreader2/src/main/java/org/apache/struts/examples/mailreader2/dao/impl/memory/MemorySubscription.java new file mode 100644 index 00000000..843a4919 --- /dev/null +++ b/mailreader2/src/main/java/org/apache/struts/examples/mailreader2/dao/impl/memory/MemorySubscription.java @@ -0,0 +1,28 @@ +/* + * 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. + */ +package org.apache.struts.examples.mailreader2.dao.impl.memory; + +import org.apache.struts.examples.mailreader2.dao.User; +import org.apache.struts.examples.mailreader2.dao.impl.AbstractSubscription; + +public class MemorySubscription extends AbstractSubscription { + + public MemorySubscription(User user, String host) { + super(user, host); + } + +} diff --git a/mailreader2/src/main/java/org/apache/struts/examples/mailreader2/dao/impl/memory/MemoryUser.java b/mailreader2/src/main/java/org/apache/struts/examples/mailreader2/dao/impl/memory/MemoryUser.java new file mode 100644 index 00000000..544b7752 --- /dev/null +++ b/mailreader2/src/main/java/org/apache/struts/examples/mailreader2/dao/impl/memory/MemoryUser.java @@ -0,0 +1,71 @@ +/* + * $Id: $ + * + * 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. + */ + +package org.apache.struts.examples.mailreader2.dao.impl.memory; + +import org.apache.struts.examples.mailreader2.dao.UserDatabase; +import org.apache.struts.examples.mailreader2.dao.impl.AbstractUser; + +/** + *

Concrete implementation of {@link AbstractUser} used for an in-memory + * database backed by an XML data file.

+ * + * @version $Rev$ + */ +public class MemoryUser extends AbstractUser { + + public MemoryUser(UserDatabase database, String username) { + super(database, username); + } + /** + * Return a String representation of this object. + */ + public String toString() { + + StringBuffer sb = new StringBuffer(""); + return (sb.toString()); + + } + +} \ No newline at end of file diff --git a/mailreader2/src/main/java/org/apache/struts/examples/mailreader2/dao/impl/memory/MemoryUserDatabase.java b/mailreader2/src/main/java/org/apache/struts/examples/mailreader2/dao/impl/memory/MemoryUserDatabase.java new file mode 100644 index 00000000..a3da63d6 --- /dev/null +++ b/mailreader2/src/main/java/org/apache/struts/examples/mailreader2/dao/impl/memory/MemoryUserDatabase.java @@ -0,0 +1,317 @@ +/* + * $Id$ + * + * 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. + */ +package org.apache.struts.examples.mailreader2.dao.impl.memory; + +import java.io.BufferedInputStream; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.OutputStreamWriter; +import java.io.PrintWriter; +import java.util.HashMap; + +import org.apache.commons.digester.Digester; +import org.apache.commons.digester.ObjectCreationFactory; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.apache.struts.examples.mailreader2.dao.Subscription; +import org.apache.struts.examples.mailreader2.dao.User; +import org.apache.struts.examples.mailreader2.dao.UserDatabase; +import org.xml.sax.Attributes; + +/** + *

Concrete implementation of {@link UserDatabase} for an in-memory + * database backed by an XML data file.

+ */ +public class MemoryUserDatabase implements UserDatabase { + + /** + * Logging output for this user database instance. + */ + private Log log = LogFactory.getLog(this.getClass()); + + /** + * The {@link User}s associated with this UserDatabase, keyed by username. + */ + private final HashMap users = new HashMap<>(); + + private boolean open = false; + + /** + * Absolute pathname to the persistent file we use for loading and storing + * persistent data. + */ + private String pathname = null; + + private String pathnameOld = null; + + private String pathnameNew = null; + + public String getPathname() { + return (this.pathname); + } + + public void setPathname(String pathname) { + this.pathname = pathname; + pathnameOld = pathname + ".old"; + pathnameNew = pathname + ".new"; + } + + public void close() throws Exception { + save(); + this.open = false; + } + + public User createUser(String username) { + synchronized (users) { + if (users.get(username) != null) { + throw new IllegalArgumentException("Duplicate user '" + + username + "'"); + } + if (log.isTraceEnabled()) { + log.trace("Creating user '" + username + "'"); + } + MemoryUser user = new MemoryUser(this, username); + synchronized (users) { + users.put(username, user); + } + return (user); + } + } + + public User findUser(String username) { + synchronized (users) { + return ((User) users.get(username)); + } + } + + public User[] findUsers() { + synchronized (users) { + User[] results = new User[users.size()]; + return users.values().toArray(results); + } + } + + public void open() throws Exception { + FileInputStream fis; + BufferedInputStream bis = null; + + try { + // Acquire an input stream to our database file + if (log.isDebugEnabled()) { + log.debug("Loading database from '" + pathname + "'"); + } + fis = new FileInputStream(pathname); + bis = new BufferedInputStream(fis); + + // Construct a digester to use for parsing + Digester digester = new Digester(); + digester.push(this); + digester.setValidating(false); + digester.addFactoryCreate + ("database/user", + new MemoryUserCreationFactory(this)); + digester.addFactoryCreate + ("database/user/subscription", + new MemorySubscriptionCreationFactory()); + + // Parse the input stream to initialize our database + digester.parse(bis); + bis.close(); + bis = null; + fis = null; + this.open = true; + + } catch (Exception e) { + log.error("Loading database from '" + pathname + "':", e); + throw e; + } finally { + if (bis != null) { + try { + bis.close(); + } catch (Throwable t) { + // do nothing + } + } + } + } + + public void removeUser(User user) { + if (!(this == user.getDatabase())) { + throw new IllegalArgumentException + ("User not associated with this database"); + } + if (log.isTraceEnabled()) { + log.trace("Removing user '" + user.getUsername() + "'"); + } + synchronized (users) { + users.remove(user.getUsername()); + } + } + + public void save() throws Exception { + if (log.isDebugEnabled()) { + log.debug("Saving database to '" + pathname + "'"); + } + File fileNew = new File(pathnameNew); + PrintWriter writer = null; + + try { + + // Configure our PrintWriter + FileOutputStream fos = new FileOutputStream(fileNew); + OutputStreamWriter osw = new OutputStreamWriter(fos); + writer = new PrintWriter(osw); + + // Print the file prolog + writer.println(""); + writer.println(""); + + // Print entries for each defined user and associated subscriptions + User[] yusers = findUsers(); + for (User yuser : yusers) { + writer.print(" "); + writer.println(yuser); + Subscription[] subscriptions = + yuser.getSubscriptions(); + for (Subscription subscription : subscriptions) { + writer.print(" "); + writer.println(subscription); + writer.print(" "); + writer.println(""); + } + writer.print(" "); + writer.println("
"); + } + + // Print the file epilog + writer.println(""); + + // Check for errors that occurred while printing + if (writer.checkError()) { + writer.close(); + fileNew.delete(); + throw new IOException("Saving database to '" + pathname + "'"); + } + writer.close(); + writer = null; + } catch (IOException e) { + if (writer != null) { + writer.close(); + } + fileNew.delete(); + throw e; + } + + // Perform the required renames to permanently save this file + File fileOrig = new File(pathname); + File fileOld = new File(pathnameOld); + if (fileOrig.exists()) { + fileOld.delete(); + if (!fileOrig.renameTo(fileOld)) { + throw new IOException + ("Renaming '" + pathname + "' to '" + pathnameOld + "'"); + } + } + if (!fileNew.renameTo(fileOrig)) { + if (fileOld.exists()) { + fileOld.renameTo(fileOrig); + } + throw new IOException + ("Renaming '" + pathnameNew + "' to '" + pathname + "'"); + } + fileOld.delete(); + } + + public boolean isOpen() { + return this.open; + } +} + +/** + * Digester object creation factory for subscription instances. + */ +class MemorySubscriptionCreationFactory implements ObjectCreationFactory { + + private Digester digester = null; + + public Digester getDigester() { + return (this.digester); + } + + public void setDigester(Digester digester) { + this.digester = digester; + } + + public Object createObject(Attributes attributes) { + String host = attributes.getValue("host"); + User user = (User) digester.peek(); + Subscription subscription = user.createSubscription(host); + String autoConnect = attributes.getValue("autoConnect"); + if (autoConnect == null) { + autoConnect = "false"; + } + if ("true".equalsIgnoreCase(autoConnect) || + "yes".equalsIgnoreCase(autoConnect)) { + subscription.setAutoConnect(true); + } else { + subscription.setAutoConnect(false); + } + subscription.setPassword(attributes.getValue("password")); + subscription.setType(attributes.getValue("type")); + subscription.setUsername(attributes.getValue("username")); + return (subscription); + } +} + +/** + * Digester object creation factory for user instances. + */ +class MemoryUserCreationFactory implements ObjectCreationFactory { + + public MemoryUserCreationFactory(MemoryUserDatabase database) { + this.database = database; + } + + private MemoryUserDatabase database = null; + + private Digester digester = null; + + public Digester getDigester() { + return (this.digester); + } + + public void setDigester(Digester digester) { + this.digester = digester; + } + + public Object createObject(Attributes attributes) { + String username = attributes.getValue("username"); + User user = database.createUser(username); + user.setFromAddress(attributes.getValue("fromAddress")); + user.setFullName(attributes.getValue("fullName")); + user.setPassword(attributes.getValue("password")); + user.setReplyToAddress(attributes.getValue("replyToAddress")); + return (user); + } + +} diff --git a/mailreader/src/main/resources/LICENSE.txt b/mailreader2/src/main/resources/LICENSE.txt similarity index 100% rename from mailreader/src/main/resources/LICENSE.txt rename to mailreader2/src/main/resources/LICENSE.txt diff --git a/mailreader/src/main/resources/NOTICE.txt b/mailreader2/src/main/resources/NOTICE.txt similarity index 100% rename from mailreader/src/main/resources/NOTICE.txt rename to mailreader2/src/main/resources/NOTICE.txt diff --git a/mailreader/src/main/resources/alternate.properties b/mailreader2/src/main/resources/alternate.properties similarity index 100% rename from mailreader/src/main/resources/alternate.properties rename to mailreader2/src/main/resources/alternate.properties diff --git a/mailreader/src/main/resources/alternate_ja.properties b/mailreader2/src/main/resources/alternate_ja.properties similarity index 100% rename from mailreader/src/main/resources/alternate_ja.properties rename to mailreader2/src/main/resources/alternate_ja.properties diff --git a/mailreader/src/main/resources/log4j2.xml b/mailreader2/src/main/resources/log4j2.xml similarity index 84% rename from mailreader/src/main/resources/log4j2.xml rename to mailreader2/src/main/resources/log4j2.xml index 913b2993..092d5f60 100644 --- a/mailreader/src/main/resources/log4j2.xml +++ b/mailreader2/src/main/resources/log4j2.xml @@ -8,8 +8,7 @@ - - + diff --git a/mailreader/src/main/resources/mailreader-default.xml b/mailreader2/src/main/resources/mailreader-default.xml similarity index 76% rename from mailreader/src/main/resources/mailreader-default.xml rename to mailreader2/src/main/resources/mailreader-default.xml index ba42b625..3bfee57c 100644 --- a/mailreader/src/main/resources/mailreader-default.xml +++ b/mailreader2/src/main/resources/mailreader-default.xml @@ -10,19 +10,19 @@ + class="org.apache.struts.examples.mailreader2.AuthenticationInterceptor"/> - - + + - - + + - + diff --git a/mailreader/src/main/resources/mailreader-support.xml b/mailreader2/src/main/resources/mailreader-support.xml similarity index 71% rename from mailreader/src/main/resources/mailreader-support.xml rename to mailreader2/src/main/resources/mailreader-support.xml index cdbc4052..284f85f5 100644 --- a/mailreader/src/main/resources/mailreader-support.xml +++ b/mailreader2/src/main/resources/mailreader-support.xml @@ -11,16 +11,16 @@ - + WEB-INF/jsp/Welcome.jsp - + Welcome - + /WEB-INF/jsp/Login.jsp Welcome MainMenu @@ -31,7 +31,7 @@ - + /WEB-INF/jsp/Registration.jsp MainMenu @@ -45,17 +45,17 @@ Registration_input - + - + - + /WEB-INF/jsp/{1}.jsp diff --git a/mailreader/src/main/java/mailreader2/Login-validation.xml b/mailreader2/src/main/resources/org/apache/struts/examples/mailreader2/Login-validation.xml similarity index 100% rename from mailreader/src/main/java/mailreader2/Login-validation.xml rename to mailreader2/src/main/resources/org/apache/struts/examples/mailreader2/Login-validation.xml diff --git a/mailreader/src/main/java/mailreader2/MailreaderSupport.properties b/mailreader2/src/main/resources/org/apache/struts/examples/mailreader2/MailreaderSupport.properties similarity index 100% rename from mailreader/src/main/java/mailreader2/MailreaderSupport.properties rename to mailreader2/src/main/resources/org/apache/struts/examples/mailreader2/MailreaderSupport.properties diff --git a/mailreader/src/main/java/mailreader2/MailreaderSupport_ja.properties b/mailreader2/src/main/resources/org/apache/struts/examples/mailreader2/MailreaderSupport_ja.properties similarity index 100% rename from mailreader/src/main/java/mailreader2/MailreaderSupport_ja.properties rename to mailreader2/src/main/resources/org/apache/struts/examples/mailreader2/MailreaderSupport_ja.properties diff --git a/mailreader/src/main/java/mailreader2/MailreaderSupport_ru.properties b/mailreader2/src/main/resources/org/apache/struts/examples/mailreader2/MailreaderSupport_ru.properties similarity index 100% rename from mailreader/src/main/java/mailreader2/MailreaderSupport_ru.properties rename to mailreader2/src/main/resources/org/apache/struts/examples/mailreader2/MailreaderSupport_ru.properties diff --git a/mailreader/src/main/java/mailreader2/Registration-Registration_save-validation.xml b/mailreader2/src/main/resources/org/apache/struts/examples/mailreader2/Registration-Registration_save-validation.xml similarity index 100% rename from mailreader/src/main/java/mailreader2/Registration-Registration_save-validation.xml rename to mailreader2/src/main/resources/org/apache/struts/examples/mailreader2/Registration-Registration_save-validation.xml diff --git a/mailreader/src/main/java/mailreader2/Registration-validation.xml b/mailreader2/src/main/resources/org/apache/struts/examples/mailreader2/Registration-validation.xml similarity index 100% rename from mailreader/src/main/java/mailreader2/Registration-validation.xml rename to mailreader2/src/main/resources/org/apache/struts/examples/mailreader2/Registration-validation.xml diff --git a/mailreader/src/main/java/mailreader2/Subscription-Subscription_save-validation.xml b/mailreader2/src/main/resources/org/apache/struts/examples/mailreader2/Subscription-Subscription_save-validation.xml similarity index 100% rename from mailreader/src/main/java/mailreader2/Subscription-Subscription_save-validation.xml rename to mailreader2/src/main/resources/org/apache/struts/examples/mailreader2/Subscription-Subscription_save-validation.xml diff --git a/mailreader/src/main/java/mailreader2/Subscription-validation.xml b/mailreader2/src/main/resources/org/apache/struts/examples/mailreader2/Subscription-validation.xml similarity index 100% rename from mailreader/src/main/java/mailreader2/Subscription-validation.xml rename to mailreader2/src/main/resources/org/apache/struts/examples/mailreader2/Subscription-validation.xml diff --git a/mailreader/src/main/resources/struts.xml b/mailreader2/src/main/resources/struts.xml similarity index 84% rename from mailreader/src/main/resources/struts.xml rename to mailreader2/src/main/resources/struts.xml index 37182fe6..2347c669 100644 --- a/mailreader/src/main/resources/struts.xml +++ b/mailreader2/src/main/resources/struts.xml @@ -7,7 +7,6 @@ - diff --git a/mailreader/src/main/resources/velocity.properties b/mailreader2/src/main/resources/velocity.properties similarity index 100% rename from mailreader/src/main/resources/velocity.properties rename to mailreader2/src/main/resources/velocity.properties diff --git a/mailreader/src/main/webapp/WEB-INF/database.xml b/mailreader2/src/main/webapp/WEB-INF/database.xml similarity index 100% rename from mailreader/src/main/webapp/WEB-INF/database.xml rename to mailreader2/src/main/webapp/WEB-INF/database.xml diff --git a/mailreader/src/main/webapp/WEB-INF/jsp/ChangePassword.jsp b/mailreader2/src/main/webapp/WEB-INF/jsp/ChangePassword.jsp similarity index 100% rename from mailreader/src/main/webapp/WEB-INF/jsp/ChangePassword.jsp rename to mailreader2/src/main/webapp/WEB-INF/jsp/ChangePassword.jsp diff --git a/mailreader/src/main/webapp/WEB-INF/jsp/Error.jsp b/mailreader2/src/main/webapp/WEB-INF/jsp/Error.jsp similarity index 100% rename from mailreader/src/main/webapp/WEB-INF/jsp/Error.jsp rename to mailreader2/src/main/webapp/WEB-INF/jsp/Error.jsp diff --git a/mailreader/src/main/webapp/WEB-INF/jsp/Footer.jsp b/mailreader2/src/main/webapp/WEB-INF/jsp/Footer.jsp similarity index 100% rename from mailreader/src/main/webapp/WEB-INF/jsp/Footer.jsp rename to mailreader2/src/main/webapp/WEB-INF/jsp/Footer.jsp diff --git a/mailreader/src/main/webapp/WEB-INF/jsp/Login.jsp b/mailreader2/src/main/webapp/WEB-INF/jsp/Login.jsp similarity index 100% rename from mailreader/src/main/webapp/WEB-INF/jsp/Login.jsp rename to mailreader2/src/main/webapp/WEB-INF/jsp/Login.jsp diff --git a/mailreader/src/main/webapp/WEB-INF/jsp/MainMenu.jsp b/mailreader2/src/main/webapp/WEB-INF/jsp/MainMenu.jsp similarity index 100% rename from mailreader/src/main/webapp/WEB-INF/jsp/MainMenu.jsp rename to mailreader2/src/main/webapp/WEB-INF/jsp/MainMenu.jsp diff --git a/mailreader/src/main/webapp/WEB-INF/jsp/Registration.jsp b/mailreader2/src/main/webapp/WEB-INF/jsp/Registration.jsp similarity index 100% rename from mailreader/src/main/webapp/WEB-INF/jsp/Registration.jsp rename to mailreader2/src/main/webapp/WEB-INF/jsp/Registration.jsp diff --git a/mailreader/src/main/webapp/WEB-INF/jsp/Subscription.jsp b/mailreader2/src/main/webapp/WEB-INF/jsp/Subscription.jsp similarity index 100% rename from mailreader/src/main/webapp/WEB-INF/jsp/Subscription.jsp rename to mailreader2/src/main/webapp/WEB-INF/jsp/Subscription.jsp diff --git a/mailreader/src/main/webapp/WEB-INF/jsp/Welcome.jsp b/mailreader2/src/main/webapp/WEB-INF/jsp/Welcome.jsp similarity index 91% rename from mailreader/src/main/webapp/WEB-INF/jsp/Welcome.jsp rename to mailreader2/src/main/webapp/WEB-INF/jsp/Welcome.jsp index 0ce3e546..58e10a6e 100644 --- a/mailreader/src/main/webapp/WEB-INF/jsp/Welcome.jsp +++ b/mailreader2/src/main/webapp/WEB-INF/jsp/Welcome.jsp @@ -23,19 +23,19 @@

Language Options

  • - + en English
  • - + ja Japanese
  • - + ru Russian diff --git a/mailreader/src/main/webapp/WEB-INF/web.xml b/mailreader2/src/main/webapp/WEB-INF/web.xml similarity index 89% rename from mailreader/src/main/webapp/WEB-INF/web.xml rename to mailreader2/src/main/webapp/WEB-INF/web.xml index 26cc3718..c09b9e69 100644 --- a/mailreader/src/main/webapp/WEB-INF/web.xml +++ b/mailreader2/src/main/webapp/WEB-INF/web.xml @@ -2,7 +2,7 @@ - Struts 2 Mailreader + Struts 2 Mailreader 2 struts2 @@ -16,9 +16,7 @@ - - mailreader2.ApplicationListener - + org.apache.struts.examples.mailreader2.ApplicationListener diff --git a/mailreader/src/main/webapp/css/mailreader.css b/mailreader2/src/main/webapp/css/mailreader.css similarity index 100% rename from mailreader/src/main/webapp/css/mailreader.css rename to mailreader2/src/main/webapp/css/mailreader.css diff --git a/mailreader/src/main/webapp/index.html b/mailreader2/src/main/webapp/index.html similarity index 100% rename from mailreader/src/main/webapp/index.html rename to mailreader2/src/main/webapp/index.html diff --git a/mailreader/src/main/webapp/struts-power.gif b/mailreader2/src/main/webapp/struts-power.gif similarity index 100% rename from mailreader/src/main/webapp/struts-power.gif rename to mailreader2/src/main/webapp/struts-power.gif diff --git a/mailreader/src/main/webapp/tour.html b/mailreader2/src/main/webapp/tour.html similarity index 99% rename from mailreader/src/main/webapp/tour.html rename to mailreader2/src/main/webapp/tour.html index 7dc29f0f..4f5aacfa 100644 --- a/mailreader/src/main/webapp/tour.html +++ b/mailreader2/src/main/webapp/tour.html @@ -328,7 +328,7 @@
    A simple "forward thru" action element

    The Welcome action element
    -
    <action name="Welcome" class="mailreader2.Welcome">
    +
    <action name="Welcome" class="org.apache.struts.examples.mailreader2.Welcome">
         <result>/pages/Welcome.jsp</result>
         <interceptor-ref name="guest"/>
         </action>
    @@ -475,10 +475,10 @@

    Application


    -
    mailreader2.ApplicationListener
    +
    org.apache.struts.examples.mailreader2.ApplicationListener
     <listener>
       <listener-class>
    -    mailreader2.ApplicationListener
    +    org.apache.struts.examples.mailreader2.ApplicationListener
       </listener-class>
     </listener>

    @@ -1413,7 +1413,7 @@
    Error.jsp


    -
    mailreader2.AuthenticationInterceptor
    +
    org.apache.struts.examples.mailreader2.AuthenticationInterceptor
    package mailreader2;
     import com.opensymphony.xwork2.interceptor.Interceptor;
     import com.opensymphony.xwork2.ActionInvocation;
    @@ -1551,7 +1551,7 @@ 

    MainMenu


    Action mapping element for MainMenu
    -
    <action name="MainMenu" class="mailreader2.MailreaderSupport">
    +
    <action name="MainMenu" class="org.apache.struts.examples.mailreader2.MailreaderSupport">
         <result>/pages/MainMenu.jsp</result>
         </action>
    @@ -1967,7 +1967,7 @@


    mailreader-support.xml Subscription element
    -
    <action name="Subscription_*" method="{1}" class="mailreader2.Subscription">
    +
    <action name="Subscription_*" method="{1}" class="org.apache.struts.examples.mailreader2.Subscription">
       <result name="input">/pages/Subscription.jsp</result>
       <result type="redirect-action">Registration_input</result>
     </action>
    @@ -2427,17 +2427,17 @@
    mailreader-support.xml
    <result type="redirect-action">Registration_input</result> </global-results> - <action name="Subscription_save" method="save" class="mailreader2.Subscription"> + <action name="Subscription_save" method="save" class="org.apache.struts.examples.mailreader2.Subscription"> <interceptor-ref name="user-submit" /> </action> - <action name="Subscription_*" method="{1}" class="mailreader2.Subscription" /> + <action name="Subscription_*" method="{1}" class="org.apache.struts.examples.mailreader2.Subscription" /> </package> <package name="wildcard" namespace="/" extends="mailreader-support"> - <action name="*" class="mailreader2.MailreaderSupport"> + <action name="*" class="org.apache.struts.examples.mailreader2.MailreaderSupport"> <result>/{1}.jsp</result> </action> diff --git a/message-resource/pom.xml b/message-resource/pom.xml index d60d3080..3c2fdf91 100644 --- a/message-resource/pom.xml +++ b/message-resource/pom.xml @@ -6,13 +6,11 @@ org.apache.struts struts-examples - 1.0.0 + 1.1.0 message-resource - Message resource - Message resource example application for the Struts 2 getting started tutorials war diff --git a/message-store/pom.xml b/message-store/pom.xml index 26865fb9..a08f80ba 100644 --- a/message-store/pom.xml +++ b/message-store/pom.xml @@ -5,14 +5,14 @@ struts-examples org.apache.struts - 1.0.0 + 1.1.0 message-store - 1.0-SNAPSHOT - war Message Store + war + javax.servlet diff --git a/pom.xml b/pom.xml index 407999d7..bf8862e5 100644 --- a/pom.xml +++ b/pom.xml @@ -2,10 +2,12 @@ 4.0.0 + org.apache.struts struts-examples - 1.0.0 + 1.1.0 pom + Struts 2 Examples This is the parent pom for the Struts 2 examples that @@ -89,7 +91,7 @@ interceptors json json-customize - mailreader + mailreader2 message-resource message-store portlet @@ -116,19 +118,34 @@ org.apache.struts struts2-core - ${struts2.version} - org.apache.logging.log4j log4j-core - ${log4j2.version} + + org.apache.struts + struts2-core + ${struts2.version} + + + + org.apache.struts + struts2-config-browser-plugin + ${struts2.version} + + + + org.apache.logging.log4j + log4j-core + ${log4j2.version} + + org.apache.logging.log4j log4j-api diff --git a/portlet/pom.xml b/portlet/pom.xml index 16df2b55..0956a12b 100644 --- a/portlet/pom.xml +++ b/portlet/pom.xml @@ -24,13 +24,14 @@ org.apache.struts struts-examples - 1.0.0 + 1.1.0 portlet - war Portlet Webapp + war + pluto diff --git a/preparable-interface/pom.xml b/preparable-interface/pom.xml index fef9a702..1ed49e6c 100644 --- a/preparable-interface/pom.xml +++ b/preparable-interface/pom.xml @@ -6,13 +6,11 @@ org.apache.struts struts-examples - 1.0.0 + 1.1.0 preparable-interface - Preparable Interface - Struts 2 example application for the preparable interface getting started tutorial war diff --git a/rest-angular/pom.xml b/rest-angular/pom.xml index 6146ad5c..8b7bf6a6 100644 --- a/rest-angular/pom.xml +++ b/rest-angular/pom.xml @@ -5,16 +5,15 @@ org.apache.struts struts-examples - 1.0.0 + 1.1.0 rest-angular - war - REST Plugin based application with AngularJS - A REST Plugin based Struts2 application with AngularJS frontend, Bean validation, Exception Handling and multi language support. + war + UTF-8 2.10.1 diff --git a/restful2actionmapper/pom.xml b/restful2actionmapper/pom.xml index 707a79ad..371f5305 100644 --- a/restful2actionmapper/pom.xml +++ b/restful2actionmapper/pom.xml @@ -6,18 +6,14 @@ org.apache.struts struts-examples - 1.0.0 + 1.1.0 restful2actionmapper - - war - REST to Action Mapper Example Application + Example of using Rest style URLs for Struts 2 Getting Started tutorials - Example of using Rest style URLs for - Struts 2 Getting Started tutorials - + war reststyleactionmapper diff --git a/shiro-basic/pom.xml b/shiro-basic/pom.xml index 35e8fc2c..97c7c6e0 100644 --- a/shiro-basic/pom.xml +++ b/shiro-basic/pom.xml @@ -4,11 +4,10 @@ org.apache.struts struts-examples - 1.0.0 + 1.1.0 shiro-basic - Struts2 with Basic Shiro Security Integration war diff --git a/spring-struts/pom.xml b/spring-struts/pom.xml index 8431070d..a6ddd54f 100644 --- a/spring-struts/pom.xml +++ b/spring-struts/pom.xml @@ -6,11 +6,10 @@ org.apache.struts struts-examples - 1.0.0 + 1.1.0 spring-struts - Struts2 with Spring Integration war diff --git a/text-provider/pom.xml b/text-provider/pom.xml index c1b302a0..c7d3a404 100644 --- a/text-provider/pom.xml +++ b/text-provider/pom.xml @@ -5,13 +5,14 @@ org.apache.struts struts-examples - 1.0.0 + 1.1.0 text-provider - war Custom TextProvider + war + UTF-8 diff --git a/themes-override/pom.xml b/themes-override/pom.xml index 89cac9a0..3a395f38 100644 --- a/themes-override/pom.xml +++ b/themes-override/pom.xml @@ -6,13 +6,11 @@ org.apache.struts struts-examples - 1.0.0 + 1.1.0 themes-override - Struts 2 Themes Override - Struts 2 themes override example application for the Struts 2 getting started tutorials war diff --git a/themes/pom.xml b/themes/pom.xml index 8061c042..cf9648ac 100644 --- a/themes/pom.xml +++ b/themes/pom.xml @@ -6,16 +6,12 @@ org.apache.struts struts-examples - 1.0.0 + 1.1.0 themes - Struts 2 Themes - - Struts 2 themes example application for the - Struts 2 getting started tutorials - + Struts 2 themes example application for the Struts 2 getting started tutorials war diff --git a/tiles/pom.xml b/tiles/pom.xml index 82cd6b03..598408d8 100644 --- a/tiles/pom.xml +++ b/tiles/pom.xml @@ -5,13 +5,14 @@ org.apache.struts struts-examples - 1.0.0 + 1.1.0 tiles - war Struts Tiles Example + war + org.apache.struts diff --git a/type-conversion/pom.xml b/type-conversion/pom.xml index 32eb0522..d320d7ce 100644 --- a/type-conversion/pom.xml +++ b/type-conversion/pom.xml @@ -6,13 +6,14 @@ struts-examples org.apache.struts - 1.0.0 + 1.1.0 type-conversion - war Type Conversion + war + UTF-8 diff --git a/unit-testing/pom.xml b/unit-testing/pom.xml index 0dfb546d..a8f4c4a3 100644 --- a/unit-testing/pom.xml +++ b/unit-testing/pom.xml @@ -6,11 +6,10 @@ org.apache.struts struts-examples - 1.0.0 + 1.1.0 unit-testing - Unit Testing war diff --git a/unknown-handler/pom.xml b/unknown-handler/pom.xml index 9f5a520d..32dfaae2 100644 --- a/unknown-handler/pom.xml +++ b/unknown-handler/pom.xml @@ -6,14 +6,14 @@ struts-examples org.apache.struts - 1.0.0 + 1.1.0 - org.apache.org unknown-handler - war Unknown handler + war + UTF-8 diff --git a/using-tags/pom.xml b/using-tags/pom.xml index ae084fd8..427be91f 100644 --- a/using-tags/pom.xml +++ b/using-tags/pom.xml @@ -6,12 +6,11 @@ org.apache.struts struts-examples - 1.0.0 + 1.1.0 using-tags Using Struts 2 Tags - Struts 2 example application for the Using Struts 2 Tags getting started tutorial war diff --git a/validation-messages/pom.xml b/validation-messages/pom.xml index 131dbb72..0af2449f 100644 --- a/validation-messages/pom.xml +++ b/validation-messages/pom.xml @@ -5,7 +5,7 @@ struts-examples org.apache.struts - 1.0.0 + 1.1.0 validation-messages diff --git a/wildcard-method-selection/pom.xml b/wildcard-method-selection/pom.xml index 46a9b5c7..29b9a6f6 100644 --- a/wildcard-method-selection/pom.xml +++ b/wildcard-method-selection/pom.xml @@ -6,15 +6,13 @@ org.apache.struts struts-examples - 1.0.0 + 1.1.0 wildcard-method-selection - Wildcard Method Selection + Wildcard method selection example application for the Struts 2 getting started tutorials - Wildcard method selection example application for the Struts 2 getting started tutorials - war diff --git a/wildcard-regex/pom.xml b/wildcard-regex/pom.xml index e5521a88..7c0dba5e 100644 --- a/wildcard-regex/pom.xml +++ b/wildcard-regex/pom.xml @@ -5,15 +5,14 @@ struts-examples org.apache.struts - 1.0.0 + 1.1.0 - org.apache.struts wildcard-regex - war - 1 Wildcard RegEx pattern matching + war + UTF-8