I have a jsp page inside which I call my xhtml page. Am maps xhtml to facesServlet and activates the entire resource servlet, so it displays all js and css files perfectly if I click on the xhtml page.
If I got to the jsp page, then these files are not mentioned, firebug throws all kinds of js errors.
To get around, I added the js and css files to the web folder and included them and tried them, including in the xhtml and also on the jsp page, but they are not referenced, and for now, if I directly click on the xhmtl page , then downloading files works fine, but if I go and hit the jsp page, I end up with js errors, is there any other way to get the js file.
This is how I link to my js
files
<%@ include file="/common/taglibs.inc" %> <html> <head> <link rel="stylesheet" href="/css/Main.css" type="text/css"> <link rel="stylesheet" href="/css/Admin.css" type="text/css"> <link rel="stylesheet" href="/css/Home.css" type="text/css"> <script type="text/javascript" src="/js/icefaces/ace-jquery.js"/> <script type="text/javascript" src="/js/icefaces/ace-components.js"/> <script type="text/javascript" src="/js/icefaces/icepush.js"/> <script type="text/javascript" src="/js/icefaces/bridge.js"/> <script type="text/javascript" src="/js/icefaces/compat.js"/> <script type="text/javascript" src="/js/icefaces/fileEntry.js"/> <script type="text/javascript" src="/js/icefaces/jsf.js"/> <script type="text/javascript" src="/js/icefaces/icefaces-compat.js"/> < %@ include file="/js/popupRightNow.inc" %> <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> </head> <body> <jsp:include page="/navigation/TopNav.jsp" flush="true"/> <jsp:include page="/trade_entry/UploadBlotter.xhtml"/> <jsp:include page="/navigation/BottomNav.jsp" flush="true"/> </body> </html>
Any thoughts, suggestions?
Update:
I have a requirement to create new pages using jsf2
, and I created an xhtml
page, but I want to get header
and footer
application themes and those defined in jsp
, now I tried searching by integrating jsp
into xhtml
, but it was rightly suggested that this is not must be done.
Tried How to enable JSP page on Facelets page? but this did not work as my
tags were not recognized and finally tried to create jsp
and included in it an xhtml
page that seemed to work, but not 100%.
So, since it stands right now, if I hit the xhtml
page directly, then it works, but if I click on the jsp
page with header/footer
, then icefaces
or say jsf
stuffs is not working 100% hope I can clarify what what I'm trying to achieve.
Update 2
The js file from javax.faces.resources
links to the xhtml page on the page, but does not link to the jsp
page.