PDA

View Full Version : page loading problem with css


Karthik M
May 18th, 2007, 12:19 AM
Hi all,
Iam getting a stupid error in my application.The error is that the styles is not applying when i navigate from one page to other page through a spring controller.But if open the second page directly iam getting along with the css.Iam unable to identify the reason.

return new ModelAndView(successView, model);

successview tells the jsp page and model is the map with my entities.Functionally it is working fine.Can anyone answer me?

Regards,
Karthik

fuzziman
May 18th, 2007, 05:04 AM
can you provide more information? are you using inline styles or external stylesheets? what is the HTML output? exactly what is not loading? have you used firefox firebug or web developer toolbar to see why styles not applied if they did load?

Karthik M
May 18th, 2007, 05:17 AM
Hi,
Thanx for your reply.Iam using external stylesheet.I tried inside <style> tag with the same content of the css file in the same jsp and found working properly.But if i use external css file using <link> tag,the styles for the textbox,link styles are not loading while i navigate to the page from some other page.But its working fine when i hit directly the jsp page even when i use external css file.
I havent tried any firefox firebug since iam unaware of that.
Hope you understand my problem,expecting a better solution.
Regards,
Karthik

fuzziman
May 18th, 2007, 05:35 AM
i suspect it is not a spring problem... sorry if you've done this already but try doing a diff of the html source of the working one and the non-working one. Also, if you are doing any CSS work, consider using firefox with the "Web Developer Toolbar" and "Firebug" plugins, i consider them essential. If you have IE7, there's "internet explorer devloper toolbar" good luck

Steve O
May 18th, 2007, 11:24 AM
Karthik,

Where do you have your css file stored? I believe that, if you your css is stored behind your WEB-INF folder, that you will be unable to access it.
<link rel="stylesheet" href="/appname/themes/mystyles.css" type="text/css" media="screen"/>Steve O

Karthik M
May 18th, 2007, 04:28 PM
Hi,
Thanks for your reply.But i guess iam not coveying the issue properly.Ok let me do it again.
See iam having the css file outside my WEB-INF directory.Lets say two jsps
First.jsp and Second.jsp.When i load my Second.jsp directly through the url it is
loading along with my css file.But when i navigate from First.jsp to Second.jsp
through a spring controller,the Second.jsp is loading without css file styles.
Thats the thing makes me to suspect spring.Iam not using any theme resolver.Please
kindly check and suggest me.Iam really breaking my head.If i use jsp include inside <style> tag it is loading.
Hope you get this time,expecting a better solution.

Thanks and Regards,
Karthik