一个web从无到有的过程.pdfVIP

  • 4
  • 0
  • 约2.43万字
  • 约 30页
  • 2018-06-07 发布于浙江
  • 举报
一个web从无到有的过程

一个web从无到有的过程 一、Spring的配置 1 )创建一个maven项目 2 )继续 :next 3 )选择maven archetype_webapp 4 )填写GroupID ,Artifact ID和Package (可默认 ) 5 )添加source文件夹 ,因为是maven的规定 ,必须按照规范来创建 6 )配置BuildPath 7 )将项目转成webproj ect ,在项目上右键Properties ,在左侧选择 Proj ect Facets,单击右侧的 ”Convert faceted from “ 修改Java为你当前项目的JDK ,并添加Dynamic Web Module ,最后单击”Further Configuration available “ 链接 修改Content directory 为 src/ main/webapp ,单击OK 设置完Content directory ,ok后再次点击前一界面ok ,完成转换成Dynamic Web Proj ect项目 8 )设置部署程序集 设置将Maven的j ar包发布到lib下 ,Add Java Build Path Entries Maven Dependencies Finish 9 )运行 二、体验Spring的开始 1 )按照 maven介绍 创建一个spring web程序 ,编辑pom.xml文件(增加内容即为Spring的配置) proj ect xmlns=http:// ma / POM/4.0.0 xmlns:xsi=/2001/XMLSchema- instance xsi:schemaLocation=http:// ma / POM/4.0.0 http:// ma /xsd/ ma en-4.0.0.xsd modelVersion4.0.0/ modelVersion groupIdcom.shiyanlou.demo/groupId artifactIdspring3-Example/artifactId ersion0.0.1-SNAPSHOT / ersion packagingj ar/ packaging namespring3-Example/ name urlhttp:// ma / url properties proj ect.build.sourceEncodingUTF-8/ proj ect.build.sourceEncoding / properties dependencies dependency groupIdj unit /groupId artifactIdj unit /artifactId ersion3.8.1/ ersion scopetest /scope /dependency !-- Spring3配置 -- dependency groupIdorg.springframework/groupId artifactIdspring-core/artifactId ersion4.0.9.RELEASE/ ersion /dependency dependency groupIdorg.springframework/groupId artifactIdspring-context /artifactId ersion4.0.9.RELEASE/ ersion /dependency /dependencies / proj ect 2))然然后后再再创创建建一一个个Spring bean: 首先创建一个包,包名为com.shiyanlou.demo.helloworld: 3))再再在在该该包包内内创创建建一一个个类类,,类类名名为为HelloWorld: 并将HelloWorld.j a a编辑如下: package com.shiyanlou.demo.helloworld; publicclassHelloWorld{ pri ate Strin

文档评论(0)

1亿VIP精品文档

相关文档