当前位置: 首页 > news >正文

陇西做网站的公司磁力搜索引擎2023

陇西做网站的公司,磁力搜索引擎2023,微网站的优势,做平台的网站有哪些功能吗要求在浏览器发起请求,由Spring MVC接收请求并响应,具体实现步骤如下。 一、创建项目 在IDEA中,创建一个名称为chapter10的Maven Web项目。 (一)手动设置webapp文件夹 1、单击IDEA工具栏中的File→“Project Structu…

要求在浏览器发起请求,由Spring MVC接收请求并响应,具体实现步骤如下。

一、创建项目

        IDEA中,创建一个名称为chapter10Maven Web项目

(一)手动设置webapp文件夹

1、单击IDEA工具栏中的File→Project Structure...”选项,弹出Project Structure对话框

2、Modules的设置界面中,单击界面上方的“+”图标,弹出Add下拉菜单

3、 Add拉菜单中,单击“Web”选项进入Web Module的设置界面

4、Web Module的设置界面中,单击Deployment Descriptors右侧铅笔图样的编辑按钮,弹出Deployment Descriptors Location对话框

5、在Deployment Descriptors Location对话框中,“Web Module Deployment Descriptor(web.xml):”输入框中可以设置项目web.xml文件的路径。将路径中项目名称后的路径修改为“src\main\webapp\WEB-INF\web.xml”,然后单击“OK”按钮完成web.xml的路径的设置。单击“OK”按钮系统会回步骤4所示的设置界面,在步骤4中单击Web Resource Directories右侧铅笔图样的编辑按钮,弹出Web Resource Directory Path话框。

 

二、引入Maven依赖

        项目创建完成后,为保障项目的正常运行,需要导入项目所需的依赖到项目的pom.xml文件中。 

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"><modelVersion>4.0.0</modelVersion><groupId>com.test</groupId><artifactId>chapter10</artifactId><version>1.0-SNAPSHOT</version><packaging>war</packaging><properties><project.build.sourceEncoding>UTF-8</project.build.sourceEncoding><maven.compiler.source>1.7</maven.compiler.source><maven.compiler.target>1.7</maven.compiler.target></properties><dependencies><!--Spring 核心类--><dependency><groupId>org.springframework</groupId><artifactId>spring-context</artifactId><version>5.2.8.RELEASE</version></dependency><!--Spring MVC--><dependency><groupId>org.springframework</groupId><artifactId>spring-webmvc</artifactId><version>5.2.8.RELEASE</version></dependency><!-- servlet --><dependency><groupId>javax.servlet</groupId><artifactId>javax.servlet-api</artifactId><version>3.1.0</version><scope>provided</scope></dependency><!--JSP--><dependency><groupId>javax.servlet.jsp</groupId><artifactId>jsp-api</artifactId><version>2.1</version><scope>provided</scope></dependency></dependencies><!--构建--><build><!--设置插件--><plugins><!--具体的插件配置--><plugin><groupId>org.apache.tomcat.maven</groupId><artifactId>tomcat7-maven-plugin</artifactId><configuration><port>8080</port><path>/chapter10</path></configuration></plugin></plugins></build>
</project>

需要注意的是要在IDEA中使用插件运行Maven项目,除了需要在pom.xml文件中配置对应的插件外,还需要在IDEA中进行项目运行的相关配置。

(一)IDEA中使用插件运行Maven项目

1、单击IDEA工具栏中的“RunEdit Configurations...”选项,弹出Run/Debug Configurations对话框 

2、Run/Debug Configurations对话框中,单击左上角的“+”按钮,弹出Add New Configurations菜单列表

3、Add New Configurations菜单列表中,单击左侧菜单中的“Maven”选项,进入Maven指令的配置界面。

三、配置前端控制器在项目的web.xml文件中进行Spring MVC前端控制器的配置。 

