I have a .jsp page I'm compiling with ant and deploying to a Tomcat 7 server. A couple of times the output source document has a double-quote character added at a point where it shouldn't be added. It seems to persist through multiple compiles and deploys, but they've always gone away after a while.
Here is a section of the jsp:
<form action="SetDocName" method="post" accept-charset="UTF-8">
<input type="text" name="new-doc-name" /> <input type="submit" value="<%= uiStrings.getString("cha开发者_运维知识库nge_doc_name") %>" />
</form>
and here's the final output:
<form action="SetDocName" method="post" accept-charset="UTF-8">
<input type="text" name="new-doc-name" /> <input type="submit" value="Change document name" />"
</form>
notice the double-quote next to the second input element.
Any idea what's going on here? It's not a major problem at the moment, but it is puzzling.
That uiString you are using seems to be messing things up I would try the following (single quotes):
value='<%= uiStrings.getString("change_doc_name") %>'
I never really got to the bottom of this completely, in the absence of an explanation I guess the fix is the closest to an answer:
My comment: "The issue seems to be the web page editor plugin somehow inserting some sort of character that shows up as whitespace in the editor but is interpreted differently by Tomcat. Replacing the whitespace with new whitespace fixed it and it hasn't happened since."
精彩评论