This week's book giveaway is in the Java 9 forum.
We're giving away four copies of Java 9 Modularity: Patterns and Practices for Developing Maintainable Applications and have Sander Mak & Paul Bakker on-line!
See this thread for details.
Win a copy of Java 9 Modularity: Patterns and Practices for Developing Maintainable Applications this week in the Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

problem with css  RSS feed

 
Naresh Chaurasia
Ranch Hand
Posts: 361
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Paul Clapham
Sheriff
Posts: 22681
43
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 536
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<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"/>
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!