textarea输入回车,前台jsp不回车问题解决

jsp引入标签:

<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%
    request.setAttribute("vEnter", "\r\n");
%>

jsp使用,前台自动换行:

 <p><h2>${vs.index + 1}.&nbsp;<script type="text/javascript">document.write(("${fn:replace(var.QUESTIONBANK_STEM,vEnter,"<br/>")}"));</script></h2></p>

jsp使用,前台不换行:

 <p><h2>${vs.index + 1}.&nbsp;<script type="text/javascript">document.write(("${fn:replace(var.QUESTIONBANK_STEM,vEnter,"")}"));</script></h2></p>

 

posted @ 2016-10-28 12:55  花语苑  阅读(733)  评论(0编辑  收藏  举报