2 Replies Latest reply on Feb 4, 2007 10:07 PM by Chua Khoon Yong

    Problem using javascript files in Portal

    Bernie Miller Newbie

      I am trying to create a portlet that contains alot of javascript files. When I use the tag with the src attribute set to the path and filename of my javascript file it does not work. JBoss seems to be converting the js files to HTML files. If I put the javascript directly into the .jsp page then it works fine. However, I do not want to do this because I have about 50 javascript files for my portlet.

      I looked at using Portal Themes but this seems cumbersome becasue I have so many js files. Plus the javascript is not for presentation but contains most of our business logic.

      Has anyone else run into this problem? Using the tags seem to work in JBoss regular web apps but NOT in the portal.

      Thanks in advance!

        • 1. Re: Problem using javascript files in Portal
          Bernie Miller Newbie

          For some reason the coplete message did not appear in my original posting.

          I am trying to create a portlet that contains alot of javascript files. In my index.js page I use the script tag with the src attribute set to the js path and filename and it does not work. JBoss seems to be converting the js files to HTML and replacing the content. If I put the js directly in the index.jsp page then it works fine. However, I have obout 50 js files so i don't want to do this. I have used the script tag in a regular jboss web app and it worked. it just seems to have a problem in a portlet.


          <script type="text/javascript" src="../js/test.js"></script>


          I looked at using portal themes but this seems too cumbersome for alot of js files. Plus the js contains business logic and not just presentation logic.

          Thanks in advance!

          • 2. Re: Problem using javascript files in Portal
            Chua Khoon Yong Novice

            hi berniemiller,

            Maybe your issue is related to this one:

            http://www.jboss.com/index.html?module=bb&op=viewtopic&t=93920

            It suggest to use jboss-portlet.xml to inject the headers, but but still no reply yet.

            Cheers.