Tomcat

A reconnecting websocket can't connect to the server with FacesContext.getCurrentInstance() being resolved to null

霸气de小男生 提交于 2021-01-04 11:10:53
问题 I have a plain Tomcat 8.5.47 having the following dependencies installed. <dependency> <groupId>org.glassfish</groupId> <artifactId>javax.faces</artifactId> <version>2.3.9</version> </dependency> <dependency> <groupId>org.jboss.weld.servlet</groupId> <artifactId>weld-servlet</artifactId> <version>2.4.8.Final</version> </dependency> <dependency> <groupId>javax.websocket</groupId> <artifactId>javax.websocket-api</artifactId> <version>1.1</version> </dependency> CDI seems to work fine, or at

A reconnecting websocket can't connect to the server with FacesContext.getCurrentInstance() being resolved to null

╄→гoц情女王★ 提交于 2021-01-04 11:09:02
问题 I have a plain Tomcat 8.5.47 having the following dependencies installed. <dependency> <groupId>org.glassfish</groupId> <artifactId>javax.faces</artifactId> <version>2.3.9</version> </dependency> <dependency> <groupId>org.jboss.weld.servlet</groupId> <artifactId>weld-servlet</artifactId> <version>2.4.8.Final</version> </dependency> <dependency> <groupId>javax.websocket</groupId> <artifactId>javax.websocket-api</artifactId> <version>1.1</version> </dependency> CDI seems to work fine, or at

A reconnecting websocket can't connect to the server with FacesContext.getCurrentInstance() being resolved to null

陌路散爱 提交于 2021-01-04 11:08:20
问题 I have a plain Tomcat 8.5.47 having the following dependencies installed. <dependency> <groupId>org.glassfish</groupId> <artifactId>javax.faces</artifactId> <version>2.3.9</version> </dependency> <dependency> <groupId>org.jboss.weld.servlet</groupId> <artifactId>weld-servlet</artifactId> <version>2.4.8.Final</version> </dependency> <dependency> <groupId>javax.websocket</groupId> <artifactId>javax.websocket-api</artifactId> <version>1.1</version> </dependency> CDI seems to work fine, or at

A reconnecting websocket can't connect to the server with FacesContext.getCurrentInstance() being resolved to null

柔情痞子 提交于 2021-01-04 11:07:33
问题 I have a plain Tomcat 8.5.47 having the following dependencies installed. <dependency> <groupId>org.glassfish</groupId> <artifactId>javax.faces</artifactId> <version>2.3.9</version> </dependency> <dependency> <groupId>org.jboss.weld.servlet</groupId> <artifactId>weld-servlet</artifactId> <version>2.4.8.Final</version> </dependency> <dependency> <groupId>javax.websocket</groupId> <artifactId>javax.websocket-api</artifactId> <version>1.1</version> </dependency> CDI seems to work fine, or at

springboot整合jsp,完成公交车站路线图

