[Logo] Mentawai Forum - Mentawai Web Framework
  [Search] Search   [Recent Topics] Recent Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
Could not find action for actionName  XML
Forum Index -> Comentários Gerais
Author Message
Anonymous



Code:
 javax.servlet.ServletException: Could not find action for actionName: preeespelho
 	org.mentawai.core.Controller.service(Controller.java:266)
 	javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
 	org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
 


Não existe força nesse mundo que faz meu controller achar o meu action.

Alguem me ajuda ..... Ja chequei 5 mil vezes minhas classes e ele não acha nem sobre tortura.
saoj



Joined: 01/07/2005 09:59:17
Messages: 2846
Location: Rio de Janeiro, RJ
Offline

Posta aqui o seu web.xml e o seu ApplicationManager.java

Sergio Oliveira

Anonymous



Code:
 <?xml version="1.0" encoding="ISO-8859-1"?>
 
 <!DOCTYPE web-app
     PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
     "http://java.sun.com/dtd/web-app_2_3.dtd">
 
 <web-app>
 	<display-name>Nome</display-name>
 
 	<servlet>
 		<servlet-name>Controller</servlet-name>
 		<servlet-class>org.mentawai.core.Controller</servlet-class>
 		<init-param>
 			<param-name>applicationManager</param-name>
 			<param-value>br.com.telenews.control.ApplicationManager</param-value>
 		</init-param>
 		<load-on-startup>1</load-on-startup>
 	</servlet>
 
 	<servlet-mapping>
 		<servlet-name>Controller</servlet-name>
 		<url-pattern>*.mtw</url-pattern>
 	</servlet-mapping>
 </web-app>


Code:
 public class ApplicationManager extends ApplicationManager {
 
 	
 	public void init(Context application) {
 		// Injeta no objeto de DAO generico o DAO do Hibernate
 		ioc("gdao", HibernateGenericDAO.class, REQUEST);
 		ioc("espelhodao", DAOEspelho.class, REQUEST);
 	}
 
 	
 	public void loadActions() {
 		// Filtro global que controla as transações Hibernate
 		filter(new HibernateTransactionFilter());
 		
 		// Filtro global de Inversão de Controle
         filter(new IoCFilter());
         
         // Filtro global que injeta valores direto na action
         filter(new InjectionFilter());
 		
         //Essa action trata a ação preespelho.exibe
        
         ActionConfig ac = new ActionConfig("/preespelho",PreEspelhoAction.class);
         ac.addConsequence(SUCCESS, new Forward("/preespelho.jsp"));
         ac.addConsequence(ERROR, new Forward("/error.jsp"));
         addActionConfig(ac);
         
 	}
 
 
 	public void loadLocales() {
 		LocaleManager.add(new Locale("pt", "BR"));
 	}
 }
 


A classe PreEspelhoAction e o link na hora que chamo a ação fica http://localhost:8080/Aplicacao/preeespelho.mtw. Eu não entendo porque o controller fala que não existe action para o preeespelho.

Vlw
Anonymous



A classe PreEspelhoAction e o link na hora que chamo a ação fica http://localhost:8080/Aplicacao/preeespelho.mtw. Eu não entendo porque o controller fala que não existe action para o preeespelho.  


*A classe PreEspelhoAction existe e o link que chama a ação fica assim http://localhost:8080/Aplicacao/preeespelho.mtw. Eu não entendo porque o controller fala que não existe action para a ação preeespelho.
Anonymous



Já achei o erro.

Ontem eu estava muito cansado e com dor de cabeça, ai hoje foi só sentar na cadeira que vi o grande vascilo.

Vlw ... brigado!
logicalusman



Joined: 11/02/2010 06:19:51
Messages: 5
Offline

I have got the same problem ..

// my ApplicationManager is residing at the package root (no package)
// loadActions
public void loadActions()
{
System.out.println("ApplicationManager.loadActions:: Mapping actions");
setDebugMode(true);
ActionConfig ac = new ActionConfig("/feeds", FeedModule.class,"getFeed");
addActionConfig(ac);

System.out.println("ApplicationManager.loadActions():: Finished");

}

// FeedModule
public class FeedModule extends BaseAction {

public String getFeed()
{
String jsonFeed = "{name: \"this is a sample feed\" }";

System.out.println("hello here");

return SUCCESS;
}

}

// web.xml
<web-app>
<servlet>
<servlet-name>Controller</servlet-name>
<servlet-class>org.mentawai.core.Controller</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>


<servlet-mapping>
<servlet-name>Controller</servlet-name>
<url-pattern>*.mtw</url-pattern>
</servlet-mapping>
</web-app>

my url is http://localhost:8080/ws/feeds.mtw

This is what i get
SEVERE: Servlet.service() for servlet Controller threw exception
javax.servlet.ServletException: Could not find action for actionName: Feeds
at org.mentawai.core.Controller.service(Controller.java:555)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

Anyone have an idea about what is getting wrong?
thanks
spinow


[Avatar]

Joined: 22/07/2008 15:39:02
Messages: 58
Offline

ActionConfig ac = new ActionConfig("feeds", FeedModule.class,"getFeed");


right?

POWERED BY PUBLICONS.DE
IceW0lf


[Avatar]

Joined: 16/03/2006 08:33:38
Messages: 1546
Location: Brasília
Offline

I beleave.... You has set this in your ApplicationManager

Code:
   ActionConfig ac = new ActionConfig("/feeds", FeedModule.class,"getFeed");
 addActionConfig(ac);
 


And you are requesting that:
http://localhost:8080/ws/feeds.mtw

I believe that is correct for your url.
http://localhost:8080/ws/feeds.getFeed.mtw

When you requesting....
http://localhost:8080/ws/feeds.mtw

by default the method will be required execute and you not have this setting...


Leiber Wallace
Voixy ::: Soluções em Telecomunicações
 
Forum Index -> Comentários Gerais
Go to:   
Powered by JForum 2.1.6 © JForum Team