Hello!
I'm trying to get a hang on how Struts 2 works, so I thought I'd try Apache
Struts 2's own Hello World tutorial at 
http://struts.apache.org/2.x/docs/hello-world.html
http://struts.apache.org/2.x/docs/hello-world.html 

But as I'm deploying it I get a HTTP 404: The requested resource () is not
available.

I've done a roseindia.net Hello World tutorial for Struts 2 before, which
after much effort worked.
So I compared the two and except for some different package names etc they
look identical.
And the roseindia.net HelloWorld application works.

I'll post the code from my web.xml and struts.xml below, maybe you can find
something.
My folderstructure is as follows:

tutorial
tutorial/src
tutorial/src/tutorial
tutorial/src/tutorial/HelloWorld.java
tutorial/src/struts.xml
tutorial/WebContent/META-INF/
tutorial/WebContent/META-INF/MANIFEST.MF
tutorial/WebContent/pages
tutorial/WebContent/pages/HelloWorld.jsp
tutorial/WebContent/WEB-INF
tutorial/WebContent/WEB-INF/lib
tutorial/WebContent/WEB-INF/lib/commons-logging-1.1.jar
tutorial/WebContent/WEB-INF/lib/freemarker-2.3.8.jar
tutorial/WebContent/WEB-INF/lib/ognl-2.6.11.jar
tutorial/WebContent/WEB-INF/lib/struts2-core-2.0.6.jar
tutorial/WebContent/WEB-INF/lib/xwork-2.0.1.jar
tutorial/WebContent/WEB-INF/web.xml
tutorial/WebContent/index.html


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>
        <constant name="struts.enable.DynamicMethodInvocation" value="false" />
    <constant name="struts.devMode" value="true" />
   
    <package name="tutorial" extends="struts-default">
        <action name="HelloWorld" class="tutorial.HelloWorld">
            <result>/pages/HelloWorld.jsp</result>
        </action>
        <!-- Add your actions here -->
    </package>
</struts>


web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_9" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd";>

    <display-name>Struts Blank</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>

    <welcome-file-list>
        <welcome-file>index.html</welcome-file>
    </welcome-file-list>

</web-app>


With http://localhost:8080/tutorial/HelloWorld.action in my browser I get
the above mentioned message.
http://localhost:8080/tutorial/tutorial/HelloWorld.action doesn't work
either. (I figured it might search for the action in the root folder)

As it seems it doesn't even find the HelloWorld.jsp, I use Eclipse SDK and
when I choose to run the .jsp on the server I also get the "Requested
resource() not found"

I'd appreciate some pointers. 
Thanks in advance
Alia

-- 
View this message in context: 
http://www.nabble.com/Struts-2-HelloWorld-%3A-The-requested-resource-%28%29-is-not-available.-tp22178599p22178599.html
Sent from the Struts - User mailing list archive at Nabble.com.


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

Reply via email to