Using Container Security in Application

text zoom

Using Container Security in Application

Once we define the username and password we need to map the security in the web.xml file of the web application. The following is the code need to be added in web.xml file for the same.

<?xml version =" 1.0 " encoding =" UTF-8 "?>

<web-app version =" 2.4 " xmlns =" " xmlns:xsi =" " xsi:schemaLocation =" ">



application </web-resource-name>




admin </role-name>




BASIC </auth-method>

securityapp </realm-name>



Testing the Application Security </description>

admin </role-name>



When we call any jsp page in the application then it will prompt for username and password and following screen will be displayed before the actual jsp page. If you supply the wrong credntials then it will not deisplay the page


Copyright © 2015 VisualBuilder. All rights reserved