Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7959295
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T04:33:04+00:00 2026-06-04T04:33:04+00:00

I am developing an web application in Spring MVC Framework with Eclipse Europa IDE

  • 0

I am developing an web application in Spring MVC Framework with Eclipse Europa IDE and Tomcat server

My directory structure is(partial):

- WebContent  
    - WEB-INF  
        - pages  
            - CSS  
            - images  
            - login.html  
        - dispatcher-servlet.xml  
        - web.xml  

In my login.html I have a link to a css file as

<link rel="stylesheet" type="text/css" href="CSS/loginregister.css" media="screen">

Since my login.html and CSS folder are in the same folder “pages” I thought this would work.
But NO. The css file didn’t load (login.html appears smoothly)

I also tried:

<href=”/CSS/loginregister.css”>
<href=”pages/CSS/loginregister.css”>

I am accessing the login.html via my controller class.
my URL comes like this: http://localhost:8080/AccountCreation/login.htm

Can any one tell me where is the problem ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T04:33:05+00:00Added an answer on June 4, 2026 at 4:33 am

    Move your “pages” folder to be under WebContent instead of WEB-INF. JSP pages shold be protected under WEB-INF but not static files like css, js, html.

    The root of your application context is WebContent which would be referenced as

    http://server.com/contextroot/
    

    Best practise would say to create a folder WebContent/css and place your file loginregister.css in there. Your link will then be

    <link rel="stylesheet" type="text/css" href="css/loginregister.css" media="screen"> 
    

    To test, you can simply enter the following URL in your browser to ensure that the css file is being served from your context root as expected

    http://server.com/contextroot/css/loginregister.css
    

    [EDIT]

    For your initial testing, also place your login.html in WebContent (e.g. WebContent/login.html) as well, however you have mentioned you’re using Spring so you’ll probably end up replacing login.html with an equivalent JSP.

    http://server.com/contextroot/login.html
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am developing a Spring (Java framework for server-side web-development)web application, which will respond
We are developing a web application using Spring framework and Hibernate ORM. As far
I am using Spring Web MVC and Hibernate for developing my application. My login.jsp
I'm developing a web application on Apache Tomcat 6 with Hibernate and Spring, I'm
I am developing a web application using Spring and Tomcat 7.0. When I test
I am developing my application using spring-web-mvc... Now at my Controller it returns like
I am developing an application in Spring Web MVC where i need to execute
I am developing a Java Web application with Spring MVC and I am having
Which is the best base java IDE (eclipse, Netbean) for developing spring based application
I am developing an ASP.Net MVC 3 Web application with Entity Framework 4. When

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.