• 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
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

Restricting JSP page to get access directly

 
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

In my application i have jsp pages outside the WEB-INF directory. I can access the a particular jsp page typing its URL directly in address bar. How can i restrict it.

I can't move all JSP into WEB-INF folder as they are in large number and also have dependency of path.

Any help is appreciated!!!
 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I dont think the standard is to have JSP pages inside the WEB-INF/ folder. Then again why put JSP pages in WEB-INF folder, cos it is there for you lib, classes and tlds.

How ever if you are trying to secure the files then you can add a value to your session object and check it on every page that should not be accessed by the browser and forward to an appropriate page if the value not found. That is what I do ..

how ever there are lots of other methods .. read this thread.. http://forums.sun.com/thread.jspa?messageID=2959387
 
vk jain
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can you please elaborate this solution a little. when should i add a attribute in session. Is it at time of login or ?
 
Ranch Hand
Posts: 140
Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
you could write a security-constraint in the DD for the pages you want to have restricted access.
 
Sheriff
Posts: 67637
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by cj jayamaha:
I dont think the standard is to have JSP pages inside the WEB-INF/ folder.

Incorrect. It is very common to place the JSP page under WEB-INF so that they can only be accessed via their page controllers and not by direct URL access.

...cos it is there for you lib, classes and tlds.

Please use real words when posting to the forums. Abbreviations such as "cos" in place of "because" only serve to make your posts more difficult to read and less likely to generate useful responses. Please read this for more information.
 
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think the best solution for your situation is to insert in the DD a security constraint, with the <auth-constraint/> tag just in that way.
 
vk jain
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks a lot Victor,
Its work.
 
Heroic work plunger man. Please allow me to introduce you to this tiny ad:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic