在线免费观看亚洲,日韩国产精品亚洲а∨天堂免,亚洲男女性高爱潮网站http://www.tkk7.com/svygh123/專注javazh-cnThu, 10 Jul 2025 01:47:04 GMTThu, 10 Jul 2025 01:47:04 GMT60SpringMvc&Maven初級(jí)篇(二)用戶注冊(cè)(帶驗(yàn)證)http://www.tkk7.com/svygh123/archive/2012/06/04/379884.html一江東水一江東水Sun, 03 Jun 2012 16:12:00 GMThttp://www.tkk7.com/svygh123/archive/2012/06/04/379884.htmlhttp://www.tkk7.com/svygh123/comments/379884.htmlhttp://www.tkk7.com/svygh123/archive/2012/06/04/379884.html#Feedback5http://www.tkk7.com/svygh123/comments/commentRss/379884.htmlhttp://www.tkk7.com/svygh123/services/trackbacks/379884.html<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3....  閱讀全文

一江東水 2012-06-04 00:12 發(fā)表評(píng)論
]]>
SpringMvc&Maven初級(jí)篇(一)http://www.tkk7.com/svygh123/archive/2012/06/02/379836.html一江東水一江東水Sat, 02 Jun 2012 15:57:00 GMThttp://www.tkk7.com/svygh123/archive/2012/06/02/379836.htmlhttp://www.tkk7.com/svygh123/comments/379836.htmlhttp://www.tkk7.com/svygh123/archive/2012/06/02/379836.html#Feedback0http://www.tkk7.com/svygh123/comments/commentRss/379836.htmlhttp://www.tkk7.com/svygh123/services/trackbacks/379836.html閱讀全文

一江東水 2012-06-02 23:57 發(fā)表評(píng)論
]]>
SpringMvc初級(jí)篇(一)http://www.tkk7.com/svygh123/archive/2012/06/01/379771.html一江東水一江東水Fri, 01 Jun 2012 14:53:00 GMThttp://www.tkk7.com/svygh123/archive/2012/06/01/379771.htmlhttp://www.tkk7.com/svygh123/comments/379771.htmlhttp://www.tkk7.com/svygh123/archive/2012/06/01/379771.html#Feedback3http://www.tkk7.com/svygh123/comments/commentRss/379771.htmlhttp://www.tkk7.com/svygh123/services/trackbacks/379771.html
步驟:
1.準(zhǔn)備SpringMvc相關(guān)jar包
commons-io-1.2.jar
commons-logging-1.1.1.jar
freemarker.jar
hibernate-validator-4.0.2.GA.jar
jstl-1.2.jar
log4j-1.2.14.jar
org.springframework.context.support-3.1.0.M2.jar
servlet-2.3.jar
slf4j-api-1.5.6.jar
slf4j-log4j12-1.5.6.jar
spring-asm-3.0.3.RELEASE.jar
spring-beans-3.0.3.RELEASE.jar
spring-context-3.0.3.RELEASE.jar
spring-core-3.0.3.RELEASE.jar
spring-expression-3.0.3.RELEASE.jar
spring-web-3.0.3.RELEASE.jar
spring-webmvc-3.0.3.RELEASE.jar
validation-api-1.0.0.GA.jar
commons-fileupload-1.1.1.jar

2.創(chuàng)建Dynamic Web Project項(xiàng)目,名稱為helloworld,將SpringMvc相關(guān)jar包復(fù)制到WEB-INF/lib文件夾下

3.配置SpringMvc相關(guān)文件

①web.xml:


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


②在WEB-INF文件夾下新建dispatcher-servlet.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"
xsi:schemaLocation
="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd
"
>

<!-- 搜索的控制類路徑(C) -->
<context:component-scan base-package="com.myapps.controllers" />

<!-- 配置視圖路徑(V) -->
<bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="prefix" value="/WEB-INF/views/"/>
<property name="suffix" value=".jsp"/>
</bean>
</beans>


③新建包:com.myapps.controllers

④在上面的包內(nèi)新建類:HelloWorldController.java


package com.myapps.controllers;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

@Controller
public class HelloWorldController {

@RequestMapping(value="/helloworld")
public ModelAndView helloWord() {
return new ModelAndView("helloworldPage", "name", "hdh");
}

}




⑤在WEB-INF文件夾下新建views文件夾,在views文件夾內(nèi)新建helloworldPage.jsp


<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding
="UTF-8"
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>helloworldPage.jsp</title>
</head>
<body>
Hello,world.Welcome ${name} here.
</body>
</html>


⑥接著在WebContent下新建index.htm(注意后綴是htm,因?yàn)槿绻莌tml的話,會(huì)和web.xml的<url-pattern>*.html</url-pattern>攔截的后綴名沖突,當(dāng)然也可以新建index.jsp文件)


<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>index.htm</title>
</head>
<body>
<a href="helloworld.html">hello,world(htm)</a>
</body>
</html>


⑦最后,部署項(xiàng)目,然后啟動(dòng)tomcat服務(wù)器,輸入http://localhost:8080/helloworld/index.htm ,點(diǎn)擊鏈接進(jìn)行測(cè)試。這樣簡(jiǎn)單的Hello,world入門就完成了。

如果需要jar包,請(qǐng)發(fā)郵件到:357228560@qq.com 索取



一江東水 2012-06-01 22:53 發(fā)表評(píng)論
]]>
SpringMvc初級(jí)篇http://www.tkk7.com/svygh123/articles/379770.html一江東水一江東水Fri, 01 Jun 2012 14:28:00 GMThttp://www.tkk7.com/svygh123/articles/379770.htmlhttp://www.tkk7.com/svygh123/comments/379770.htmlhttp://www.tkk7.com/svygh123/articles/379770.html#Feedback0http://www.tkk7.com/svygh123/comments/commentRss/379770.htmlhttp://www.tkk7.com/svygh123/services/trackbacks/379770.html
步驟:
1.準(zhǔn)備SpringMvc相關(guān)jar包
commons-io-1.2.jar
commons-logging-1.1.1.jar
freemarker.jar
hibernate-validator-4.0.2.GA.jar
jstl-1.2.jar
log4j-1.2.14.jar
org.springframework.context.support-3.1.0.M2.jar
servlet-2.3.jar
slf4j-api-1.5.6.jar
slf4j-log4j12-1.5.6.jar
spring-asm-3.0.3.RELEASE.jar
spring-beans-3.0.3.RELEASE.jar
spring-context-3.0.3.RELEASE.jar
spring-core-3.0.3.RELEASE.jar
spring-expression-3.0.3.RELEASE.jar
spring-web-3.0.3.RELEASE.jar
spring-webmvc-3.0.3.RELEASE.jar
validation-api-1.0.0.GA.jar
commons-fileupload-1.1.1.jar
2.創(chuàng)建Dynamic Web Project項(xiàng)目,名稱為helloworld,將SpringMvc相關(guān)jar包復(fù)制到WEB-INF/lib文件夾下
3.配置SpringMvc相關(guān)文件
①web.xml:

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

②在WEB-INF文件夾下新建dispatcher-servlet.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"
 xsi:schemaLocation
="
 http://www.springframework.org/schema/beans
 http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
 http://www.springframework.org/schema/context
 http://www.springframework.org/schema/context/spring-context-3.0.xsd
 http://www.springframework.org/schema/mvc
 http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd
 "
>
 
 
<!-- 搜索的控制類路徑(C) -->
 
<context:component-scan base-package="com.myapps.controllers" />
 
 
<!-- 配置視圖路徑(V) -->
 
<bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver">
  
<property name="prefix" value="/WEB-INF/views/"/>    
        
<property name="suffix" value=".jsp"/>
 
</bean>
</beans>

 

③新建包:com.myapps.controllers
④在上面的包內(nèi)新建類:HelloWorldController.java

package com.myapps.controllers;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

@Controller
public class HelloWorldController {

 @RequestMapping(value
="/helloworld")
 
public ModelAndView helloWord() {
  
return new ModelAndView("helloworldPage""name""hdh");
 }

}



⑤在WEB-INF文件夾下新建views文件夾,在views文件夾內(nèi)新建helloworldPage.jsp

<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding
="UTF-8"
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>helloworldPage.jsp</title>
</head>
<body>
 Hello,world.Welcome ${name} here.
</body>
</html>


⑥接著在WebContent下新建index.htm(注意后綴是htm,因?yàn)槿绻莌tml的話,會(huì)和web.xml的<url-pattern>*.html</url-pattern>攔截的后綴名沖突,當(dāng)然也可以新建index.jsp文件)

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>index.htm</title>
</head>
<body>
 
<href="helloworld.html">hello,world(htm)</a>
</body>
</html>


⑦最后,部署項(xiàng)目,然后啟動(dòng)tomcat服務(wù)器,輸入http://localhost:8080/helloworld/index.htm ,點(diǎn)擊鏈接進(jìn)行測(cè)試。這樣簡(jiǎn)單的Hello,world入門就完成了。
如果需要jar包,請(qǐng)發(fā)郵件到:357228560@qq.com 索取




一江東水 2012-06-01 22:28 發(fā)表評(píng)論
]]>
主站蜘蛛池模板: 亚洲成AV人影片在线观看| 亚洲制服丝袜一区二区三区| 亚洲人成色777777老人头| 91黑丝国产线观看免费| 久久狠狠高潮亚洲精品| 久久久精品2019免费观看| 亚洲永久永久永久永久永久精品| 免费a级毛片无码a∨免费软件 | 久久精品免费一区二区三区| 国产精品亚洲mnbav网站| 成人免费ā片在线观看| 国产精品亚洲аv无码播放| 精品国产麻豆免费人成网站| 亚洲av激情无码专区在线播放| 精品无码无人网站免费视频| 亚洲午夜精品国产电影在线观看| 永久免费毛片在线播放| 亚洲精品av无码喷奶水糖心| 国产一区视频在线免费观看| 国产精品免费αv视频| 亚洲电影一区二区三区| 亚洲一区二区免费视频| 亚洲午夜精品一区二区麻豆| 国产免费人视频在线观看免费| 一个人看的www免费在线视频| 亚洲精品蜜桃久久久久久| 久视频精品免费观看99| 亚洲乱码在线观看| 亚洲人成国产精品无码| 两个人看的www免费高清| 亚洲高清无在码在线电影不卡| 中文字幕无码不卡免费视频| 国产亚洲精品美女久久久久| 精品亚洲一区二区| 麻豆精品国产免费观看| 精品人妻系列无码人妻免费视频 | 免费国产成人高清在线观看麻豆| 久久www免费人成看国产片| 亚洲人成电影亚洲人成9999网| 免费无码一区二区三区蜜桃大| a级毛片免费全部播放无码|