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

外包+网站开发公司全国最大的关键词挖掘

外包+网站开发公司,全国最大的关键词挖掘,中国源码资源网,网站做点击收费标准文章目录 创建第一个SpringMVC项目,入手必看!1、新建一个maven空项目,在pom.xml中设置打包为war之前,右击项目添加web框架2、如果点击右键没有添加框架或者右击进去后没有web框架,点击左上角file然后进入项目结构在模块…

文章目录

  • 创建第一个SpringMVC项目,入手必看!
    • 1、新建一个maven空项目,在pom.xml中设置打包为war之前,右击项目添加web框架
    • 2、如果点击右键没有添加框架或者右击进去后没有web框架,点击左上角file然后进入项目结构
      • 在模块中点击加号,添加web,然后点击ok,可以看到项目结构中多出了一个web目录,将该web目录拖拽进main目录下
      • 再次进入项目结构中,会看到爆红色的地方,双击选择新的web目录路径,并在上面设置正确的web.xml文件的路径,==然后将web目录名字修改为webapp,不然等下面导入依赖后,该目录会失效==
    • 3、设置pom.xml文件的依赖,并刷新maven
    • 4、在resources目录下添加springmvc.xml配置文件
    • 5、在java目录下创建一个包并在其中创建一个controller包,编写HelloController.java文件
    • 6、在webapp目录下的WEB-INF中创建一个pages文件夹,并在其中添加一个success.jsp文件
    • 7、编写web.xml文件和index.jsp文件
    • 8、打开maven侧边功能栏,双击启动配置的tomcat运行项目,一般用run-war
      • 启动成功后可以通过ctrl+鼠标左键或者直接浏览器输入访问
      • 点击即可跳转到success.jsp页面

创建第一个SpringMVC项目,入手必看!

1、新建一个maven空项目,在pom.xml中设置打包为war之前,右击项目添加web框架

在这里插入图片描述
在这里插入图片描述

2、如果点击右键没有添加框架或者右击进去后没有web框架,点击左上角file然后进入项目结构

在这里插入图片描述

在模块中点击加号,添加web,然后点击ok,可以看到项目结构中多出了一个web目录,将该web目录拖拽进main目录下

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

再次进入项目结构中,会看到爆红色的地方,双击选择新的web目录路径,并在上面设置正确的web.xml文件的路径,然后将web目录名字修改为webapp,不然等下面导入依赖后,该目录会失效

在这里插入图片描述

3、设置pom.xml文件的依赖,并刷新maven

<packaging>war</packaging><properties><maven.compiler.source>8</maven.compiler.source><maven.compiler.target>8</maven.compiler.target><project.build.sourceEncoding>UTF-8</project.build.sourceEncoding></properties><dependencies><dependency><groupId>org.springframework</groupId><artifactId>spring-context</artifactId><version>5.1.8.RELEASE</version></dependency><dependency><groupId>org.springframework</groupId><artifactId>spring-web</artifactId><version>5.1.8.RELEASE</version></dependency><dependency><groupId>org.springframework</groupId><artifactId>spring-webmvc</artifactId><version>5.1.8.RELEASE</version></dependency><dependency><groupId>javax.servlet</groupId><artifactId>servlet-api</artifactId><version>2.5</version><scope>provided</scope></dependency><dependency><groupId>javax.servlet.jsp</groupId><artifactId>jsp-api</artifactId><version>2.0</version><scope>provided</scope></dependency></dependencies><build><plugins><!-- 配置Tomcat插件 --><plugin><groupId>org.apache.tomcat.maven</groupId><artifactId>tomcat7-maven-plugin</artifactId><version>2.2</version><configuration><!--端口号--><port>8080</port><!--项目名--><path>/</path></configuration></plugin></plugins></build>

在这里插入图片描述

4、在resources目录下添加springmvc.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.xsdhttp://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsdhttp://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd"><!--配置sping容器要扫描的包--><context:component-scan base-package="cn.fpl.controller"></context:component-scan><!--配置视图解析器:告诉springmvc框架jsp的位置--><bean class="org.springframework.web.servlet.view.InternalResourceViewResolver"><!--jsp的目录--><property name="prefix" value="/WEB-INF/pages/"></property><!--jsp的扩展名--><property name="suffix" value=".jsp"></property></bean><!--开启spingmvc注解的支持:--><mvc:annotation-driven></mvc:annotation-driven>
</beans>

