Merge pull request #13015 from eugenp/remove-duplicate-module

remove duplicate module struts
This commit is contained in:
Loredana Crusoveanu 2022-11-13 17:42:13 +02:00 committed by GitHub
commit 657270c0e4
10 changed files with 0 additions and 226 deletions

View File

@ -621,7 +621,6 @@
<module>static-analysis</module> <module>static-analysis</module>
<module>stripe</module> <module>stripe</module>
<module>struts</module>
<module>tensorflow-java</module> <module>tensorflow-java</module>
<module>testing-modules</module> <module>testing-modules</module>
@ -1017,7 +1016,6 @@
<module>static-analysis</module> <module>static-analysis</module>
<module>stripe</module> <module>stripe</module>
<module>struts</module>
<module>tensorflow-java</module> <module>tensorflow-java</module>
<module>testing-modules</module> <module>testing-modules</module>

View File

@ -1,7 +0,0 @@
## Struts 2
This module contains articles about Struts 2
### Relevant articles
- [A Quick Struts 2 Intro](https://www.baeldung.com/struts-2-intro)

View File

@ -1,12 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0">
<display-name>struts</display-name>
<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
</web-app>

View File

@ -1,21 +0,0 @@
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Baledung Struts</title>
</head>
<body>
<form method="get" action="/MyStrutsApp/tutorial/car.action">
<p>Welcome to Baeldung Struts 2 app</p>
<p>Which car do you like !!</p>
<p>Please choose ferrari or bmw</p>
<select name="carName">
<option value="Ferrari" label="ferrari" />
<option value="BMW" label="bmw" />
</select> <input type="submit" value="Enter!" />
</form>
</body>
</html>

View File

@ -1,11 +0,0 @@
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
<html>
<head>
<title>Hello World</title>
</head>
<body>
<p> Hello Baeldung User </p>
<p>You are a <s:property value="carMessage"/></p>
</body>
</html>

View File

@ -1,76 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>struts</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>struts</name>
<packaging>pom</packaging>
<parent>
<groupId>com.baeldung</groupId>
<artifactId>parent-spring-4</artifactId>
<version>0.0.1-SNAPSHOT</version>
<relativePath>../parent-spring-4</relativePath>
</parent>
<dependencies>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-core</artifactId>
<version>${struts2.version}</version>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-junit-plugin</artifactId>
<version>${struts2.version}</version>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-convention-plugin</artifactId>
<version>${struts2-convention-plugin.version}</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>${javax.servlet-api.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>${spring.version}</version>
<exclusions>
<exclusion>
<artifactId>commons-logging</artifactId>
<groupId>commons-logging</groupId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
<build>
<sourceDirectory>src/main/java</sourceDirectory>
<resources>
<resource>
<directory>src/main/resources</directory>
</resource>
</resources>
<plugins>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>${maven-war-plugin.version}</version>
<configuration>
<warSourceDirectory>WebContent</warSourceDirectory>
</configuration>
</plugin>
</plugins>
</build>
<properties>
<struts2.version>2.5.5</struts2.version>
<struts2-convention-plugin.version>2.5.8</struts2-convention-plugin.version>
<spring.version>4.3.6.RELEASE</spring.version>
</properties>
</project>

View File

@ -1,37 +0,0 @@
package com.baeldung.struts;
import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.Namespace;
import org.apache.struts2.convention.annotation.Result;
@Namespace("/tutorial")
@Action("/car")
@Result(name = "success", location = "/result.jsp")
public class CarAction {
private String carName;
private String carMessage;
private CarMessageService carMessageService = new CarMessageService();
public String execute() {
System.out.println("inside execute(): carName is" + carName);
this.setCarMessage(this.carMessageService.getMessage(carName));
return "success";
}
public String getCarName() {
return carName;
}
public void setCarName(String carName) {
this.carName = carName;
}
public String getCarMessage() {
return carMessage;
}
public void setCarMessage(String carMessage) {
this.carMessage = carMessage;
}
}

View File

@ -1,18 +0,0 @@
package com.baeldung.struts;
public class CarMessageService {
public String getMessage(String carName) {
System.out.println("inside getMessage()" + carName);
if (carName.equalsIgnoreCase("ferrari")){
return "Ferrari Fan!";
}
else if (carName.equalsIgnoreCase("bmw")){
return "BMW Fan!";
}
else{
return "please choose ferrari Or bmw";
}
}
}

View File

@ -1,13 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n
</pattern>
</encoder>
</appender>
<root level="INFO">
<appender-ref ref="STDOUT" />
</root>
</configuration>

View File

@ -1,29 +0,0 @@
//package com.baeldung.struts.test;
//
//import org.apache.struts2.StrutsTestCase;
//import org.junit.Test;
//
//import com.baeldung.struts.CarAction;
//import com.opensymphony.xwork2.ActionProxy;
//
//public class CarActionTest extends StrutsTestCase {
//
// public void testgivenCarOptions_WhenferrariSelected_ThenShowMessage() throws Exception {
// request.setParameter("carName", "ferrari");
// ActionProxy proxy = getActionProxy("/tutorial/car.action");
// CarAction carAction = (CarAction) proxy.getAction();
// String result = proxy.execute();
// assertEquals(result, "success");
// assertEquals(carAction.getCarMessage(), "Ferrari Fan!");
// }
//
// public void testgivenCarOptions_WhenbmwSelected_ThenShowMessage() throws Exception {
// request.setParameter("carName", "bmw");
// ActionProxy proxy = getActionProxy("/tutorial/car.action");
// CarAction carAction = (CarAction) proxy.getAction();
// String result = proxy.execute();
// assertEquals(result, "success");
// assertEquals(carAction.getCarMessage(), "BMW Fan!");
// }
//
//}