Files with suffix *.jsp as JSP documents

Hi, I have trouble making IntelliJ 6.0 recognize jsp files which use the xml notation ("JSP document"). The suffix of the files is *.jsp (I know that *.jspx would be a better choice, but the project is an inherited project).

I have configured web.xml to flag all jsp files as jsp documents, but nevertheless IntelliJ shows me the error: "Element jsp:root is not allowed here".

Is it not possible to make IntelliJ realize that files with the suffix *.jsp are actually jsp documents, as configured in web.xml?

Thank you for your help.

/test.jsp
-


<?xml version="1.0" encoding="UTF-8"?>
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.0">
hello, world!
</jsp:root>
-



web.xml
-


<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.4"
xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" >
<jsp-config>
<jsp-property-group>
<url-pattern>*.jsp</url-pattern>
<is-xml>true</is-xml>
</jsp-property-group>
</jsp-config>
</web-app>
-


2 comments

Hello Markus,

Hi, I have trouble making IntelliJ 6.0 recognize jsp files which use
the xml notation ("JSP document"). The suffix of the files is *.jsp (I
know that *.jspx would be a better choice, but the project is an
inherited project).

I have configured web.xml to flag all jsp files as jsp documents, but
nevertheless IntelliJ shows me the error: "Element jsp:root is not
allowed here".

Is it not possible to make IntelliJ realize that files with the suffix
*.jsp are actually jsp documents, as configured in web.xml?


You need to go to Settings | File Types and map the *.jsp pattern to "JSPx
files" file type.

--
Dmitry Jemerov
Software Developer
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"


0

Hello Dmitry, thank you very much for that advice. Now the jsp files are treated correctly as jspx files.

Can this be done on a module basis so that regular *.jsp files are not influenced in other modules? Or in a way that the settings in web.xml are respected?

0

Please sign in to leave a comment.