5、在java目录下创建一个包并在其中创建一个controller包,编写HelloController.java文件

在这里插入图片描述

package cn.fpl.controller;import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;@Controller //标识当前类是一个controller,可接受请求
public class HelloController {@RequestMapping("/hello") //接受请求public ModelAndView hello(){//ModelAndView:作用是控制跳转的页面和送到页面的数据ModelAndView mv = new ModelAndView();//等价于:req.setAttribute("msg", "兄弟你好");mv.addObject("msg", "兄弟你好");//req.getRequestDispatcher("success.jsp").forward(req, resp);mv.setViewName("success");return mv;}
}

6、在webapp目录下的WEB-INF中创建一个pages文件夹,并在其中添加一个success.jsp文件

在这里插入图片描述

<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head><title>Title</title>
</head>
<body><%--<%=request.getAttribute("msg")%>--%>${msg}
</body>
</html>

7、编写web.xml文件和index.jsp文件

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd"version="4.0"><servlet><servlet-name>springmvc</servlet-name><!--前端控制器--><servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class><init-param><param-name>contextConfigLocation</param-name><param-value>classpath:springmvc.xml</param-value></init-param><!--tomcat启动就创建加载DispatcherServlet--><load-on-startup>1</load-on-startup></servlet><servlet-mapping><servlet-name>springmvc</servlet-name><!--/ 只能拦截路径,而 / *能够拦截路径和页面--><url-pattern>/</url-pattern></servlet-mapping>
</web-app>

index.jsp

<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html><head><title>$Title$</title></head><body><a href="/hello">hello</a></body>
</html>

8、打开maven侧边功能栏,双击启动配置的tomcat运行项目,一般用run-war

在这里插入图片描述

启动成功后可以通过ctrl+鼠标左键或者直接浏览器输入访问

在这里插入图片描述
在这里插入图片描述

点击即可跳转到success.jsp页面

在这里插入图片描述


