Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Struts2 organization question

843840Jun 29 2010 — edited Jun 29 2010
I'm just getting into Struts2, following some tutorials but I can't seem to find a consistent way of organizing projects, especially if I'm using eclipse which I am. I came up with one that I kind of think fits (as far as I can tell, just being a beginner) however I'm getting an error that an action isn't found. I think it has to do with where I put things.

Here's my folder structure:

Struts2HelloWorldXML
-build
--classes
---HelloWorld.class
-src
--HelloWorld.java
-WebContent
--META-INF
--WEB-INF
---jsp
----HelloWorld.jsp
----NameCollector.jsp
---lib
---xml
----struts.xml
----helloinclude.xml
---web.xml
--index.html

Here are the contents of struts.xml and helloinclude.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.devMode" value="true" />
<include file="helloinclude.xml"/>
</struts>


<?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="default" namespace="/" extends="struts-default">
<action name="Name">
<result>/jsp/NameCollector.jsp</result>
</action>

<action name="HelloWorld" class="HelloWorld">
<result name="SUCCESS">/jsp/HelloWorld.jsp</result>
</action>

</package>

</struts>

The problem is, it can't find the Name action. I can post more, I'm just not sure what would be helpful other than the file structure and xml configurations. Does that look right?

Thanks
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 27 2010
Added on Jun 29 2010
1 comment
117 views