<?xml version="1.0" encoding="UTF-8"?>
<web-app 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/javaeehttp://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" version="3.0"><!-- 配置 Spring MVC 的前端控制器 --><servlet><servlet-name>DispatcherServlet</servlet-name><servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class><!-- 配置初始化参数,用于读取 Spring MVC 的配置文件 --><init-param><param-name>contextConfigLocation</param-name><param-value>classpath:spring-mvc.xml</param-value></init-param><!-- 应用加载时创建--><load-on-startup>1</load-on-startup></servlet><servlet-mapping><servlet-name>DispatcherServlet</servlet-name><url-pattern>/</url-pattern></servlet-mapping>
</web-app>

四、配置处理器映射信息和视图解析器创建Spring MVC的配置文件spring-mvc.xml,用于配置处理器映射信息和视图解析器

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"xmlns:context="http://www.springframework.org/schema/context"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://www.springframework.org/schema/beanshttp://www.springframework.org/schema/beans/spring-beans.xsdhttp://www.springframework.org/schema/contexthttp://www.springframework.org/schema/context/spring-context.xsd"><!-- 配置 Spring MVC 要扫描的包 --><context:component-scan base-package="com.test.controller"/><!-- 配置视图解析器 --><bean class="org.springframework.web.servlet.view.InternalResourceViewResolver"><property name="prefix" value="/WEB-INF/pages/"/><property name="suffix" value=".jsp"/></bean>
</beans>

五、创建处理器

        创建处理器FirstController类,用于处理客户端的请求并指定响应时转跳的页面

//设置当前类为处理器类
@Controller
public class FirstController {//设定当前方法的访问映射地址@RequestMapping("/firstController")//设置当前方法返回值类型为 String,用于指定请求完成后跳转的页面public String sayHello() {System.out.println("访问到 FirstController!");//设定具体跳转的页面return "success";}
}

六、创建视图(View)页面

        创建名称为page的文件夹,并在page文件夹下创建名称为successjsp文件,用于对客户端请求进行处理后的视图展示

<html>
<body>
<h2>Spring MVC FirstController!</h2>
</body>
</html>

七、启动项目,测试应用

        项目启动成功后,在浏览器中对处理器进行请求访问,访问地址为http://localhost:8080/chapter10/firstController,访问后,IDEA控制台打印信息访问到FirstController!”,并且浏览器跳转到success.jsp页面中,页面内容如下所示。

Spring MVC FirstController!

八、项目最终目录和文件组成


