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

preventing direct access to JSP pages  RSS feed

 
k mut
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what if a user types in the direct jsp page into the browser www.xamplesite.com/xample.jsp

No STRUTS action will be called, so that wont work.
how can i take care of it.I doesn't want to go thru menu.
nothing need to be submitted in that jsp page
just i need to call the struts action that gets datas from database, so the user will get updated information and the i wont verify any authentication for user this is just for some known user.
[ November 08, 2005: Message edited by: Bear Bibeault ]
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can:
  • Put all of your JSP in a directory under WEB-INF
  • Write a filter with a mapping for '*.jsp' to catch any such requests.

  •  
    k mut
    Greenhorn
    Posts: 16
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    i want to know how to write a filter
    currently all jsp are under WEBINF
     
    Bear Bibeault
    Author and ninkuma
    Marshal
    Posts: 65824
    134
    IntelliJ IDE Java jQuery Mac Mac OS X
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    currently all jsp are under WEBINF


    That should be WEB-INF. And if that is the case, then no direct access as you describe is possible.

    I always place my JSP pages under WEB-INF.

    Your question really has nothing at all to do with Struts so I have changed the subject to something more appropriate.
    [ November 08, 2005: Message edited by: Bear Bibeault ]
     
    k mut
    Greenhorn
    Posts: 16
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    What is it?
    some how i need to access the action.
     
    Bear Bibeault
    Author and ninkuma
    Marshal
    Posts: 65824
    134
    IntelliJ IDE Java jQuery Mac Mac OS X
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    "k mut",

    I noticed that you have also posted this question in the Servlets forum, and it has since been moved to the Struts forum due to your poor use of subject.

    Please do not cross-post the same question in multiple forums. It wastes people's time when multiple redundant conversations take place.

    This topic is now closed. Please continue any discussion in your other post which has been moved to the Struts forum.
    [ November 08, 2005: Message edited by: Bear Bibeault ]
     
    Consider Paul's rocket mass heater.
    • Post Reply Bookmark Topic Watch Topic
    • New Topic
    Boost this thread!