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 7861135
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T22:34:39+00:00 2026-06-02T22:34:39+00:00

I downloaded login template which uses css and JavaScript. When I start it in

  • 0

I downloaded login template which uses css and JavaScript. When I start it in default html format it displays ok, but when I put the same code to my Spring MVC 3 app and change format to jsp, javascript part is disabled. I can access external js files through my web browser, so I don’t know where may be the problem.

This is the right look:
right

but this is what i get:
wrong

<script language="javascript" type="text/javascript" src="js/niceforms.js"></script>
<link rel="stylesheet" type="text/css" media="all" href="css/niceforms-default.css" />

I only changed the location of external js and css resources but these files are accessable as I said.

This is my structure:

enter image description here

In my web.xml I have these lines:

<!-- The definition of the Root Spring Container shared by all Servlets and Filters -->
<context-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>
        /WEB-INF/spring/root-context.xml,
        /WEB-INF/spring/security-context.xml,
    </param-value>
</context-param>

<!-- Creates the Spring Container shared by all Servlets and Filters -->
<listener>
    <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>

<!-- Processes application requests -->
<servlet>
    <servlet-name>appServlet</servlet-name>
    <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
    <init-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>/WEB-INF/spring/appServlet/servlet-context.xml</param-value>
    </init-param>
    <load-on-startup>1</load-on-startup>
</servlet>

<servlet-mapping>
    <servlet-name>appServlet</servlet-name>
    <url-pattern>/</url-pattern>
</servlet-mapping>

<!-- Spring Security -->
<filter>
    <filter-name>springSecurityFilterChain</filter-name>
    <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
</filter>

<filter-mapping>
    <filter-name>springSecurityFilterChain</filter-name>
    <url-pattern>/*</url-pattern>
</filter-mapping>

<servlet-mapping>
    <servlet-name>default</servlet-name>
    <url-pattern>*.css</url-pattern>
</servlet-mapping>
<servlet-mapping>
    <servlet-name>default</servlet-name>
    <url-pattern>*.js</url-pattern>
</servlet-mapping>
<servlet-mapping>
    <servlet-name>default</servlet-name>
    <url-pattern>*.gif</url-pattern>
</servlet-mapping>
<servlet-mapping>
    <servlet-name>default</servlet-name>
    <url-pattern>*.jpg</url-pattern>
</servlet-mapping>
<servlet-mapping>
    <servlet-name>default</servlet-name>
    <url-pattern>*.png</url-pattern>
</servlet-mapping>
<servlet-mapping>
    <servlet-name>default</servlet-name>
    <url-pattern>*.txt</url-pattern>
</servlet-mapping>

I also use Apache tiles2

<tiles-definitions>
<definition name="base.definition" template="/WEB-INF/views/layout/layout.jsp">
    <put-attribute name="body" value="" />
</definition>

<definition name="contact" extends="base.definition">
    <put-attribute name="body" value="/WEB-INF/views/contact.jsp" />
</definition>

<definition name="login" template="/WEB-INF/views/login/login.jsp">
</definition>

Thanks.

Edit:

I know where is the problem now, but still don’t know how to solve it… Problem is in paths in external css files. I have something like this: body {background-image:url('images/bg.jpg');} but I get not found error in firebug because it tries to find the resource in localhost:8080/sheedo/css/images/bg.jpg and when I set absolute path of resource like body {background-image:url('/images/bg.jpg');} I get the same error too but it tries to find it in localhost:8080/images/bg.jpg. When I use ./images/bg.jpg it’s ok, but does exist any other solution instead of rewrite all paths in css files? I mean something like <mvc:resources ... > is it possible ?

  • 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-02T22:34:41+00:00Added an answer on June 2, 2026 at 10:34 pm
    <script type="text/javascript" src="${pageContext.request.contextPath}/js/niceforms.js"></script>
    <link href="${pageContext.request.contextPath}/css/niceforms-default.css" rel="stylesheet" />
    

    Use the above code.. You need to specify it dynamically, not statically..

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I downloaded a WPFToolkit source, because I wanted to override the default generic template
I downloaded the PhotoView reference app for Win7 with source. The app works, but
I downloaded Axis 1.4 ( http://www.nic.funet.fi/pub/mirrors/apache.org/ws/axis/1_4/ ) and I wanted to use WSDL2Java, but
I downloaded Twitterizer, read documentation, downloaded the samples but as I'm working with MVC3,
So, I downloaded Tank Auth, and put it in my CodeIgniter libraries folder... Now
I am using the Flask micro-framework which is based on Werkzeug, which uses Python.
I downloaded the sample ASP.NET login page from here: https://wiki.jasig.org/display/CASC/ASP.NET+Forms+Authentication And got CAS working
Normally pages that have a login form can be downloaded with wget --no-check-certificate --save-cookies
Hello I want to added a pop-up login screen using downloaded code. However the
I have downloaded PSCP from: http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html and added it to the PATH in windows

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.