Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to include external javascript and css resources to a jsf?

843844Jul 22 2008 — edited Apr 15 2009
I need to include external css and javascript files to my jsf page. Using the code below does not work because all the styles on the css page are ignored and the functions within the js files are not executed.
<link rel="stylesheet" type="text/css" href="/resources/styles/style.css" /> 
<script language="JavaScript" src="/resources/javascript/util.js"></script>
When I try to execute any js function within a script tag on a jsf page I get an object expected error.

I googled about my problem and found this piece of code for importing styles for an external css.
<style type="text/css">
@import url("/resources/styles/style.css");
</style>
How could I add an external javascript file to my jsf?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 13 2009
Added on Jul 22 2008
7 comments
1,764 views