zoukankan      html  css  js  c++  java
  • Spring mvc补充

    1.MultiActionActionContrller

    package Controller;
    import org.springframework.web.servlet.ModelAndView;
    import org.springframework.web.servlet.mvc.multiaction.MultiActionController;

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

    /**
    * Created by Administrator on 2017/8/16.
    */
    public class MyMultionController extends MultiActionController{
    注意修饰符是public
    public ModelAndView insert(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) throws Exception {
    ModelAndView mv=new ModelAndView();
    mv.setViewName("insert");
    return mv;
    }

    public ModelAndView delete(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) throws Exception {
    ModelAndView mv=new ModelAndView();
    mv.setViewName("delete");
    return mv;
    }



    }


    <!--处理器映射器-->
    <bean class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
    <property name="urlMap">
    <map>
    <entry key="/*.do" value="multionController"></entry>
    </map>
    </property>
    </bean>

    <!--视图解析器-->
    <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
    <property name="prefix" value="/WEB-INF/"></property>
    <property name="suffix" value=".jsp"></property>
    </bean>

    <bean id="multionController" class="Controller.MyMultionController"/>
    </beans>
  • 相关阅读:
    UVa 107 The Cat in the Hat
    UVa 591 Box of Bricks
    UVa 253 Cube painting
    UVa 10161 Ant on a Chessboard
    UVa 401 Palindromes
    UVa 465 Overflow
    我不知道
    消防局的设立
    某CF的D
    保安站岗
  • 原文地址:https://www.cnblogs.com/hualishu/p/7381474.html
Copyright © 2011-2022 走看看