Uploaded image for project: 'Spring Roo'
  1. Spring Roo
  2. ROO-111

It is better to avoid using @import to include css in JSP files generated by ROO

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.0.0.M2
    • Fix Version/s: 1.0.0.RC1
    • Component/s: WEB MVC
    • Labels:
      None
    • Environment:
      Ubuntu Linux 9.04 Jaunty Jackalope Desktop 64bit (yet it has nothing to do with the issue).

      Description

      The JSP files generated by Spring ROO use @import to include cascading style sheets (CSS) just like below.
      <style type="text/css" media="screen">
      @import url("<c:url value="/resources/dojo/resources/dojo.css"/>");
      @import url("<c:url value="/resources/dijit/themes/tundra/tundra.css"/>");
      @import url("<c:url value="/static/styles/roo.css"/>");
      </style>

      This might negatively affect the web page performance. Thus it is recommended to use 'link' instead.
      e.g.)
      <link rel="stylesheet" type="text/css" href="/resources/dojo/resources/dojo.css" />
      (I don't think this example is necessary though. )

      The following article explains the details of what performance issues may occur when using @import.
      http://www.stevesouders.com/blog/2009/04/09/dont-use-import/

      Regards,
      Kevin

        Attachments

          Activity

            People

            Assignee:
            sschmidt Stefan Schmidt
            Reporter:
            kevinshlee Kevin SeongHyun Lee
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: