This week's book giveaway is in the JavaFX forum.
We're giving away four copies of Introducing JavaFX 8 Programming and have Herbert Schildt on-line!
See this thread for details.
The moose likes JSP and the fly likes Including .JSPX files in .JSP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Introducing JavaFX 8 Programming this week in the JavaFX forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Including .JSPX files in .JSP" Watch "Including .JSPX files in .JSP" New topic

Including .JSPX files in .JSP

Abhishek Asthana
Ranch Hand

Joined: Sep 08, 2004
Posts: 146

I am trying to include a .jspx in another .jsp file:

Following is the code of my jspx file (named JSPX.jspx):

On runtime I get following error:
main.jsp:20:28: Error in "url\JSPX.jspx" at line 1: The encoding "null" specified in the XML prolog is unsupported.
<%@ include file="/JSPX.jspx"%>

What can be wrong here? Please help.


Bharath Gowda

Joined: Apr 15, 2008
Posts: 17
<@ is just a derivative as per JSP specifications. so try using <jsp:include> and change the name from JSPX.jspx to somexxx.jspx. please be informed that you need to use the file name and not the title to include the jspx in a jsp

Bharath PU<br />SCJP - 1.4 <br />IBM Certified Database Associate<br />IBM Certified Advanced Application Developer -- Rational Application Developer for WebSphere Software V6.0
Abhishek Asthana
Ranch Hand

Joined: Sep 08, 2004
Posts: 146
Thanks Bharat.

I have tried <jsp:include> as well, and JSPX.jspx is the name of my file, a bit weird though!
I agree. Here's the link:
subject: Including .JSPX files in .JSP
It's not a secret anymore!