Application error message 这个漏洞


问题描述:

这个漏洞是因为前台参数传到后台的时候属性没有对应上导致

解决方案:

解决的方式有三种:

1.该后台对应的实体中需要有各自属性的set/get方法。

2.将这两个属性放置到try...catch...语句中就行了

3.如果还是不可以那就得前台代码对这两个属性进行验证,确保传递到后台参数的格式类型与后台的数据类型对的上。


这个问题还有其他情况就是需要对后台异常要跳转到一个页面,类是于500.html页面,下面是spring boot 通过写一个配置文件来对跳转页面的控制。

package com.qzt.config.cors;

import org.springframework.boot.context.embedded.ConfigurableEmbeddedServletContainer;
import org.springframework.boot.context.embedded.EmbeddedServletContainerCustomizer;
import org.springframework.boot.web.servlet.ErrorPage;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.HttpStatus;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

@Configuration
public class CorsConfig {

    //统一页码处理配置  
   @Bean  
  public EmbeddedServletContainerCustomizer containerCustomizer() {  
     return new EmbeddedServletContainerCustomizer() {  
            @Override  
           public void customize(ConfigurableEmbeddedServletContainer container) {  
                //ErrorPage error401Page = new ErrorPage(HttpStatus.UNAUTHORIZED, "/401.html");  
              // ErrorPage error404Page = new ErrorPage(HttpStatus.NOT_FOUND, "/Err404.html");  
               ErrorPage error500Page = new ErrorPage(HttpStatus.INTERNAL_SERVER_ERROR, "/page/500.html"); 

               container.addErrorPages(error500Page);    

        }    

};  

   }

}


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值