Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个由两个表组成的数据库名称。我从同一个 JSP 页面中的两个表中检索了数据。
我得到了正确的输出,但我也只在一行中得到了两个表数据。我想在每个表之间打印一个换行符。
我试过打印\n,out.newline()但没有用。
\n
out.newline()
打印<br />而不是\n
<br />
\n是 Java 中的换行符,而不是 HTML 中的换行符。
如果你想在 JSP 呈现的 HTML 中换行,你可以使用<BR>. 如果要在 scriptlet 中使用它,请使用以下代码:
<BR>
<jsp:scriptlet> out.println("<BR>"); </jsp:scriptlet>
我的 ViewModel 包含一些对象(IEnumerable)的集合。集合中的项目按行显示在标签中。当我提交表单时,它会触发提交 jQuery 函数来验证自己。我需要从显示的表中获取值并转换为对象。
看一下这个:
// // the table to display my collection content <div id="publications">