4 Replies Latest reply on Mar 6, 2007 3:10 PM by fahlen

    CSS & header injection

    fahlen

      I have managed to inject the following line of HTML into the portlet HTML header using the file jboss-portlet.xml:

      <link type='text/css' rel='stylesheet' href='/ProcesosInternos/WEB-INF/css/Styles.css' />
      


      The content of jboss-portlet.xml is this:
      <portlet-app>
       <portlet>
       <portlet-name>DatosPersonalesPortlet</portlet-name>
       <header-content>
       <link rel="stylesheet" type="text/css"
       href="/WEB-INF/css/Styles.css" />
       </header-content>
       </portlet>
      </portlet-app>
      


      However, the CSS isn't applied to the content of the JSP page to which the portlet redirects the browser request, so I'm certain it must be the path of the CSS file which isn't correct.

      I'm sure the problem and solution are very very basic, but they eludes me at the moment. Any help would be grately appreciated.

      Thanks,
      Mark

        • 1. Re: CSS & header injection
          antoine_h

          you may have to add the servlet root path, of the servlet (webapp) that deliver the css file.

          did you try it ?

          that is :
          /ProcesosInternos/WEB-INF/css/Styles.css

          instead of "ProcesosInternos", it should rather be the name of the web app.
          the <display-name> that is in the web.xml file.

          sometime, there must be a "_" before the name.
          /_ProcesosInternos/WEB-INF/css/Styles.css

          you can look in one of the html page that is produce by the portal, how it is done for the layout css file. See there how it is written for those layout and theme css files.


          • 2. Re: CSS & header injection
            fahlen

            Thank you for your reply. The name ProcesosInternos, actually is the name of my web application. I've tried changing the path for the CSS in all kinds of ways, but to no avail. If I find what I'm doing wrong, I'll let you know...

            • 3. Re: CSS & header injection
              theute

              Your style.css shouldn't be in the WEB-INF since it is not accessible from "outside".

              Move the cc directory to the root of your war and do

              <link type='text/css' rel='stylesheet' href='css/Styles.css' />
              


              • 4. Re: CSS & header injection
                fahlen

                Thank you!