File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
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!