Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Problem mapping an Action to a namespace

Posted on 2010-08-12
4
Medium Priority
?
1,247 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
  • 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 2000 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

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

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

Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
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.
Suggested Courses

885 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