• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

j_security_check issue

 
Ranch Hand
Posts: 225
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, I am using j_security_check for security. It is working as expected except for one small issue - Images I have on my login page are not displaying. Has anyone ever had this happen? I am thinking the reason might be that the images are being restricted. Any help would be appreciated!

Thanks.
 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Andy,

I don't quite get the issue here. Before trying the j_security_check, did you try the web page? Did you see the images then?

A good approach is to link images with the whole path like:
/<context-path>/<img-location>
like:
/javaranch/img/sample.gif

How are you making this references?
 
Andy Hahn
Ranch Hand
Posts: 225
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The images were working before I added the j_security_check. I always use relative paths, ex. img src = "images/submit.bmp".
I did read another article that said it might be caused because I am restricting the image files. The image files would be restricted until the usere successfully logged in. I haven't found any great documentation on j_security_check or configuring the web.xml for j_security_check. Any ideas?
 
Andy Hahn
Ranch Hand
Posts: 225
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think I got it working now. To fix, I changed this pattern in web.xml:

<url-pattern>/*</url-pattern>

To this:

<url-pattern>*.jsp</url-pattern>


This allows other objects (css, js, images) to be loaded.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic