Announcement Announcement Module
Collapse
No announcement yet.
CSS Found, But Not Applying to Rendered Page Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • CSS Found, But Not Applying to Rendered Page

    Hello, all...I'm having a problem I just can't seem to figure out.

    First, I've used Spring for some time but am completely new to the MVC portion...I've decided to port from Struts 1.2.x to Spring's MVC for my current application (with my eye on the WebFlow project as well).

    Here's what I'm using:
    Spring 1.2 RC1
    SiteMesh 2.2

    I've started out very simple. The directory structure is fairly standard:

    \webcontent\
    \jsp
    \images
    \decorators
    \styles
    \scripts

    etc. etc.

    The problem is that my application seems to be serving up the CSS, but not applying it...I say it's finding it simply due to a) the generated source looks good and b) using FireFox's "WebDeveloper" extension to "View CSS" brings up the correct file....but the resulting page is definitely NOT styled. It was working fine when Struts was in the picture...but I'm sure it's probably something I have wrong in my configuration, I'm guessing.

    I'm still going to search the forums/JIRA/etc. for answers, but I've been working on this for quite a little while.

    Here are the meaningful configurations:

    spring-servlet.xml
    <bean id="messageSource" class="org.springframework.context.support.Resourc eBundleMessageSource">
    <property name="basename">
    <value>messages</value>
    </property>
    </bean>
    <bean id="viewresolver" class="org.springframework.web.servlet.view.Intern alResourceViewResolver">
    <property name="viewClass" value="org.springframework.web.servlet.view.JstlVi ew"/>
    <property name="prefix" value="/jsp/" />
    <property name="suffix" value=".jsp" />
    </bean>

    <bean id="simpleController" class="web.controller.SimpleController"/>


    <bean id="urlMapping" class="org.springframework.web.servlet.handler.Sim pleUrlHandlerMapping">
    <property name="mappings">
    <props>
    <prop key="/home.html">simpleController</prop>
    </props>
    </property>
    </bean>

    Sitemesh is configured to handle all URLs (/*). It composes the page right (correct placement of header/footer/etc)....just the CSS seems to be getting "lost" somehow.

    Anyone have any ideas/insight? Anything appreciated!

    [/i]

  • #2
    Anyone have any ideas
    Try viewing the HTML page source, and check that the stylesheet href can be hit directly with the browser. Maybe sitemesh is decorating your CSS.

    Comment


    • #3
      Yeesh

      Stupidest...post...ever. Thanks for the insight, katentim, but I found it, and am chagrined I don't have enough access to these forums to delete the post

      Simple matter of forgetting to include doctype def in the default sitemesh config...firefox rendered it almost correctly, IE completely choked on it. Nothing to see here, move along [/i]

      Comment

      Working...
      X