aspose file tools*
The moose likes JSF and the fly likes problem with css Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "problem with css" Watch "problem with css" New topic
Author

problem with css

Naresh Chaurasia
Ranch Hand

Joined: May 18, 2005
Posts: 357
Hi i have following jsp code

Login.jsp




css code





when the Login.jsp loads for the first time, the back ground color is not changed as in style sheet. But if i hit submit the color changes.....

can some one pls tell what mistake i am doing......I am making use of Tomcat 5.x


SCJP 1.4, SCWCD1.4, OCA(1Z0-007)
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18910
    
    8

I don't know what "hitting submit" means in the context of your application. But it is probably connecting to a URL for which the relative pathactually points to your CSS file, and your original URL does not do that.
Richard Green
Ranch Hand

Joined: Aug 25, 2005
Posts: 536
<link href="../css/styles.css" rel="stylesheet" type="text/css"/>


try this instead:-

<link href="<%=request.getContextPath()%>/css/styles.css" rel="stylesheet" type="text/css"/>


MCSD, SCJP, SCWCD, SCBCD, SCJD (in progress - URLybird 1.2.1)
 
jQuery in Action, 2nd edition
 
subject: problem with css