action-mappings, action not working
Hi I am using : Redhat 9 Apache 2.0.48 Tomcat 4.1.29 Struts 1.1 For some reason I am not getting any errors and control is not getting forwarded to respective success forward from DummyAction. Any help is appreciated. Regards Ajay Kalidindi config and source follows: struts-config.xml entry: action-mappings action path=/Menutype=com.kalidindis.home.DummyAction forward name=success path=/common/menu.jsp/ /action /action-mappings DummyAction.java : package com.kalidindis.home; import java.io.IOException; import javax.servlet.RequestDispatcher; import javax.servlet.*; import org.apache.struts.action.*; import org.apache.struts.util.*; /** * Implementation of strongAction/strong that lists contacts of Ajay Kalidindi. */ public final class DummyAction extends Action { public ActionForward perform(ActionServlet servlet, ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { return (mapping.findForward(success)); } }
Re: action-mappings, action not working
Try to debug it using System.out.println (SAMPLE TEXT ); in your action class public ActionForward perform(ActionServlet servlet, ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { System.out.println (SAMPLE TEXT ); return (mapping.findForward(success)); } and check the output at tomcat after restarting it... this will ensure that your class file is called. if this goes ok then some problem is there in your index.jsp cheers Raman Garg - Original Message - From: Ajay Kalidindi [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, November 13, 2003 4:53 PM Subject: action-mappings, action not working Hi I am using : Redhat 9 Apache 2.0.48 Tomcat 4.1.29 Struts 1.1 For some reason I am not getting any errors and control is not getting forwarded to respective success forward from DummyAction. Any help is appreciated. Regards Ajay Kalidindi config and source follows: struts-config.xml entry: action-mappings action path=/Menutype=com.kalidindis.home.DummyAction forward name=success path=/common/menu.jsp/ /action /action-mappings DummyAction.java : package com.kalidindis.home; import java.io.IOException; import javax.servlet.RequestDispatcher; import javax.servlet.*; import org.apache.struts.action.*; import org.apache.struts.util.*; /** * Implementation of strongAction/strong that lists contacts of Ajay Kalidindi. */ public final class DummyAction extends Action { public ActionForward perform(ActionServlet servlet, ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { return (mapping.findForward(success)); } } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: action-mappings, action not working
Hi, the methode signature is wrong. You have to override the methode public ActionForward perform(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { There is no method public ActionForward perform(ActionServlet servlet, ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { in the Action class. Since Struts 1.1 the perform method is deprecated, so you better use the execute method. public ActionForward execute(ActionMapping mapping, ActionForm form, ServletRequest request, ServletResponse response) throws Exception { HTH, Phil - Original Message - From: Ajay Kalidindi [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, November 13, 2003 12:23 PM Subject: action-mappings, action not working Hi I am using : Redhat 9 Apache 2.0.48 Tomcat 4.1.29 Struts 1.1 For some reason I am not getting any errors and control is not getting forwarded to respective success forward from DummyAction. Any help is appreciated. Regards Ajay Kalidindi config and source follows: struts-config.xml entry: action-mappings action path=/Menutype=com.kalidindis.home.DummyAction forward name=success path=/common/menu.jsp/ /action /action-mappings DummyAction.java : package com.kalidindis.home; import java.io.IOException; import javax.servlet.RequestDispatcher; import javax.servlet.*; import org.apache.struts.action.*; import org.apache.struts.util.*; /** * Implementation of strongAction/strong that lists contacts of Ajay Kalidindi. */ public final class DummyAction extends Action { public ActionForward perform(ActionServlet servlet, ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { return (mapping.findForward(success)); } } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]