JasperException: is quoted with " which must be escaped when used within

异常信息:

org.apache.jasper.JasperException: /WEB-INF/view/jsp/default/ui/casLoginView.jsp(48,35) Attribute value request.getQueryString() == null ? "" : request.getQueryString().replaceAll("&locale=([A-Za-z][A-Za-z]_)?[A-Za-z][A-Za-z]|^locale=([A-Za-z][A-Za-z]_)?[A-Za-z][A-Za-z]", "") is quoted with " which must be escaped when used within the value
	org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:40)
	org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:407)
	org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:88)
	org.apache.jasper.compiler.Parser.parseAttributeValue(Parser.java:256)
	org.apache.jasper.compiler.Parser.parseAttribute(Parser.java:205)
	org.apache.jasper.compiler.Parser.parseAttributes(Parser.java:148)
	org.apache.jasper.compiler.Parser.parseCustomTag(Parser.java:1208)
	org.apache.jasper.compiler.Parser.parseElements(Parser.java:1422)
	org.apache.jasper.compiler.Parser.parseBody(Parser.java:1634)
	org.apache.jasper.compiler.Parser.parseOptionalBody(Parser.java:978)
	org.apache.jasper.compiler.Parser.parseCustomTag(Parser.java:1246)
	org.apache.jasper.compiler.Parser.parseElements(Parser.java:1422)
	org.apache.jasper.compiler.Parser.parse(Parser.java:130)
	org.apache.jasper.compiler.ParserController.doParse(ParserController.java:255)
	org.apache.jasper.compiler.ParserController.parse(ParserController.java:103)
	org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:185)
	org.apache.jasper.compiler.Compiler.compile(Compiler.java:347)
	org.apache.jasper.compiler.Compiler.compile(Compiler.java:327)
	org.apache.jasper.compiler.Compiler.compile(Compiler.java:314)
	org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:592)
	org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:326)
	org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
	org.springframework.web.servlet.view.InternalResourceView.renderMergedOutputModel(InternalResourceView.java:171)
	org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:251)
	org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1160)
	org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:901)
	org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:809)
	org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:476)
	org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:431)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
	org.jasig.cas.web.init.SafeDispatcherServlet.service(SafeDispatcherServlet.java:115)
	org.inspektr.common.web.ClientInfoThreadLocalFilter.doFilterInternal(ClientInfoThreadLocalFilter.java:48)
	org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:75)


错误原因:
org.apache.jasper.JasperException: /WEB-INF/view/jsp/default/ui/casLoginView.jsp(48,35) Attribute value request.getQueryString() == null ? "" : request.getQueryString().replaceAll("&locale=([A-Za-z][A-Za-z]_)?[A-Za-z][A-Za-z]|^locale=([A-Za-z][A-Za-z]_)?[A-Za-z][A-Za-z]", "") is quoted with " which must be escaped when used within the value
这句话的意思是说,在value属性中引用"时应该转义,escaped是逃脱逃逸的意思,我们国内的书籍都把这个翻译成了转义。

解决办法:
value="<%=request.getQueryString() == null ? \"\" : request.getQueryString().replaceAll(\"&locale=([A-Za-z][A-Za-z]_)?[A-Za-z][A-Za-z]|^locale=([A-Za-z][A-Za-z]_)?[A-Za-z][A-Za-z]\", \"\")%>"

你可能感兴趣的:(JasperException: is quoted with " which must be escaped when used within)