Solved

Problem mapping an Action to a namespace

Posted on 2010-08-12
4
1,208 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
I tried your code but I got the same result.  I know yours should work.  So I'll accept yours.
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
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.

744 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now