aspose file tools*
The moose likes JSP and the fly likes how to restrict the user to see the authorised page Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "how to restrict the user to see the authorised page" Watch "how to restrict the user to see the authorised page" New topic
Author

how to restrict the user to see the authorised page

Manoj semwal .
Ranch Hand

Joined: Jul 10, 2008
Posts: 34
hai

My Question is how to restrict the unauthorised user to see the authorised page through URL. access. in jsp.
[ July 12, 2008: Message edited by: manoj Rksh ]
Rajkumar balakrishnan
Ranch Hand

Joined: May 29, 2008
Posts: 445

use security constraints.. Open your web.xml file and Just put the folder name between the tags. So the user can't able to access the privileged pages.That's it...


Never try to be a hard-worker. Be a smart-worker.
My Blog
Manoj semwal .
Ranch Hand

Joined: Jul 10, 2008
Posts: 34
Thanks rajkumar for your kind reply
actually iam new in jsp .
i never used web.xml file so pl tell me in breifly.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41574
    
  54
Servlet security and the web.xml file are both big topics - too big to cover in a post here. My advice would be to get an introductory servlet/JSP book, e.g. Head First Servlets/JSP. You could also read up on these concepts in the servlet specification, and study the examples that come with a servlet container like Tomcat.

In the future, please CarefullyChooseOneForum; this one is about JDBC. I'll move it to a more appropriate forum.


Ping & DNS - my free Android networking tools app
Manoj semwal .
Ranch Hand

Joined: Jul 10, 2008
Posts: 34
hai ulf

in my web.xml file
<security-constraint>
<web-resource-collection>
<web-resource-name></web-resource-name>
<url-pattern>/*</url-pattern>
</web-resource-collection>

</security-constraint>
in the above coding where i have to give the folder or file name to restrict to anauthorised person.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41574
    
  54
That would be the url-pattern (of which there can be multiple). "/*" protects everything, but you can be more specific.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to restrict the user to see the authorised page