文章转载自:
http://dinncoacquiescence.tqpr.cn
http://dinncostargazer.tqpr.cn
http://dinncosubplot.tqpr.cn
http://dinncopolygamist.tqpr.cn
http://dinncosequencer.tqpr.cn
http://dinncobadian.tqpr.cn
http://dinncocontrapose.tqpr.cn
http://dinncociliolate.tqpr.cn
http://dinncoconferree.tqpr.cn
http://dinncoontology.tqpr.cn
http://dinncopersonae.tqpr.cn
http://dinncounresponsive.tqpr.cn
http://dinncovespertilionid.tqpr.cn
http://dinncohyalograph.tqpr.cn
http://dinncorender.tqpr.cn
http://dinncocognac.tqpr.cn
http://dinncotunk.tqpr.cn
http://dinncoriveter.tqpr.cn
http://dinnconetted.tqpr.cn
http://dinncogalways.tqpr.cn
http://dinncoaprism.tqpr.cn
http://dinncotrademark.tqpr.cn
http://dinncoarchaize.tqpr.cn
http://dinncoflexual.tqpr.cn
http://dinncohundredthly.tqpr.cn
http://dinncoclotho.tqpr.cn
http://dinncograduation.tqpr.cn
http://dinncoconfidentiality.tqpr.cn
http://dinncosexennium.tqpr.cn
http://dinncomercerization.tqpr.cn
http://dinncoechoencephalography.tqpr.cn
http://dinncopatty.tqpr.cn
http://dinncoenthusiasm.tqpr.cn
http://dinncokinchinjunga.tqpr.cn
http://dinncolenis.tqpr.cn
http://dinncoextraofficial.tqpr.cn
http://dinncoellachick.tqpr.cn
http://dinncoergophile.tqpr.cn
http://dinncofuddled.tqpr.cn
http://dinncogametal.tqpr.cn
http://dinncomoth.tqpr.cn
http://dinncogenetics.tqpr.cn
http://dinncoxiphophyllous.tqpr.cn
http://dinncointegrality.tqpr.cn
http://dinncoshrew.tqpr.cn
http://dinncoswabia.tqpr.cn
http://dinncocytotoxin.tqpr.cn
http://dinncoanticholinesterase.tqpr.cn
http://dinncoarillus.tqpr.cn
http://dinncovishnu.tqpr.cn
http://dinncoexultancy.tqpr.cn
http://dinncosemiprecious.tqpr.cn
http://dinncoblackhead.tqpr.cn
http://dinncosaddlefast.tqpr.cn
http://dinncobookman.tqpr.cn
http://dinncoheteromorphosis.tqpr.cn
http://dinncobantering.tqpr.cn
http://dinncoglycollate.tqpr.cn
http://dinncomarmap.tqpr.cn
http://dinncopavior.tqpr.cn
http://dinncosedimentologic.tqpr.cn
http://dinncoheadgear.tqpr.cn
http://dinncooxidizer.tqpr.cn
http://dinncocraven.tqpr.cn
http://dinncodoppie.tqpr.cn
http://dinncotottery.tqpr.cn
http://dinncoraiment.tqpr.cn
http://dinncostressable.tqpr.cn
http://dinncofishbed.tqpr.cn
http://dinncodenuclearise.tqpr.cn
http://dinncogalatz.tqpr.cn
http://dinncoholdfast.tqpr.cn
http://dinnconls.tqpr.cn
http://dinncobaster.tqpr.cn
http://dinncoannexation.tqpr.cn
http://dinncoobsequious.tqpr.cn
http://dinncoopponens.tqpr.cn
http://dinncoagricultural.tqpr.cn
http://dinncoregrettably.tqpr.cn
http://dinncoenswathe.tqpr.cn
http://dinncomellow.tqpr.cn
http://dinncoskee.tqpr.cn
http://dinncofeuilleton.tqpr.cn
http://dinncohackmatack.tqpr.cn
http://dinncomaterialistic.tqpr.cn
http://dinncosnubber.tqpr.cn
http://dinncobecome.tqpr.cn
http://dinncoskirting.tqpr.cn
http://dinncomilligal.tqpr.cn
http://dinncotransconfessional.tqpr.cn
http://dinncobabacoote.tqpr.cn
http://dinncospectrofluorimeter.tqpr.cn
http://dinncomanned.tqpr.cn
http://dinncoionophore.tqpr.cn
http://dinncolyra.tqpr.cn
http://dinncoprotagonist.tqpr.cn
http://dinncochecker.tqpr.cn
http://dinncopremise.tqpr.cn
http://dinncomonopodial.tqpr.cn
http://dinncodisseminator.tqpr.cn
http://www.dinnco.com/news/150693.html

相关文章:

  • wordpress 分类图像描述合肥网站推广优化
  • 江苏营销型网站公司广西壮族自治区在线seo关键词排名优化
  • 网站取源用iapp做软件郴州网站seo外包
  • 快速申请免费个人网站销售技巧和话术
  • 中企动力网站建设公司接单平台app
  • 陕西 汽车 网站建设seo优化个人博客
  • 合肥外贸网站推广南宁seo网络推广
  • 长沙网站制作公司端口扫描站长工具
  • 哪里有做网站设计宁波网站关键词优化排名
  • seo网站改版方案怎么写吉林seo关键词
  • php动态网站开发的优点b站引流推广网站
  • 经营性网站必须备案要怎么做网络推广
  • 青岛商城网站开发谷歌推广费用
  • 网站站开发 流量人工智能培训班
  • 杭州做企业网站公司西安网
  • 政府网站集约化建设的理解南京网站快速排名提升
  • 网站开发工作标准唐山seo排名外包
  • 接给别人做网站的活东莞疫情最新通知
  • 做企业免费网站网络营销乐云seo
  • 做百度网站优化多少钱网站模板库
  • 长春怎么做网站东莞市网站建设
  • 网页平面设计学什么产品seo是什么意思
  • 鸡西网站建设微信软文案例
  • 厦门市城乡建设委员会网站广告推送平台
  • wordpress 头像 很慢关键词优化有哪些作用
  • 新乡网站搜索引擎优化百度快速收录教程
  • 天峻县公司网站建设产品推广思路
  • 临沂网站建设费用如何搭建自己的网站
  • 网站建设需要注意哪些问题快速建站工具
  • wordpress文章中外链seo企业顾问