This content has been marked as final.
Show 3 replies
-
1. Re: JBoss 4.05GA + JPortal 2.4 & javascript problem
nollie Mar 28, 2007 5:56 PM (in response to gsferra)Probably not the solution you were looking for, but this is what I did to get around not being able to figure out the path to my script:
renderResponse.setProperty("HEADER_CONTENT", "<script type=\"text/javascript\">"+ script +"</script>");
Above my script has been loaded off the file system by my portlet and I inject the script into the head "manually". Probably not an issue for a short script, but I would imagine that finding the correct path and setting that in your JSP is better in the long run when your server is under heavy use. -
2. Re: JBoss 4.05GA + JPortal 2.4 & javascript problem
gsferra Mar 29, 2007 5:57 AM (in response to gsferra)Thank you nollie,
your solution may be a good choice for short scripts (you could put it directly into the JSP without have to set the header content in the portlet methods) but I'm in dealing with a long script library and I wish to include it (yes, I know, it's the same because the browser must download the script file) gaining a better "human readable" html output. If someone else knows a better solution, please post it, otherwise I've no choice to put all the javascript code inside the JSP.
:-( -
3. Re: JBoss 4.05GA + JPortal 2.4 & javascript problem
engela Apr 10, 2007 8:48 AM (in response to gsferra)Replace the location /js/mylib.js with <%= renderRequest.getContextPath() %>/js/mylib.js i.e.
<script type="text/javascript" src="<%= renderRequest.getContextPath() %>/js/mylib.js"></script>
Best Regards,
Anette