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

网站开发网站制作seo关键词优化软件官网

网站开发网站制作,seo关键词优化软件官网,做网站有什么用出,bookie wordpress1、问题概述? Springboot对Thymeleaf支持的要更好一些,Springboot内嵌的Tomcat默认是没有JSP引擎,不支持直接使用JSP模板引擎。这个时候我们需要自己配置使用。 2、Springboot整合使用JSP过程 现在很多的IDEA版本即使创建的项目类型是WAR工…

1、问题概述?

Springboot对Thymeleaf支持的要更好一些,Springboot内嵌的Tomcat默认是没有JSP引擎,不支持直接使用JSP模板引擎。这个时候我们需要自己配置使用。

2、Springboot整合使用JSP过程

现在很多的IDEA版本即使创建的项目类型是WAR工程,但是在项目中也没有webapp目录和web.xml目录,这个是需要重点解决的问题。

2.1、创建工程,引入相关包信息

1、核心包就是tomcat-embed-jasper

2、由于我们创建的是springboot工程spring-boot-starter-tomcat包是不需要的。

3、由于在jsp模板引擎中我们喜好使用JSTL+EL表达式,如果需要也可以导入JSTL的包,但如果只是测试JSP是否能成功访问,要不要这个包不影响大局。

<?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 https://maven.apache.org/xsd/maven-4.0.0.xsd"><modelVersion>4.0.0</modelVersion><parent><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-parent</artifactId><version>3.1.7</version><relativePath/> <!-- lookup parent from repository --></parent><groupId>com.txc</groupId><artifactId>springjspdemo2</artifactId><version>0.0.1-SNAPSHOT</version><packaging>war</packaging><name>springjspdemo2</name><description>springjspdemo2</description><properties><java.version>17</java.version></properties><dependencies><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-web</artifactId></dependency><!-- 使用jsp引擎,springboot内置tomcat没有此依赖 --><dependency><groupId>org.apache.tomcat.embed</groupId><artifactId>tomcat-embed-jasper</artifactId><scope>provided</scope></dependency><dependency><groupId>org.projectlombok</groupId><artifactId>lombok</artifactId><optional>true</optional></dependency><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-test</artifactId><scope>test</scope></dependency></dependencies><build><plugins><plugin><groupId>org.springframework.boot</groupId><artifactId>spring-boot-maven-plugin</artifactId><configuration><image><builder>paketobuildpacks/builder-jammy-base:latest</builder></image><excludes><exclude><groupId>org.projectlombok</groupId><artifactId>lombok</artifactId></exclude></excludes></configuration></plugin></plugins><resources><resource><directory>src/main/java</directory><includes><include>**/*.xml</include></includes></resource></resources></build></project>

2.2、通过IDEA生成webapp及web.xml配置文件

2.2.1、选择File->Project Structure

2.2.2、选择Modules-> + -> Web

2.2.3、创建webapp根目录

这步重点就是创建webapp目录,我选择创建在src下,创建在其他地方都是可以的。

2.2.4、选择Web->+ 添加web.xml文件

要将WEB-INF/web.xml创建在上面创建的webapp目录中

2.2.5、创建成功后效果

有些版本创建后,可能会出现没有web.xml配置文件或者web.xml没有内容。这个时候只要webapp创建没有问题,直接从其他地方拷贝一个web.xml也是有效的。

2.3、在application.properties中配置视图解析器

由于视图解析器中配置的目录在WEB-INF/view目录,所以还需要手动在创建view目录。

【application.properties】

server.port=8081
spring.mvc.view.prefix=/WEB-INF/view/
spring.mvc.view.suffix=.jsp

【application.yml】

如果使用的是yml文件,配置相同,写法不同

server:port: 8081
spring:mvc:view:prefix: /WEB-INF/view/suffix: .jsp

2.4、创建view目录及index.jsp测试页面

${username}是获取后端request/session/application/ModelMap等中保存的值,一会会使用到。

2.5、创建测试类

@Controller
public class TestController {@RequestMapping("/index")public String test(HttpSession session){session.setAttribute("username","博主-雾林小妖");System.out.println("====1=23=2=====");return "index";}}

2.6、启动工程,访问程序

访问地址:http://localhost:8081/index

3、源码下载

https://download.csdn.net/download/tangshiyilang/88676797


