I've written a webapp that uses a css stylesheet and jquery. I've gotten both of them loaded and working outside of spring to make sure that the layouts are correct and functions work.
However, when loading them in spring, I get 404 when the app attempts to resolve the urls used to pull them in. I'm using Firebug to view the CSS, and this is where the 404 comes from...the app is working fine other than that.
I've checked a lot of different things, and it all looks the same as what I've done before but I just can't figure out why Spring won't load these files. I was hoping someone might be able to give me some pointers.
The style folder is located at WEB-INF/style
The jsps are located at WEB-INF/jsp/<various folders>/*.jsp
My jsp code in question:
I've also tried the src and href as "/style/<filename>" but that didn't work either.Code:<html> <head> <link rel="stylesheet" href="style/stylesheet.css" type="text/css"> <script src="style/jquery.js" type="text/javascript" charset="utf-8"></script> <script type="text/javascript"> $(document).ready(function() { $("iframe").load(function() { this.style.height = this.contentWindow.document.body.offsetHeight + 'px'; }); }); </script> </head>
The only difference between this app and others I've done is that I'm using a SimpleUrlHandlerMapping....I'll go ahead and include relevant code for that:
I was thinking that maybe the SimpleUrlHandlerMapping was the issue but it should only apply to files that are located in WEB-INF/jsp, right?Code:<bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver"> <property name="prefix" value="WEB-INF/jsp/" /> <property name="suffix" value=".jsp" /> </bean> <bean id="urlMapping" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping"> <property name="mappings"> <props> <prop key="/indexatl.htm">AtlysCommController</prop> <prop key="/login.htm">LoginController</prop> <prop key="/atlyscomm.htm">AtlysCommController</prop> </props> </property> </bean> <bean id="viewMapController" class="com.cellularsouth.model.UrlHandler"> <property name="viewMap"> <map> <entry key="indexatl.htm" value="atlcomm/index" /> </map> </property> <property name="defaultView" value="index" /> </bean>
I'm so confused....any help would be greatly appreciated.
Thanks,
Brian French


Reply With Quote
