« Return to Thread: exceute() method in action class didn't called

exceute() method in action class didn't called

by jayadevan :: Rate this Message:

Reply to Author | View in Thread

hi all

I am using struts 1.1 for my accadamic project . My exceute() method in action class did n't called . but the instance of action class created

struts - config.xml

<?xml version="1.0" encoding="ISO-8859-1" ?>

<!DOCTYPE struts-config PUBLIC
          "-//Apache Software Foundation//DTD Struts Configuration 1.0//EN"
          "http://jakarta.apache.org/struts/dtds/struts-config_1_0.dtd">
<struts-config>
  <form-beans>
                <form-bean  name="HelloWorldFromBean"
                    type="examples.firstStruct.helloWorld.HelloWorldFrom"/>
        </form-beans>
        <action-mappings>
                        <action
                path="/helloWorld"
                type="examples.firstStruct.helloWorld.HelloWorldAction"
                name= ""
                scope ="request"
                >
                 <forward
                    name="xxx"
                    path="/pages/HelloWorld.jsp"/>
               
            </action>
        </action-mappings>
</struts-config>

action class

package examples.firstStruct.helloWorld;


import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

public class HelloWorldAction extends Action {
        public HelloWorldAction(){
                System.out.println("---------------inside execute -----------");
       
        }
        public ActionForward execute(ActionMapping mapping, ActionForm form,
                        HttpServletRequest request, HttpServletResponse response)
        throws Exception {
                System.out.println("---------------inside execute -----------");
                return mapping.findForward("xxx");
        }
       
}

execute never called

tomcat log

Jul 9, 2009 9:47:57 AM org.apache.catalina.core.ApplicationContext log
INFO: action: Processing a GET for /helloWorld
Jul 9, 2009 9:47:58 AM org.apache.catalina.core.ApplicationContext log
INFO: action: Setting locale 'en_US'
Jul 9, 2009 9:47:58 AM org.apache.catalina.core.ApplicationContext log
INFO: action:  Looking for ActionForm bean under attribute ''
Jul 9, 2009 9:47:58 AM org.apache.catalina.core.ApplicationContext log
INFO: action:  Looking for Action instance for class examples.firstStruct.helloWorld.HelloWorldAction
Jul 9, 2009 9:47:58 AM org.apache.catalina.core.ApplicationContext log
INFO: action:   Double checking for Action instance already there
Jul 9, 2009 9:47:58 AM org.apache.catalina.core.ApplicationContext log
INFO: action:   Creating new Action instance
---------------inside execute -----------
Jul 9, 2009 9:48:09 AM org.apache.catalina.core.ApplicationContext log
INFO: action: Processing a GET for /helloWorld
Jul 9, 2009 9:48:09 AM org.apache.catalina.core.ApplicationContext log
INFO: action:  Looking for ActionForm bean under attribute ''
Jul 9, 2009 9:48:09 AM org.apache.catalina.core.ApplicationContext log
INFO: action:  Looking for Action instance for class examples.firstStruct.helloWorld.HelloWorldAction
please help me ?

thanks in advance
jayadevan

 « Return to Thread: exceute() method in action class didn't called