今天做项目访问JSP时,报错:Attribute value is quoted with " which must be escaped when used within the value 。相信很多人都遇到过,以下结合本人查资料与亲自实践得到的结论。
出现错误的位置为 value="<%=request.getAttribute("name")%>"
错误产生的原因,是因为tomcat版本升级后(6.0以后),对双引号的处理机制引起的,如果出现双引号包含双引号的情况,就可能会出现这个错误。
简单的解决办法为:
双引号改为单引号value=‘<%=request.getAttribute("name")%>’ 这样就Ok了