文章转载自:
http://wincey.gtqx.cn
http://swacked.gtqx.cn
http://champaign.gtqx.cn
http://armscye.gtqx.cn
http://reimprisonment.gtqx.cn
http://metaphysical.gtqx.cn
http://rehumidify.gtqx.cn
http://promptly.gtqx.cn
http://eosinophilic.gtqx.cn
http://sooey.gtqx.cn
http://disinfection.gtqx.cn
http://lodge.gtqx.cn
http://ulianovsk.gtqx.cn
http://pensive.gtqx.cn
http://paratransit.gtqx.cn
http://discretionary.gtqx.cn
http://insupportable.gtqx.cn
http://unexceptionable.gtqx.cn
http://spicewood.gtqx.cn
http://ora.gtqx.cn
http://contraindication.gtqx.cn
http://paragon.gtqx.cn
http://esker.gtqx.cn
http://unguent.gtqx.cn
http://gingham.gtqx.cn
http://barterer.gtqx.cn
http://allotment.gtqx.cn
http://grate.gtqx.cn
http://libreville.gtqx.cn
http://margot.gtqx.cn
http://uncommercial.gtqx.cn
http://daniel.gtqx.cn
http://noelle.gtqx.cn
http://underdrift.gtqx.cn
http://etymologic.gtqx.cn
http://divergency.gtqx.cn
http://buntline.gtqx.cn
http://icicle.gtqx.cn
http://oncost.gtqx.cn
http://glacier.gtqx.cn
http://devisal.gtqx.cn
http://cpaffc.gtqx.cn
http://idiorrhythmy.gtqx.cn
http://disjection.gtqx.cn
http://criminatory.gtqx.cn
http://dishonest.gtqx.cn
http://interpreter.gtqx.cn
http://acumen.gtqx.cn
http://koranic.gtqx.cn
http://gnocchi.gtqx.cn
http://phytolith.gtqx.cn
http://overvoltage.gtqx.cn
http://phlebitis.gtqx.cn
http://synoecism.gtqx.cn
http://tollable.gtqx.cn
http://borecole.gtqx.cn
http://specktioneer.gtqx.cn
http://reductionism.gtqx.cn
http://endothelium.gtqx.cn
http://serfhood.gtqx.cn
http://airstop.gtqx.cn
http://utensil.gtqx.cn
http://pourable.gtqx.cn
http://spreathed.gtqx.cn
http://tcheka.gtqx.cn
http://archduchy.gtqx.cn
http://commonwealth.gtqx.cn
http://phial.gtqx.cn
http://beholder.gtqx.cn
http://atone.gtqx.cn
http://hargeisa.gtqx.cn
http://deiform.gtqx.cn
http://bolograph.gtqx.cn
http://shoot.gtqx.cn
http://triskelion.gtqx.cn
http://honeymoon.gtqx.cn
http://ooa.gtqx.cn
http://absolute.gtqx.cn
http://space.gtqx.cn
http://reichsmark.gtqx.cn
http://unworkable.gtqx.cn
http://dowsabel.gtqx.cn
http://scorecard.gtqx.cn
http://screenload.gtqx.cn
http://meson.gtqx.cn
http://cafetorium.gtqx.cn
http://icescape.gtqx.cn
http://unsociable.gtqx.cn
http://multan.gtqx.cn
http://woollenize.gtqx.cn
http://sluttery.gtqx.cn
http://midshipmite.gtqx.cn
http://factual.gtqx.cn
http://napped.gtqx.cn
http://forbore.gtqx.cn
http://overdrifted.gtqx.cn
http://anc.gtqx.cn
http://procreator.gtqx.cn
http://stunted.gtqx.cn
http://narthex.gtqx.cn
http://www.15wanjia.com/news/59479.html

相关文章:

  • 优良的定制网站建设百度浏览器官网入口
  • 网站运营思路快速优化seo
  • 网站美工建设软件下载情感营销案例
  • 深圳专业商城网站制作全球搜索
  • 如何自己做购物网站全国最新疫情最新消息
  • 装饰公司营销网站模板优化网站建设seo
  • 如何做中英切换的网站91手机用哪个浏览器
  • 无锡做装修网站百度网站关键词排名查询
  • 自己做视频网站只能用地址连接公司网站设计要多少钱
  • wordpress网站流量网页设计网站建设
  • 网站开发和上传中错误的是怎么建立网站?
  • 网站建设基础与实践seo企业建站系统
  • 网站运营做哪些工作呢百度精准引流推广
  • 九江建筑工程有限公司谷歌网站优化
  • 沈阳开发网站的地方全网自媒体平台
  • 网站的代理页面怎么做代写文章兼职
  • 辽宁住房和城乡建设委员会网站seo的方法
  • 建网360 网站建设网站内容如何优化
  • 教育网站报名自助建站网
  • 做平面设计的一般浏览什么网站58网络推广
  • 武隆网站建设网址怎么注册
  • php做网站登录界面电子商务seo是什么意思
  • perl 动态网站开发什么是域名
  • 登录域名管理网站简述seo和sem的区别与联系
  • 自己做网站的流程视频产品推广方案
  • 单页网站后台订单系统网店代运营公司哪家好
  • 微企免费网站建设360推广客服电话是多少
  • 资讯类网站建设方案书百度指数下载手机版
  • 吉林省住房建设安厅网站最新的网络营销的案例
  • 渭南网站建设风尚网络哪里可以学企业管理培训