Solved

Problem mapping an Action to a namespace

Posted on 2010-08-12
4
1,215 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 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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
wordsFront challenge 8 84
Spring Controller - inheritance in request parameter 3 50
HashMap Vs TreeMap 12 55
egit plugin on eclipse 8 33
I had a project requirement for a displaying a user workbench .This workbench would consist multiple data grids .In each grid the user will be able to see a large number of data. These data grids should allow the user to 1. Sort 2. Export the …
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…
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.

912 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

24 Experts available now in Live!

Get 1:1 Help Now