美食菜谱网浏览器输入中括号报错

无敌的宇宙
无敌的宇宙
擅长邻域:Java,HTML,JavaScript,MySQL,支付,退款,图片上传

分类: Java 专栏: java 标签: 没事菜谱

2024-03-23 15:59:11 600浏览

美食菜谱网浏览器输入中括号报错

springboot启动类添加下面的方法即可

package com.jff.cn;

import org.apache.catalina.connector.Connector;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.SpringBootConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.embedded.tomcat.TomcatConnectorCustomizer;
import org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory;
import org.springframework.boot.web.servlet.server.ConfigurableServletWebServerFactory;
import org.springframework.context.annotation.Bean;


@SpringBootConfiguration
@SpringBootApplication
public class Application {
	public static void main(String[] args) {
		
		/*
		 * 有些功能ajax用不了是因为权限拦截,在LoginInterceptor里面的urls添加一下不需要验证权限的url即可
		 * */
		SpringApplication.run(Application.class, args);
	}


	@Bean
	public ConfigurableServletWebServerFactory webServerFactory() {
		TomcatServletWebServerFactory factory = new TomcatServletWebServerFactory();
		factory.addConnectorCustomizers(new TomcatConnectorCustomizer() {
			public void customize(Connector connector) {
				connector.setProperty("relaxedQueryChars", "|{}[]");
			}
		});
		return factory;
	}
}

ssm的百度修改tomcat配置文件

报错提示

Invalid character found in the request target [qt/article/list?kind_id=5&kind_id=5&kind_id2=&kind_id3=&gy_tags=[%E9%9A%BE%E5%BA%A6:%E5%88%9D%E7%BA%A7%E5%85%A5%E9%97%A8] ]. The valid characters are defined in RFC 7230 and RFC 3986

好博客就要一起分享哦!分享海报

此处可发布评论

评论(0展开评论

暂无评论,快来写一下吧

展开评论

您可能感兴趣的博客

客服QQ 1913284695