Solved

Problem mapping an Action to a namespace

Posted on 2010-08-12
4
1,241 Views
Last Modified: 2013-11-24
I am trying to get an action in a Struts 2 app to work but I am coming up with this error in my console.  Is there any known fix for this?

There is no Action mapped for namespace /jsp/myApp/screenscrape and action name runEarningsAlerts. - [unknown location]
0
Comment
Question by:jwright9
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 4

Expert Comment

by:ProgSysAdmin
ID: 33422319
Check your struts-config.xml file to see that you have something similar to this:

<struts-config>
      <form-beans>
            <form-bean name="searchForm"
                           type="org.SearchForm"/>
      </form-beans>
      <action-mappings>
            <action path="/Search"
                        name="searchForm"
                        type="org.SearchAction" >
                  <forward name="Status" path="/status.jsp"/>
                  <forward name="NotFound" path="/login.jsp"/>
            </action>
      </action-mappings>
</struts-config>

Where type="org.SearchAction" defines your action class
0
 

Author Comment

by:jwright9
ID: 33422433
ProgSysAdmin, Thanks for your response but I am using the struts 2  struts.xml format for my configuration.
0
 
LVL 4

Accepted Solution

by:
ProgSysAdmin earned 500 total points
ID: 33423058
I'm sorry.  Here is a snippet of Struts 2 struts.xml code that I found which I modified to fit what you are doing.  The main thing in correcting your error "[unknown location]" is in the class="" section of your file needs to be a valid java class.  I hope this helps.


<?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="earningsAlerts" namespace="/jsp/myApp/screenscrape" extends="struts-default">

<action name="runEarningsAlerts" class="jsp.myApp.screenscrape.EarningsAlerts">
<result>/jsp/myApp/screenscrape/EarningsAlerts.jsp</result>
</action>
</package>

</struts>

Open in new window

0
 

Author Comment

by:jwright9
ID: 33423601
I tried your code but I got the same result.  I know yours should work.  So I'll accept yours.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
A solution for Fortify Path Manipulation.
The viewer will learn how to implement Singleton Design Pattern in Java.
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

615 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question