String 检索时,空格后缺少某些字符串
我做了一块板,它从数据库中检索字符串数据 当检索到的字符串被放入表单时,空格后的字符串就消失了 这是我的密码String 检索时,空格后缺少某些字符串,string,forms,jsp,String,Forms,Jsp,我做了一块板,它从数据库中检索字符串数据 当检索到的字符串被放入表单时,空格后的字符串就消失了 这是我的密码 <c:forEach items="${detail}" var="dto"> <form id="editposting" name="editposting" action="updatepost.bo" method="post"> No <input type="text" readonly id="no" n
<c:forEach items="${detail}" var="dto">
<form id="editposting" name="editposting" action="updatepost.bo" method="post">
No
<input type="text" readonly id="no" name="no" class="form-control" value=${dto.no}>
<br> Writer
<input type="text" readonly id="uname" name="uname" class="form-control" value=${dto.name}>
<br> Author
<input type="text" id="author" name="author" class="form-control" value=${dto.author}>
<br> Sentence Summary
<input type="text" id="summary" name="summary" class="form-control" value=${dto.summary}>
<br> Full review
<textarea rows="10" id="fullrev" name="fullrev" class="form-control">${dto.fullrev}${dto.name }${dto.summary }</textarea>
<br>
<input type="hidden" id="pdate" name="pdate" class="form-control">
<br>
<button type="button" class="btn btn-primary" onclick="javascript:history.back();">Cancel</button>
<c:if test="${sessionScope.uid==dto.name||sessionScope.uid=='admin'}">
<input type="submit" class="btn btn-primary" value="edit">
<button type="button" class="btn btn-primary">Remove</button>
</c:if>
</form>
</c:forEach>
不
作家
作者
句子摘要
全面审查
${dto.fullrev}${dto.name}${dto.summary}
取消
去除
所以当我以作者的形式键入“Hello World”并发布它时
它进入DB,一切正常
当我点击我刚在黑板上写的帖子时,我只能在作者标签中看到“你好”
但是如果我在textArea属性中放置相同的代码,我可以很好地看到“hello world”。当我在做我的
jsp/servlet
项目时,我也遇到了这个问题。我解决了这个问题
您可以尝试将
value=${dto.no}
更改为value=“${dto.no}”
这可能是由于您的值具有一些特殊字符而导致的,您可以使用
来转义这些特殊字符
因此,将value=${dto.no}
更改为