问题
I tried to include an HTML file to my JSP but I eclipse show'd this error
The included file
<%@include file="includes/head.html" %>
And the error
Processing instruction not closed
And this is just the simple JSP
<%@include file = "includes/head.html" %>
<form action = "#" method = "POST">
Username: <input type = "text" name = "username"><br/>
Password: <input type = "password" name = "password"><br/>
</form>
</body>
</html>
回答1:
Select All, Backspace,Then ctrl+z to revert. works for me. But someone who knows eclipse well might shed some light as to why this happens
回答2:
This seems crazy but press ctrl + A,ctrl + x,paste and save the code,Bug is cleared
回答3:
Also, closing the document and opening it again appears to work (please remember to save the document first).
回答4:
i try Anurag Priyadarshi answer but it didnt work. But i get rid of that error by restart the eclipse, u might wanna try it it works for me. :)
回答5:
Save same code in new file by deleting the error file does worked for me.
回答6:
Try giving a space after @.
<%@ include file="includes/head.html" %>.
Also if head.html is in other directory then absolute path should start with / or ..
Try
<%@ include file="/includes/head.html" %>
or
<%@ include file="../includes/head.html" %>.
回答7:
Restarting eclipse worked for me.
来源:https://stackoverflow.com/questions/12767979/jsp-processing-instruction-not-closed