Insert line breaks in hidden fields value - Java
How would I go about inserting line breaks in the value of hidden fields?
For ex. this is how my hidden field looks like:
<input type="hidden" name="dahidden" value="<%=da.getFname() %> <%=da.getLname() %> <%=da.getEmail() %> <%=da.getPhone() %> <%=da.getExt() %>">
I tried the following:
value="<%=da.getFname() %> <%=da.getLname() %> \n <%=da.getEmail() %> ..."
value="<%=da.getFname() %> <%=da.getLname() %> '\n' <%开发者_Python百科=da.getEmail() %>..."
value="<%=da.getFname() %> <%=da.getLname() %> <br> <%=da.getEmail() %>..."
But all of them don't actually resolve to the newline character, and get displayed as \n, '\n', and
respectively.Thanks,
PritishJust insert them plain.
<input type="hidden" value="<%=da.getFname() %>
<%=da.getLname() %>
<%=da.getEmail() %>">
That said, have you considered taglibs/EL? Scriptlets are discrouaged since a decade. If you've learnt them from some book/tutorial, I think it's high time to replace it by a more decent/recent one to avoid future troubles.
精彩评论