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>
  • 相关阅读:
    hdu1003 Max sum
    Java Programming Tutorial Programming Graphical User Interface (GUI)
    Java中int和String互相转换的多种方法
    Google搜索技巧总结
    HTML 教程延伸阅读:改变文本的外观和含义
    JAR 文件揭密
    sparql 学习,理解sparql
    sparql查询语言学习摘要
    经典算法总结
    杨辉三角
  • 原文地址:https://www.cnblogs.com/hualishu/p/7381474.html
Copyright © 2011-2022 走看看