# Index.jsp Sample

This topic inludes the source code for the Index.jsp Sample.

## Sample Location

This sample is located in the following directory in your WebLogic Workshop installation:

BEA_HOME/weblogic81/samples/workshop/SamplesApp/WebApp/security/

## Sample Source Code

`01 <%@ page language="java" contentType="text/html;charset=UTF-8"%> 02 <%@ taglib uri="netui-tags-databinding.tld" prefix="netui-data"%> 03 <%@ taglib uri="netui-tags-html.tld" prefix="netui"%> 04 <%@ taglib uri="netui-tags-template.tld" prefix="netui-template"%> 05 <netui:base /> 06 <netui:html> 07 <head> 08 <title> 09 Web Application Samples: Security 10 </title> 11 <link href="/WebApp/resources/css/style.css" type="text/css" rel="stylesheet"/> 12 </head> 13 <body> 14 <jsp:include page="/resources/jsp/header.jsp"/> 15 <h3>Page Flow Samples: Security</h3> 16 <p>These samples show how to set up a login mechanism and role-based security.</p> 17 <p>Two kinds of login mechanisms are shown: (1) form-based login and (2) "shopping-cart" login. 18 <p>Form-based login 19 is useful when you want to restrict every part of a Page Flow from users. This sort of login mechanism 20 relies on configured security restrictions in the /WEB-INF/web.xml file. 21 <p>"Shopping-cart" login is useful when you want to allow non-logged in users to access some parts of 22 Page Flow, but allow only logged in user to access other parts. For instance, you might want to allow 23 non-logged in users to browse the product catalog, but only allow logged-in users to procede to the check-out 24 page. 25 <blockquote> 26 <hr> 27 <p><a href="/WebApp/security/formBasedLogin/formBasedLoginFlow/formBasedLoginFlowController.jpf"> 28 Form-based Login</a> 29 <p>Source code: SamplesApp/WebApp/security/login/formBasedLogin/ 30 <hr> 31 <p><netui:anchor action="toShopping">"Shopping Cart" Login</netui:anchor> 32 <p>Source code: SamplesApp/WebApp/security/shoppingCartLogin/ 33 <hr> 34 <p><netui:anchor action="toRoleBased" > 35 Role-based Security: filtering user access based on role membership 36 </netui:anchor> 37 <p>Source code: SamplesApp/WebApp/security/roleBasedSecurity/ 38 </blockquote> 39 <hr> 40 <p><netui:anchor action="toPageFlowSamples">Back to Web Application Samples Home</netui:anchor> 41 </body> 42 </netui:html>`