限于喜欢 提交于 2021-01-04 10:41:00
点赞再看,养成习惯 开发环境: jdk 8 intellij idea tomcat 8 mysql 5.7 maven 3.6 所用技术: springboot jsp 数据静态初始化 项目介绍 使用springboot整合jsp,在后端写入公交路线名称和详细站点,前端页面可条件查询具体的内容,如公交路线,公交名称,车俩信息等。 运行效果 前台用户端: 路线选择 路线详情 数据准备: BusData.txt 准备工作: pom.xml加入jsp模板引擎支持: <dependency> <groupId>org.apache.tomcat.embed</groupId> <artifactId>tomcat-embed-jasper</artifactId> <scope>provided</scope> </dependency> springboot配置jsp spring.mvc.view.prefix=/ spring.mvc.view.suffix=.jsp 重要代码: bus数据初始化 @PostConstruct private void initBusData(){ try{ File file = new File(BusMap.getClass().getResource("/").getPath()); FileReader fileReader = new

Spring Cloud 之 Feign 使用HTTP请求远程服务

余生长醉 提交于 2021-01-04 04:04:02
  Feign是从Netflix中分离出来的轻量级项目,能够在类接口上添加注释,成为一个REST API 客户端,Feign默认集成了Ribbon。   Feign中对 Hystrix 有依赖关系。Feign只是一个便利的rest框架,简化调用,最后还是通过ribbon在注册服务器中找到服务实例,然后对请求进行分配   Feign是一种声明式、模板化的HTTP客户端。在Spring Cloud中使用Feign, 我们可以做到使用HTTP请求远程服务时能与调用本地方法一样的编码体验,开发者完全感知不到这是远程方法,更感知不到这是个HTTP请求。 一、使用方式   1、首先写好需要注册进注册中心的服务接口UserServiceController,该接口相当于service层,只是以RestFULL接口的形式供远程调用 @RestController @RequestMapping( "userService" ) public class UserServiceController { @GetMapping( "getUser/{userId}" ) public User getUser(@PathVariable("userId" ) String userId){ System.out.println( "获取User,更具UserId,查询User-->" + userId

spring boot 中容器 Jetty、Tomcat、Undertow

放肆的年华 提交于 2021-01-04 03:35:44
spring boot 中依赖tomcat <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> web 中默认对 tomcat 依赖 <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-tomcat</artifactId> <version>2.1.2.RELEASE</version> <scope>compile</scope> </dependency> spring boot 中 依赖 jetty 去除tomcat < dependency > < groupId > org.springframework.boot </ groupId > < artifactId > spring-boot-starter-jetty </ artifactId > < version > 2.1.4.RELEASE </ version > </ dependency > spring boot 中依赖 Undertow 去除tomcat < dependency > <

Tomcat 和 Jetty 比较和Spring Boot集成

核能气质少年 提交于 2021-01-04 02:52:10
一、Tomcat 和 Jetty 的比较 Tomcat 和 Jetty 都是作为一个 Servlet 引擎应用的比较广泛,可以将它们比作为中国与美国的关系,虽然 Jetty 正常成长为一个优秀的 Servlet 引擎,但是目前的 Tomcat 的地位仍然难以撼动。相比较来看,它们都有各自的优点与缺点。 Tomcat 经过长时间的发展,它已经广泛的被市场接受和认可,相对 Jetty 来说 Tomcat 还是比较稳定和成熟,尤其在企业级应用方面,Tomcat 仍然是第一选择。但是随着 Jetty 的发展,Jetty 的市场份额也在不断提高,至于原因就要归功与 Jetty 的很多优点了,而这些优点也是因为 Jetty 在技术上的优势体现出来的。 以下从架构、性能和特性三方面进行比较,点击获取完整详细的 Spring全家桶 、 spring技术栈和微服务架实战 视频课程。 1、架构比较 从架构上来说,Jetty 比 Tomcat 更加简单。Jetty 所有组件都是基于 Handler 来实现,当然它也支持 JMX。但是主要的功能扩展都可以用 Handler 来实现。可以说 Jetty 是面向 Handler 的架构,就像 Spring 是面向 Bean 的架构,MyBatis 是面向 Statement 一样,而 Tomcat 是以多级容器构建起来的,它们的架构设计必然都有一个“元 神”

An invalid domain [.xxx.com] was specified for this cookie异常解决

社会主义新天地 提交于 2021-01-03 17:21:38
在项目中需要向浏览器写cookie,使用的是tomcat8.5,在写cookie的时候设置了一级域名 如: .xxx.com , 但是在写cookie的时候,抛出了异常: An invalid domain [.xxx.com] was specified for this cookie 经查这种域名设置是cookie 版本0的遗留格式 在tomcat8.5上是使用org.apache.tomcat.util.http.Rfc6265CookieProcessor The standard implementation of CookieProcessor is org.apache.tomcat.util.http.Rfc6265CookieProcessor. This cookie processor is based on RFC6265 with the following changes to support better interoperability: Values 0x80 to 0xFF are permitted in cookie-octet to support the use of UTF-8 in cookie values as used by HTML 5. For cookies without a value, the '=' is not

浅谈前端性能优化(二)——对HTTP传输进行压缩

泄露秘密 提交于 2021-01-03 11:39:20
1、前端性能优化的一点: 对js、css、图片等进行压缩,尽可能减小文件的大小,减少文件下载的时间,从而减少网页响应的时间。 2、前端性能优化的另一点: 对HTTP传输进行压缩,即在js,css、图片等资源已经压缩的基础上(其实,文件的压缩与否均可,文件的压缩跟HTTP传输过程的压缩没关系),在HTTP传输过程中的再次压缩。 3、HTTP1.1的Accept-Encoding和content-Encoding: 从HTTP1.1开始,客户端可以通过Accept-Encoding头来声明浏览器支持的压缩方式,服务端通过content-Encoding来启用压缩,配置压缩的文件类型,压缩方式。当客户端的请求到达服务器,服务器对资源进行压缩后,返回给客户端,客户端按照相应的方式进行解析。 eg: 客户端(HTTP请求头)——accept-encoding: gzip, deflate, sdch, br 服务器(HTTP响应头)——content-encoding:gzip 压缩验证查看效果: 文件传输前的大小——通过属性查看 文件传输过程中的大小——通过Network中的Size查看 4、压缩方式选择: gzip是GUNzip的缩写,使用无损压缩,压缩效果最佳,已经成为使用最为普遍、支持的浏览器最多的数据压缩格式。 天猫、淘宝、京东、苏宁、腾讯、百度等大型网站都使用gzip压缩方式。