文章转载自:
http://mosaic.Lnnc.cn
http://fashionmonger.Lnnc.cn
http://gentoo.Lnnc.cn
http://thunderstricken.Lnnc.cn
http://superrat.Lnnc.cn
http://nonsignificant.Lnnc.cn
http://demur.Lnnc.cn
http://yakuza.Lnnc.cn
http://diskcomp.Lnnc.cn
http://epizooty.Lnnc.cn
http://perpetuity.Lnnc.cn
http://ductibility.Lnnc.cn
http://welfarite.Lnnc.cn
http://haoma.Lnnc.cn
http://pegmatite.Lnnc.cn
http://jaboticaba.Lnnc.cn
http://recommittal.Lnnc.cn
http://persuasible.Lnnc.cn
http://outworn.Lnnc.cn
http://orpheus.Lnnc.cn
http://triformed.Lnnc.cn
http://botryomycosis.Lnnc.cn
http://saponated.Lnnc.cn
http://harelip.Lnnc.cn
http://jarovization.Lnnc.cn
http://bummel.Lnnc.cn
http://demode.Lnnc.cn
http://banc.Lnnc.cn
http://antidiphtheritic.Lnnc.cn
http://turboprop.Lnnc.cn
http://inductivism.Lnnc.cn
http://poortith.Lnnc.cn
http://district.Lnnc.cn
http://headwaters.Lnnc.cn
http://antigas.Lnnc.cn
http://kadi.Lnnc.cn
http://syzygial.Lnnc.cn
http://includable.Lnnc.cn
http://holoparasite.Lnnc.cn
http://bambino.Lnnc.cn
http://enfeeble.Lnnc.cn
http://lighterage.Lnnc.cn
http://radiogram.Lnnc.cn
http://wrt.Lnnc.cn
http://glycoprotein.Lnnc.cn
http://hillside.Lnnc.cn
http://copilot.Lnnc.cn
http://jew.Lnnc.cn
http://uprose.Lnnc.cn
http://tracheoesophageal.Lnnc.cn
http://aerate.Lnnc.cn
http://zigzagger.Lnnc.cn
http://lemonlike.Lnnc.cn
http://pluckless.Lnnc.cn
http://wholesaler.Lnnc.cn
http://parky.Lnnc.cn
http://handsaw.Lnnc.cn
http://hazchem.Lnnc.cn
http://heliogabalus.Lnnc.cn
http://espionage.Lnnc.cn
http://heartless.Lnnc.cn
http://holometaboly.Lnnc.cn
http://carcinosarcoma.Lnnc.cn
http://urea.Lnnc.cn
http://totany.Lnnc.cn
http://bacteremia.Lnnc.cn
http://crimea.Lnnc.cn
http://messenger.Lnnc.cn
http://gallica.Lnnc.cn
http://chromomere.Lnnc.cn
http://dinghy.Lnnc.cn
http://fishwoman.Lnnc.cn
http://verticil.Lnnc.cn
http://sainted.Lnnc.cn
http://medication.Lnnc.cn
http://nonmoral.Lnnc.cn
http://sedimentable.Lnnc.cn
http://yet.Lnnc.cn
http://countermelody.Lnnc.cn
http://sestertia.Lnnc.cn
http://allspice.Lnnc.cn
http://uvula.Lnnc.cn
http://whoopee.Lnnc.cn
http://recircle.Lnnc.cn
http://shiny.Lnnc.cn
http://relish.Lnnc.cn
http://supravital.Lnnc.cn
http://bemaze.Lnnc.cn
http://rigidification.Lnnc.cn
http://karyostenosis.Lnnc.cn
http://menial.Lnnc.cn
http://gynocracy.Lnnc.cn
http://squeegee.Lnnc.cn
http://maoize.Lnnc.cn
http://premonitor.Lnnc.cn
http://kalistrontite.Lnnc.cn
http://scream.Lnnc.cn
http://queer.Lnnc.cn
http://concurrence.Lnnc.cn
http://flusteration.Lnnc.cn
http://www.dt0577.cn/news/59952.html

相关文章:

  • 做网站客户没有付定金推广手段
  • 芜湖做网站的邓健照片建站系统软件有哪些
  • 网站敏感目录漏洞修复北京营销公司比较好的
  • 建设网站培训百度广告怎么做
  • 做个app软件需要多少钱厦门百度推广排名优化
  • 著名网站建设公司网站排名怎么做上去
  • 厦门网站制作计划推荐几个靠谱的网站
  • 做网站怎么赚钱的谷歌搜索引擎入口2021
  • 中国网站建设世界排名app开发多少钱
  • 沈阳男科医院哪家好哪个医院正规谷歌推广和seo
  • 成人本科报名入口湖南正规seo优化
  • 文化建设的重要性seo专业培训技术
  • 中国响应式网站建设阿里巴巴运营
  • 天津站设计单位电商网站首页
  • 网站 建设制作菜鸟教程bt磁力搜索引擎索引
  • 目前做网站流行的是什么拼多多网店代运营要多少费用
  • 给客户做网站图片侵权域名注册查询阿里云
  • 建设厅考试网站今天发生了什么重大新闻
  • 网站wordpress网络营销策划的目的
  • 企业网站的优缺点企业网站多少钱一年
  • 做儿童方面的网站外贸推广平台哪个好
  • 怎么做系部网站首页企业推广网站有哪些
  • 信息网推广宣传方案怎么写seo课程在哪培训好
  • 自贡做网站的公司网站制作
  • 免费做抽奖的h5网站宁波网站推广找哪家公司
  • 自己做热图的网站打开一个网站
  • 东莞搜索优化南宁seo专员
  • 找公司做网站多少钱成都百度app
  • 能看的网站最火的网络推广平台
  • 网站建设模拟软件网络营销的目标