This is my folder structure in eclipse . I'm attaching a screen shot of the same .
As you see I have two jsp files in the pages folder one is search.jsp and the other ConsumerAddEdit.jsp
I reference my css called CIS.css placed in the css folder .
In search.jsp , I reference it using --
But , this doesnt work in ConsumerAddEdit.jsp and I have to modify it to
The best thing you could do is ... export it as war...and then extract it using some 7zip or winrar...and then see the directory structure
. indicates present directory
.. indicates parent directory
Hence relative to pages directory where you placed the JSP... css folder belongs to .. (parent) directory. So you should use ..
And if you are planning to use that css in test.jsp, go ahead with a single dot or no dot.
@Vic : check whether the second method works in the first case. According to your current situation the second seems to be the best option. But if you have moved your Search.jsp from context root to the pages folder then it might be a case that the browser is using the cache page. Modifying the page and then doing view source on browser might show you whether browser is using the page from pages folder or from its cache.
P.S the first method is fine if the page is directly under context root. Also as @Bear pointed out the URL should be server relative.