• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Very strange behaviour with form based login and css file

 
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using form-based authentication in my JSF webapp and everything was working fine. Until I wanted to enhance the login page to look like the rest of the application - it's only html code, no JSF or JSP tags. However the problem is with the css file and it has 2 levels:
a)the css classes are not loaded at all - everything is plain white with black text
b)when I provide my credentials and hit enter or press the submit button, the pages goes to my css file!!! The url path changes to the css file and I see the file content with classes etc.

Here is my login page:



I wanted to edit the classes for input methods I don't know if this causes the problem (however since the classes are not loaded at all I don't think so):



I tried changing the login file extension from loginpage.jsp to loginpage.html but this did not help. If I delete the link to the css file from page header problem 2 disappears (obviously problem 1 remains). I l have also tried to put all css files in the header <style> tag but then after login, the page redirects to of the pictures used in the css as a background-image. How can I load the css files to the login page?
 
Adam Kronicki
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The solution is to change the protected url pattern from /* to i.e. *.faces
 
Saloon Keeper
Posts: 22272
151
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There's a chicken-and-egg problem when you attempt to access protected JavaScript and CSS resources from a login page. Since they're protected, you can't get them until you're logged in. But if the login page itself requests protected resources, you're not yet logged in. Eek.
 
Oh. Hi guys! Look at this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic