JSP Processing instruction not closed

匿名 (未验证) 提交于 2019-12-03 03:04:01

问题:

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:

Save same code in new file by deleting the error file does worked for me.



回答5:

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" %>. 


回答6:

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. :)



标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!