JSP Processing instruction not closed

2019-03-24 22:50发布

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>

6条回答
仙女界的扛把子
2楼-- · 2019-03-24 23:14

This seems crazy but press ctrl + A,ctrl + x,paste and save the code,Bug is cleared

查看更多
Viruses.
3楼-- · 2019-03-24 23:16

Also, closing the document and opening it again appears to work (please remember to save the document first).

查看更多
Viruses.
4楼-- · 2019-03-24 23:20

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" %>.
查看更多
你好瞎i
5楼-- · 2019-03-24 23:24

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

查看更多
我命由我不由天
6楼-- · 2019-03-24 23:25

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

查看更多
一纸荒年 Trace。
7楼-- · 2019-03-24 23:26

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

查看更多
登录 后发表回答