• 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

web security : doubt

 
Ranch Hand
Posts: 310
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can we specify <security-constraint> to a particular folder?

HFSJ says yes.
But its not working to me.
I have a class SelectBeer under WEB-INF/classes/com/example/web.

here is my security constraint part of web.xml


but its not working.
i tried this also
<url-pattern>/classes/com/example/web/*</url-pattern>

but still its not working.

Please tell me how i make security constraint to all the files in that folder WEB-INF/classes/com/example/web.
 
Sreeraj G Harilal
Ranch Hand
Posts: 310
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Here is my full web.xml file



browser request
http://localhost:8080/HFSJ/SelectBeer.do
 
Ranch Hand
Posts: 563
Google Web Toolkit Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
duh !
the path you specified in the <url-pattern> element is wrong.
What is the fully-qualified class name doing here ?
I suggest that you check the rules regarding URL mapping.
 
Ranch Hand
Posts: 643
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
First of all
<security-role>
<role-name>admin</role-name>
</security-role>

is missing

Try
<url-pattern>/SelectBeer.do</url-pattern> inside <security-constraint>
 
Sreeraj G Harilal
Ranch Hand
Posts: 310
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


First of all
<security-role>
<role-name>admin</role-name>
</security-role>

is missing

Try
<url-pattern>/SelectBeer.do</url-pattern> inside <security-constraint>



There is no need to specify <security-role> here(DD).
I know this url pattern(<url-pattern>/SelectBeer.do</url-pattern>) will work.

But my doubt is HFSJ says (Page number 634) we can specify directories with constraints.

Please try to clear my doubt.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic