On Wednesday 08 April 2009 17:24:16 Anton Berg wrote: > Hello, > > I have a simple JSP that is served by jboss (4.2.3-GA) under ubuntu linux. > A stylesheet is used in the header of the jsp. > > If I use a konqueror browser the css styles are loaded. If I use the > firefox (3.08) which is actually my standard browser the stylesheet is not > loaded. Generally the stylesheets are loaded correctly in firefox only if I > load the struts-jsps from my local machine I get this problems. Any ideas ? >
A few quick thoughts as I've had similar problems. Make sure that the app server is serving the CSS with the right content-type header. It seems to me that between FF 2 and FF 3, firefox became less forgiving of the css file's content-type header. I think I had an app where I was using s2 tags in the CSS (for pointing to images, etc.) and since the JSP compiler was mapped to look at them, it was setting the content-type to text/html. Somewhere along the line, this quit working. Another thing to check for is whether the app server is appending it's jsessionid=blahblahblah; stuff to the s:url you are using to point to the css file. I've had that problem as well. Last thing, in FF, go to the Error Console. It displays CSS errors, you might find an interesting pointer in there as to why it's ignoring your CSS file. -Wes > > I've shortened the files just to show the problem: > > JSP > > <%@ page contentType="text/html; charset=UTF-8" %> > <%@ taglib prefix="s" uri="/struts-tags" %> > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 > Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> > <html> > <head> > <meta http-equiv="Content-Type" content="text/xml; charset=UTF-8"> > <link rel="stylesheet" type="css/text" media="screen" href="<s:url > value="/css/bpportal.css"/>" /> > <title>Sign on</title> > </head> > <body> > <h4>Bitte Loginname und Passwort eingeben</h4> > <div class="test"> > <s:form action="/portal/Login.action"> > <s:textfield label="Loginname" name="username"/> > <s:password label="Passwort" name="password" /> > <s:submit/> > </s:form> > </div> > </body> > </html> > > > CSS > > body,html { > font-family: Arial, Helvetica, sans-serif; > font-size: 100.01%; > margin: 0; > padding: 0; > text-align: left; > } > > .test { > background: #ccc; > } > > --------------------------------------------------------------------- > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > For additional commands, e-mail: user-h...@struts.apache.org -- Wes Wannemacher Author - Struts 2 In Practice Includes coverage of Struts 2.1, Spring, JPA, JQuery, Sitemesh and more http://www.manning.com/wannemacher --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org