Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

j_security_check issue  RSS feed

 
Andy Hahn
Ranch Hand
Posts: 225
  • Mark post as helpful
  • send pies
  • 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.
 
Jose Zaleta
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!