0

I'm starting to use Struts2 in intellij. I'm not even able to run my application, since every time I get this error from the server:

There is no Action mapped for namespace [/] and action name [] associated with context path []

I know this question has yet answered, but I can solve it. Can you help me? Thanks in Advance, Paolo, and here's my code.

struts.xml

<?xml version="1.0" encoding="UTF-8"?>

<package name="Farmacia" extends="struts-default">

    <action name="noActionClass" class="Farmacia" method="perform">
        <result>web/WEB-INF/views/start.jsp</result>
    </action>

</package>

pom.xml

<?xml version="1.0" encoding="UTF-8"?>

http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0

<groupId>groupId</groupId>
<artifactId>Farmacia</artifactId>
<version>1.0-SNAPSHOT</version>

<dependencies>
    <dependency>
        <groupId>org.apache.struts</groupId>
        <artifactId>struts2-core</artifactId>
        <version>2.3.1.2</version>
    </dependency>
</dependencies>

<packaging>war</packaging>
<build>
    <finalName>struts-2.3-hello-world-example</finalName>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>2.3.2</version>
            <configuration>
                <source>1.7</source>
                <target>1.7</target>
            </configuration>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-war-plugin</artifactId>
            <configuration>
                <webXml>web\WEB-INF\web.xml</webXml>
            </configuration>
        </plugin>
    </plugins>
</build>

web.xml

    <welcome-file-list>
    <welcome-file>start.jsp</welcome-file>
</welcome-file-list>


<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>

Paolo Mazza
  • 87
  • 11

0 Answers0