Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ on:
pull_request:
push:
branches:
- master
- main

permissions: write-all

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

package org.apache.struts_examples;

import com.opensymphony.xwork2.ActionSupport;
import org.apache.struts2.ActionSupport;

public class ActionA extends ActionSupport {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

package org.apache.struts_examples;

import com.opensymphony.xwork2.ActionSupport;
import org.apache.struts2.ActionSupport;

public class ActionB extends ActionSupport {

Expand Down
3 changes: 2 additions & 1 deletion annotations/src/main/java/example/actions/HelloAction.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package example.actions;

import com.opensymphony.xwork2.ActionSupport;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apache.struts2.ActionSupport;

/**
* Acts as a controller to handle actions
* related to registering a user.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package example.actions;

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.ActionSupport;
import org.apache.struts2.convention.annotation.Action;

/**
Expand Down
1 change: 0 additions & 1 deletion annotations/src/main/resources/log4j2.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
</Console>
</Appenders>
<Loggers>
<Logger name="com.opensymphony.xwork2" level="info"/>
<Logger name="org.apache.struts2" level="info"/>
<Logger name="org.apache.struts2.convention" level="debug"/>
<Logger name="example" level="debug"/>
Expand Down
1 change: 0 additions & 1 deletion basic-struts/src/main/resources/log4j2.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
</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">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package org.apache.struts.edit.action;

import com.opensymphony.xwork2.ActionSupport;
import jakarta.validation.Valid;
import org.apache.struts.edit.model.Person;
import org.apache.struts.edit.model.State;
import org.apache.struts.edit.service.EditService;
import org.apache.struts.edit.service.EditServiceInMemory;
import org.apache.struts2.ActionSupport;

import java.util.ArrayList;
import java.util.Arrays;
Expand Down
1 change: 0 additions & 1 deletion bean-validation/src/main/resources/log4j2.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
</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">
Expand Down
2 changes: 1 addition & 1 deletion blank/src/main/java/example/ExampleSupport.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

package example;

import com.opensymphony.xwork2.ActionSupport;
import org.apache.struts2.ActionSupport;

/**
* Base Action class for the Tutorial package.
Expand Down
1 change: 0 additions & 1 deletion blank/src/main/resources/log4j2.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
</Console>
</Appenders>
<Loggers>
<Logger name="com.opensymphony.xwork2" level="info"/>
<Logger name="org.apache.struts2" level="info"/>
<Root level="warn">
<AppenderRef ref="STDOUT"/>
Expand Down
10 changes: 5 additions & 5 deletions blank/src/test/java/example/ConfigTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@

package example;

import com.opensymphony.xwork2.ActionSupport;
import com.opensymphony.xwork2.config.RuntimeConfiguration;
import com.opensymphony.xwork2.config.entities.ActionConfig;
import com.opensymphony.xwork2.config.entities.ResultConfig;
import com.opensymphony.xwork2.config.providers.XmlConfigurationProvider;
import org.apache.struts2.ActionSupport;
import org.apache.struts2.config.RuntimeConfiguration;
import org.apache.struts2.config.StrutsXmlConfigurationProvider;
import org.apache.struts2.config.entities.ActionConfig;
import org.apache.struts2.config.entities.ResultConfig;
import org.apache.struts2.config.providers.XmlConfigurationProvider;
import org.apache.struts2.junit.StrutsTestCase;

import java.util.List;
Expand Down
2 changes: 1 addition & 1 deletion blank/src/test/java/example/HelloWorldTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/
package example;

import com.opensymphony.xwork2.ActionSupport;
import org.apache.struts2.ActionSupport;
import org.apache.struts2.junit.StrutsTestCase;

public class HelloWorldTest extends StrutsTestCase {
Expand Down
4 changes: 2 additions & 2 deletions blank/src/test/java/example/LoginTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@

package example;

import com.opensymphony.xwork2.ActionSupport;
import com.opensymphony.xwork2.config.entities.ActionConfig;
import org.apache.struts2.ActionSupport;
import org.apache.struts2.config.entities.ActionConfig;

import java.util.List;
import java.util.Map;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
package org.apache.struts.helloworld.action;

import com.opensymphony.xwork2.ActionSupport;
import org.apache.struts.helloworld.model.MessageStore;
import org.apache.struts2.ActionSupport;

/**
* Acts as a Struts 2 controller that responds
* to a user action by setting the value
* of the MessageStore model class, and returns a String
* of the MessageStore model class, and returns a String
* result.
* @author Bruce Phillips
*
*/
public class HelloWorldAction extends ActionSupport {

private static final long serialVersionUID = 1L;

/**
* The model class that stores the message
* to display in the view.
*/
private MessageStore messageStore;

private static int helloCount = 0;

public int getHelloCount() {
return helloCount;
}
Expand All @@ -38,24 +38,22 @@ public void setUserName(String userName) {
}

/*
* Creates the MessageStore model object,
* increase helloCount by 1 and
* Creates the MessageStore model object,
* increase helloCount by 1 and
* returns success. The MessageStore model
* object will be available to the view.
* (non-Javadoc)
* @see com.opensymphony.xwork2.ActionSupport#execute()
*/
public String execute() throws Exception {
messageStore = new MessageStore() ;

//Action included a query string parameter of userName
//or a form field with name of userName
if (userName != null) {
messageStore.setMessage( messageStore.getMessage() + " " + userName);
}

helloCount++;

return SUCCESS;
}

Expand Down
1 change: 0 additions & 1 deletion coding-actions/src/main/resources/log4j2.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
</Console>
</Appenders>
<Loggers>
<Logger name="com.opensymphony.xwork2" level="info"/>
<Logger name="org.apache.struts2" level="info"/>
<Logger name="org.apache.struts2.helloworld" level="debug"/>
<Root level="warn">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package org.apache.struts.edit.action;

import com.opensymphony.xwork2.ActionSupport;
import org.apache.struts.edit.model.Person;
import org.apache.struts.edit.model.State;
import org.apache.struts.edit.service.EditService;
import org.apache.struts.edit.service.EditServiceInMemory;
import org.apache.struts2.ActionSupport;

import java.util.ArrayList;
import java.util.Arrays;
Expand Down
1 change: 0 additions & 1 deletion control-tags/src/main/resources/log4j2.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
</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">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
package org.apache.struts.crud.action;

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.crud.model.Country;
import org.apache.struts.crud.model.Person;
import org.apache.struts.crud.service.DefaultPersonService;
import org.apache.struts.crud.service.PersonService;
import org.apache.struts2.ActionSupport;
import org.apache.struts2.Preparable;

/**
* Acts as a controller to handle actions related to editing a Person.
*
*
* @author bruce phillips
* @author antonio sánchez
*/
public class PersonAction extends ActionSupport implements Preparable {

private static final Logger LOG = LogManager.getLogger(PersonAction.class.getName());
private PersonService personService = new DefaultPersonService();
private Person person;
Expand All @@ -32,8 +32,8 @@ public void prepare() throws Exception {
sports = personService.getSports();
countries = personService.getCountries();
genders = personService.getGenders();
LOG.info("Prepared support data for Person entity.");
LOG.info("Prepared support data for Person entity.");

if (person != null && person.getPersonId() != null) {
person = personService.getPerson(person.getPersonId());
LOG.info("Preparing actual data for Person: " + person);
Expand All @@ -48,7 +48,7 @@ public String list() {
LOG.info("Listing persons");
return SUCCESS;
}

/**
* Save the state of the Person object instance field.
*/
Expand All @@ -72,7 +72,7 @@ public String delete() {
LOG.info("Deleted Person: " + person);
return SUCCESS;
}

public Person[] getPersons() {
return persons;
}
Expand Down
1 change: 0 additions & 1 deletion crud/src/main/resources/log4j2.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
</Console>
</Appenders>
<Loggers>
<Logger name="com.opensymphony.xwork2" level="info"/>
<Logger name="org.apache.struts2" level="info"/>
<Logger name="org.apache.struts.crud" level="debug"/>
<Root level="info">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,36 +1,36 @@
package org.apache.struts.helloworld.action;

import com.opensymphony.xwork2.ActionSupport;
import org.apache.struts.helloworld.model.MessageStore;
import org.apache.struts2.ActionSupport;

/**
* Acts as a Struts 2 controller that responds
* to a user action by setting the value
* of the Message model class, and returns a String
* of the Message model class, and returns a String
* result.
* @author Bruce Phillips
*
*/
public class HelloWorldAction extends ActionSupport {

private static final long serialVersionUID = 1L;

/**
* The model class that stores the message
* to display in the view.
*/
private MessageStore messageStore;

private static int helloCount = 0;

public int getHelloCount() {
return helloCount;
}

public void setHelloCount(int helloCount) {
HelloWorldAction.helloCount = helloCount;
}

private String userName;

public String getUserName() {
Expand All @@ -42,24 +42,22 @@ public void setUserName(String userName) {
}

/*
* Creates the MessageStore model object,
* increase helloCount by 1 and
* Creates the MessageStore model object,
* increase helloCount by 1 and
* returns success. The MessageStore model
* object will be available to the view.
* (non-Javadoc)
* @see com.opensymphony.xwork2.ActionSupport#execute()
*/
public String execute() throws Exception {

messageStore = new MessageStore() ;

//Action included a query string parameter of userName
//or a form field with name of userName
if (userName != null) {
messageStore.setMessage( messageStore.getMessage() + " " + userName);
}
helloCount++;

return SUCCESS;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
package org.apache.struts.register.action;

import com.opensymphony.xwork2.ActionSupport;
import org.apache.struts.register.exceptions.SecurityBreachException;
import org.apache.struts.register.model.Person;

import org.apache.struts2.ActionSupport;


/**
* Acts as a controller to handle actions related to registering a user.
*
*
* @author bruce phillips
*
*
*/
public class Register extends ActionSupport {

Expand Down
1 change: 0 additions & 1 deletion debugging-struts/src/main/resources/log4j2.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
</Console>
</Appenders>
<Loggers>
<Logger name="com.opensymphony.xwork2" level="info"/>
<Logger name="org.apache.struts2" level="debug"/>
<Root level="warn">
<AppenderRef ref="STDOUT"/>
Expand Down
Loading
Loading