http://localhost:8080/struts2_maven/User/Login.action

HTTP Status 404 - Not Found

type Status report

messageNot Found

descriptionThe requested resource is not available.
GlassFish Server Open Source Edition 4.0

tree .
.
├── pom.xml
├── src
│   ├── main
│   │   ├── java
│   │   │   └── com
│   │   │       └── mkyong
│   │   │           └── user
│   │   │               └── action
│   │   │                   └── WelcomeUserAction.java
│   │   ├── resources
│   │   │   ├── struts.xml
│   │   │   └── struts.xml~
│   │   └── webapp
│   │       ├── index.jsp
│   │       ├── struts2-core-2.5.10.1.jar
│   │       ├── User
│   │       │   └── pages
│   │       │       ├── login.jsp
│   │       │       └── welcome_user.jsp
│   │       └── WEB-INF
│   │           ├── lib
│   │           ├── struts2-core-2.5.10.1.jar
│   │           └── web.xml
│   └── test
│       └── java
└── target
    ├── classes
    │   ├── com
    │   │   └── mkyong
    │   │       └── user
    │   │           └── action
    │   │               └── WelcomeUserAction.class
    │   └── struts.xml
    ├── m2e-wtp
    │   └── web-resources
    │       └── META-INF
    │           ├── MANIFEST.MF
    │           └── maven
    │               └── com.training
    │                   └── struts2_maven
    │                       ├── pom.properties
    │                       └── pom.xml
    ├── maven-archiver
    │   └── pom.properties
    ├── maven-status
    │   └── maven-compiler-plugin
    │       ├── compile
    │       │   └── default-compile
    │       │       ├── createdFiles.lst
    │       │       └── inputFiles.lst
    │       └── testCompile
    │           └── default-testCompile
    │               └── inputFiles.lst
    ├── struts2_maven
    │   ├── index.jsp
    │   ├── login.jsp
    │   ├── META-INF
    │   ├── struts2-core-2.5.10.1.jar
    │   ├── User
    │   │   └── pages
    │   │       ├── login.jsp
    │   │       └── welcome_user.jsp
    │   ├── WEB-INF
    │   │   ├── classes
    │   │   │   ├── com
    │   │   │   │   └── mkyong
    │   │   │   │       └── user
    │   │   │   │           └── action
    │   │   │   │               └── WelcomeUserAction.class
    │   │   │   └── struts.xml
    │   │   ├── lib
    │   │   │   ├── commons-fileupload-1.3.2.jar
    │   │   │   ├── commons-io-2.4.jar
    │   │   │   ├── commons-lang3-3.4.jar
    │   │   │   ├── freemarker-2.3.23.jar
    │   │   │   ├── javassist-3.20.0-GA.jar
    │   │   │   ├── log4j-api-2.7.jar
    │   │   │   ├── ognl-3.1.12.jar
    │   │   │   ├── servlet-api-2.5.jar
    │   │   │   └── struts2-core-2.5.10.1.jar
    │   │   ├── struts2-core-2.5.10.1.jar
    │   │   └── web.xml
    │   └── welcome_user.jsp
    ├── struts2_maven.war
    └── test-classes

46 directories, 39 files


Followed this: https://www.mkyong.com/struts2/struts-2-hello-world-example/

struts.xml

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd";>

<struts>

    <package name="user" namespace="/User" extends="struts-default">
        <action name="Login">
            <result>pages/login.jsp</result>
        </action>
        <action name="Welcome" class="com.mkyong.user.action.WelcomeUserAction">
            <result name="SUCCESS">pages/welcome_user.jsp</result>
        </action>
    </package>

</struts>

web.xml

<!DOCTYPE web-app PUBLIC
 "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
 "http://java.sun.com/dtd/web-app_2_3.dtd"; >

<web-app>
    <display-name>Struts 2 Web Application</display-name>

    <filter>
        <filter-name>struts2</filter-name>
        <filter-class>

org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter
                </filter-class>
    </filter>

    <filter-mapping>
        <filter-name>struts2</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>

</web-app>

pom.xml

<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/maven-v4_0_0.xsd";>
  <modelVersion>4.0.0</modelVersion>
  <groupId>com.training</groupId>
  <artifactId>struts2_maven</artifactId>
  <packaging>war</packaging>
  <version>0.0.1-SNAPSHOT</version>
  <name>struts2_maven Maven Webapp</name>
  <url>http://maven.apache.org</url>
  <dependencies>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>3.8.1</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.struts</groupId>
      <artifactId>struts2-core</artifactId>
      <version>2.5.10.1</version>
    </dependency>
    <dependency>
      <groupId>javax.servlet</groupId>
      <artifactId>servlet-api</artifactId>
      <version>2.5</version>
    </dependency>
  </dependencies>
  <build>
    <finalName>struts2_maven</finalName>
    <plugins>
        <plugin>
              <groupId>org.eclipse.jetty</groupId>
              <artifactId>jetty-maven-plugin</artifactId>
              <version>9.4.6</version>
          </plugin>
    </plugins>
  </build>
</project>

.classpath

<?xml version="1.0" encoding="UTF-8"?>
<classpath>
    <classpathentry exported="true" kind="con"
path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
        <attributes>
            <attribute name="maven.pomderived" value="true"/>
            <attribute name="org.eclipse.jst.component.dependency"
value="/WEB-INF/lib"/>
        </attributes>
    </classpathentry>
    <classpathentry exported="true" kind="con"
path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5">
        <attributes>
            <attribute name="maven.pomderived" value="true"/>
        </attributes>
    </classpathentry>
    <classpathentry kind="src" output="target/classes" path="src/main/java">
        <attributes>
            <attribute name="optional" value="true"/>
            <attribute name="maven.pomderived" value="true"/>
        </attributes>
    </classpathentry>
    <classpathentry excluding="**" kind="src" output="target/classes"
path="src/main/resources">
        <attributes>
            <attribute name="maven.pomderived" value="true"/>
        </attributes>
    </classpathentry>
    <classpathentry kind="src" output="target/test-classes"
path="src/test/java">
        <attributes>
            <attribute name="optional" value="true"/>
            <attribute name="maven.pomderived" value="true"/>
        </attributes>
    </classpathentry>
    <classpathentry kind="output" path="target/classes"/>
</classpath>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org

Reply via email to