You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Troy S <tr...@yahoo.com> on 2007/10/30 05:22:43 UTC

Getting started--mapping URLs to pages

Struts fans.

I am trying to add to the struts 2.0.9 blank application.  I tried adding
actions based on the excellent book in progress Struts2 in Action.

I tried loading the URL
http://ashanti:8080/struts2-blank-2.0.9/chapterTwo/Name.action and got the
error
There is no Action mapped for action name

Can anyone help?

Troy

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

    <include file="example.xml"/>
<package name="default" namespace="/" extends="strutsdefault">
     <action name="Menu"> <result>/menu/Menu.jsp</result>
     </action>
</package>
<package name="chapterTwo" namespace="/chapterTwo" extends="struts-
default">
<action name="Name">
<result>/chapterTwo/NameCollector.jsp</result>
</action>
<action name="HelloWorld" class="manning.chapterTwo.HelloWorld">
<result name="SUCCESS">/chapterTwo/HelloWorld.jsp</result>
<result name="ERROR">/chapterTwo/Error.jsp</result>
</action>
</package>
<!-- Add packages here -->

</struts>

-- 
View this message in context: http://www.nabble.com/Getting-started--mapping-URLs-to-pages-tf4716347.html#a13482290
Sent from the Struts - User mailing list archive at Nabble.com.


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


Re: Getting started--mapping URLs to pages

Posted by Dave Newton <ne...@yahoo.com>.
--- Troy S <tr...@yahoo.com> wrote:
> No, but now I have struts.xml in the correct
> directory and I am getting the same error.

It's being deployed to /WEB-INF/classes?

> (Also, where should the jsp file go?)
> <result>/menu/Menu.jsp</result>

In /menu/Menu.jsp.

You may want to turn up the log level to see what's
happening. You can also use the config-browser plugin
[1] to see what S2 thinks your configuration is.

d.

[1]
http://struts.apache.org/2.x/docs/config-browser-plugin.html


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


Re: Getting started--mapping URLs to pages

Posted by Troy S <tr...@yahoo.com>.
Nuwan,


No, but now I have struts.xml in the correct directory and I am getting the
same error.

(Also, where should the jsp file go?)

Thanks...
Troy


nuwan chandrasoma-2 wrote:
> 
> Hi,
> 
> do you have your struts.xml file inside WEB-INF/classes folder?
> 
> Thanks,
> 
> Nuwan
> 
> Troy S wrote:
>> Struts fans.
>>
>> I am trying to add to the struts 2.0.9 blank application.  I tried adding
>> actions based on the excellent book in progress Struts2 in Action.
>>
>> I tried loading the URL
>> http://ashanti:8080/struts2-blank-2.0.9/chapterTwo/Name.action and got
>> the
>> error
>> There is no Action mapped for action name
>>
>> Can anyone help?
>>
>> Troy
>>
>> 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" />
>>
>>     <include file="example.xml"/>
>> <package name="default" namespace="/" extends="strutsdefault">
>>      <action name="Menu"> <result>/menu/Menu.jsp</result>
>>      </action>
>> </package>
>> <package name="chapterTwo" namespace="/chapterTwo" extends="struts-
>> default">
>> <action name="Name">
>> <result>/chapterTwo/NameCollector.jsp</result>
>> </action>
>> <action name="HelloWorld" class="manning.chapterTwo.HelloWorld">
>> <result name="SUCCESS">/chapterTwo/HelloWorld.jsp</result>
>> <result name="ERROR">/chapterTwo/Error.jsp</result>
>> </action>
>> </package>
>> <!-- Add packages here -->
>>
>> </struts>
>>
>>   
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Getting-started--mapping-URLs-to-pages-tf4716347.html#a13483162
Sent from the Struts - User mailing list archive at Nabble.com.


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


Re: Getting started--mapping URLs to pages

Posted by Nuwan Chandrasoma <my...@gmail.com>.
Hi,

do you have your struts.xml file inside WEB-INF/classes folder?

Thanks,

Nuwan

Troy S wrote:
> Struts fans.
>
> I am trying to add to the struts 2.0.9 blank application.  I tried adding
> actions based on the excellent book in progress Struts2 in Action.
>
> I tried loading the URL
> http://ashanti:8080/struts2-blank-2.0.9/chapterTwo/Name.action and got the
> error
> There is no Action mapped for action name
>
> Can anyone help?
>
> Troy
>
> 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" />
>
>     <include file="example.xml"/>
> <package name="default" namespace="/" extends="strutsdefault">
>      <action name="Menu"> <result>/menu/Menu.jsp</result>
>      </action>
> </package>
> <package name="chapterTwo" namespace="/chapterTwo" extends="struts-
> default">
> <action name="Name">
> <result>/chapterTwo/NameCollector.jsp</result>
> </action>
> <action name="HelloWorld" class="manning.chapterTwo.HelloWorld">
> <result name="SUCCESS">/chapterTwo/HelloWorld.jsp</result>
> <result name="ERROR">/chapterTwo/Error.jsp</result>
> </action>
> </package>
> <!-- Add packages here -->
>
> </struts>
>
>   


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