當前位置:
首頁 >
前端技术
> javascript
>内容正文
javascript
JAVAWEB 一一 SpringMVC(注解)
生活随笔
收集整理的這篇文章主要介紹了
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
?
轉載于:https://www.cnblogs.com/PoeticalJustice/p/7828421.html
總結
以上是生活随笔為你收集整理的JAVAWEB 一一 SpringMVC(注解)的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: try....exception....
- 下一篇: pdf转换成可在线浏览的电子杂志zmak