There is a bug in project woodstock when used in HTTPS with IE7 or newer. Since project woodstock has ended and all new development effort will be in ICEfaces it seems this “bug” will not be fixed.
There are some solutions to change de webui-jsf.jar library to hardcode the URL, since this is not the best solution, because you have to create a patch for every project (even create a patch if you move the project from test to production envoirement).
So i’ve looked in the code (shipped with Netbeans) and made a little fix. I determine the server URL from the HttpServletContext.
My fix:
Edited com.sun.webui.jsf.util.JavaScriptUtilities
The following method is little bit changed to determine the jsFile String
private static void renderJavaScriptInclude(UIComponent component,
ResponseWriter writer, String file) throws IOException
if (file == null) {
return;
}
String baseURL = "";
try
{
HttpServletRequest req = (HttpServletRequest)FacesContext
.getCurrentInstance().getExternalContext().getRequest();
StringBuffer url = req.getRequestURL();
baseURL = url.substring(0, url.indexOf("/",10));
// HTTPS fix over LB
if (baseURL.indexOf(":443") >0)
{
baseURL = baseURL.replaceFirst("http://", "https://").replaceFirst(":443", "");
}
}
catch (Exception e)
{
baseURL = "";
}
String jsFile = baseURL + getTheme().getPathToJSFile(file);
You can also download the patched jar file and put it in your netbeans directory/visualweb2/modules/ext/
Excellent article, I’m a big fan of this blog, keep on writing these great posts, and I’ll be a regular visitor for a long time.
Hello,
I am stil getting the error even after I doenloaded the Patched Jar file. I am still facing this issue.. Could you please help? its really been bugging me a lot for past 1 month or so.
Thanks+Regards
Somil
@Somil, did you put it in your Netbeans directory and for your project you must Clean & Build. If you have embedded the libraries in your project folder then you have put the patched jar file also in your project folder library folder.
Hello,
Thanks for the quick reply ,
Yes, I did follow exactly what you have mentioned, I put the patched jar in the Netbeans visualweb2/.. folder and also removed the exsisting jar from project, still I got the error. Could you please check if the jar for download is the correct one ? Also,could you check if this one is working fine in your system ? and if it does then there is something missing from my project settings etc??
Thanks
Somil
I will check the jar, my download server is down at the moment so I’ll search in old backups
. I’m not using Woodstock anymore since it’s obsolete. I now use RichFaces since IceFaces was back then not an option.
I’ll let you know, do you have a embedded library folder in your project? You can see this in project properties and if you have defined a library folder then you have a embedded library folder and you have to replace it also in the defined library.
Hello,
Thanks for the reply , Yes but I already had that in my lib folder and in visualweb2/ folder of netbeans.
Please help me find the solution otherwise my head will be chopped off.. lolz .
Thanks
Somil
Hello,
Yes, I did change that in the folder too. But still no result. do you mind emailing me the right Jar ?
my id is somil009@hotmail.com .
Also, Please make sure its the right one?
Thanks for your Help
Somil
I’ve just sent you an email with the patched jar file.
If you still can’t make it work you can try to replace the jar in the WAR / EAR file that you generate. Then you’re sure that the correct jar is loaded.
Another solution is on your project that you go edit the Visual JSF library and remove the webui-jsf.jar that’s linked in to and add a new jar that points to the emailed jar.