Announcement Announcement Module
Collapse
No announcement yet.
trigger hello.htm?cmd=test issue Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • trigger hello.htm?cmd=test issue

    1. in web.xml
    <servlet>
    <servlet-name>springapp</servlet-name>
    <servlet-class>org.springframework.web.servlet.DispatcherSe rvlet</servlet-class>
    <init-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>/WEB-INF/springapp-servlet.xml

    </param-value>
    </init-param>
    <load-on-startup>1</load-on-startup>
    </servlet>

    <servlet-mapping>
    <servlet-name>springapp</servlet-name>
    <url-pattern>*.htm</url-pattern>
    </servlet-mapping>


    2. In springapp-servlet.xml

    <bean id="mappings" class="java.util.HashMap">
    <constructor-arg index="0">
    <map>
    <!-- entry key="/performFlow.htm" value="performFlow"></entry-->
    <entry key="/hello.htm" value="invController"></entry>
    </map>
    </constructor-arg>
    </bean>



    <bean id="invController" class="springapp.web.InventoryController">
    <property name="methodNameResolver" ref="inventoryControllerResolver" />
    </bean>

    <bean id="inventoryControllerResolver" class="org.springframework.web.servlet.mvc.multiac tion.ParameterMethodNameResolver">
    <property name="defaultMethodName" value="empty" />
    <property name="paramName" value="cmd" />
    </bean>

    </beans>


    3. In a JSP page:

    <form action="hello.htm?cmd=test" method="post">

    <input type="submit" value="Submitv" />
    </form>


    4. In InventoryController.java:


    public class InventoryController extends MultiActionController{

    protected final Log logger = LogFactory.getLog(getClass());



    public void test(HttpServletRequest request, HttpServletResponse response)
    throws ServletException, IOException {
    ...

    }


    The test method never gets triggered. Why so?


    Thanks

    Scott
Working...
X