大家好,又见面了,我是全栈君。
本文为博主原创,未经允许,不得转载:
先还原错误:
org.apache.jasper.JasperException: /WEB-INF/view/../../../../common/common1.jsp (line: 7, column: 1) Page directive must not have multiple occurrences of pageencoding org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:41) org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:275) org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:107) org.apache.jasper.compiler.Validator$DirectiveVisitor.visit(Validator.java:196) org.apache.jasper.compiler.Node$PageDirective.accept(Node.java:571) org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2376) org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2428) org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2434) org.apache.jasper.compiler.Node$Root.accept(Node.java:464) org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2376) org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2428) org.apache.jasper.compiler.Validator$DirectiveVisitor.visit(Validator.java:101) org.apache.jasper.compiler.Node$IncludeDirective.accept(Node.java:635) org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2376) org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2428) org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2434) org.apache.jasper.compiler.Node$Root.accept(Node.java:464) org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2376) org.apache.jasper.compiler.Validator.validateDirectives(Validator.java:1813) org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:196) org.apache.jasper.compiler.Compiler.compile(Compiler.java:356) org.apache.jasper.compiler.Compiler.compile(Compiler.java:336) org.apache.jasper.compiler.Compiler.compile(Compiler.java:323) org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:585) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:363) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:396) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:340) javax.servlet.http.HttpServlet.service(HttpServlet.java:729) org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) org.springframework.web.servlet.view.InternalResourceView.renderMergedOutputModel(InternalResourceView.java:168) org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:303) org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1286) org.springframework.web.servlet.DispatcherServlet.processDispatchResult(DispatcherServlet.java:1041) org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:984) org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:901) org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970) org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:861) javax.servlet.http.HttpServlet.service(HttpServlet.java:622) org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846) javax.servlet.http.HttpServlet.service(HttpServlet.java:729) org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) com.allcam.rss.system.filter.SystemFilter.doFilter(SystemFilter.java:102) org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:197) org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
解决及分析:
页面使用了多次页面编码。
问题所在:
页面引用公用的头,两个都使用了:pageEncoding=”UTF-8″,
即:<%@ page language=”java” import=”java.util.*” pageEncoding=”UTF-8″%>
去掉其他页面的pageEncoding=”UTF-8″,只留下一个就可以解决问题。
发布者:全栈程序员-用户IM,转载请注明出处:https://javaforall.cn/107846.html原文链接:https://javaforall.cn
【正版授权,激活自己账号】: Jetbrains全家桶Ide使用,1年售后保障,每天仅需1毛
【官方授权 正版激活】: 官方授权 正版激活 支持Jetbrains家族下所有IDE 使用个人JB账号...