zoukankan      html  css  js  c++  java
  • JAVAWEB 一一 SpringMVC(注解)

    web.xml

    <?xml version="1.0" encoding="UTF-8"?>
    <web-app version="2.5" 
    	xmlns="http://java.sun.com/xml/ns/javaee" 
    	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    	xsi:schemaLocation="http://java.sun.com/xml/ns/javaee 
    	http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
      <display-name></display-name>	
      <welcome-file-list>
        <welcome-file>index.jsp</welcome-file>
      </welcome-file-list>
        <servlet>
      	<servlet-name>springmvc</servlet-name>
      	<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
      	<load-on-startup>1</load-on-startup>
      </servlet>
      <servlet-mapping>
      	<servlet-name>springmvc</servlet-name>
      	<url-pattern>*.do</url-pattern>
      </servlet-mapping>
    </web-app>
    

      

    springmvc-servler.xml

    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://www.springframework.org/schema/beans"  
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xmlns:p="http://www.springframework.org/schema/p" 
        xmlns:context="http://www.springframework.org/schema/context" 
        xmlns:mvc="http://www.springframework.org/schema/mvc" 
        xmlns:task="http://www.springframework.org/schema/task"
        xsi:schemaLocation="
            http://www.springframework.org/schema/beans 
            http://www.springframework.org/schema/beans/spring-beans-4.2.xsd 
            http://www.springframework.org/schema/context 
            http://www.springframework.org/schema/context/spring-context-4.2.xsd 
            http://www.springframework.org/schema/mvc 
            http://www.springframework.org/schema/mvc/spring-mvc-4.2.xsd 
            http://www.springframework.org/schema/task 
            http://www.springframework.org/schema/task/spring-task-4.2.xsd">
     	<context:component-scan base-package="com.annotation.*"/>
        <!-- 视图解析器-->
        <!--  /WEB-INF/jsp/success.jsp -->
        <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
            <property name="prefix" value="/jsp/"/>
            <property name="suffix" value=".jsp"/>
        </bean>
    </beans>
    

      

    Controller

    service

    dao

  • 相关阅读:
    1088
    1082 read number in chinese
    1079 total sales of supply chain
    1075 pat judge
    1074 reverse list
    1071 speech pattern
    ts 之 多种泛型的处理方式
    玩一下node中的child_process
    玩转 js 位运算
    记录一下尝试的class和function分别作为构造函数方法
  • 原文地址:https://www.cnblogs.com/PoeticalJustice/p/7828421.html
Copyright © 2011-2022 走看看