Click here to Skip to main content
15,891,981 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i have made a little webapp in Java using jsp and am having a little problem with Login Authentication..

1. i have 4 different users. have 4 tabs in a jsp page

2. i need to give them the limited access to Tabs.

eg-director (can see all the tabs)
officer 1 (can see only have accesses to 3 of tabs )
officer 2 (can see only have accesses to 2 of tabs )
officer 3 (can see only have accesses to 1 of tabs )

it is like a security clearance
i tried to so many ways and failed and i am thinking to do that with passing a Boolean to Database and give the access levels
for that i need a help if it is with a small sample log in project that will be very help full for me

HTML
<%@page import="java.text.SimpleDateFormat"%>
<%@page import="java.util.Date"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
        <script src="js/kickstart.js"></script> <!-- kick Start JS -->
        <link rel="stylesheet" href="css/kickstart.css" media="all" /> <!--  -->
        <link rel="stylesheet" href="css/fonts/fontawesome/css/font-awesome.min.css" rel="stylesheet">
        <link rel="stylesheet" href="css/fonts/fontawesome/ss/font-awesome.css.css" rel="stylesheet">
        <link rel="shortcut icon" href="logo.png" type="image/x-icon" /> 

        <title>Reprint</title>
        <script>
            function addDate1() {
                date1 = new Date();
                var month = date1.getMonth() + 1;
                var day = date1.getDate();
                var year = date1.getFullYear();

                if (document.getElementById('date1').value == '') {
                    document.getElementById('date1').value = year + '-' + month + '-' + day;
                }
            }
            function addDate() {
                date = new Date();
                var month = date.getMonth() + 1;
                var day = date.getDate();
                var year = date.getFullYear();

                if (document.getElementById('date').value == '') {
                    document.getElementById('date').value = year + '-' + month + '-' + day;
                }
            }
        </script>
        <style type="text/css">
            .btn_hover:hover{

                color: darkblue ;
            }

        </style>
    </head>
    <body  önload="addDate();
                addDate1()" style="background-color: aliceblue;" >
        <table align="" border="1">
            <tr align="">
                <td  >
                    <h3 align="center" >Reprint Request Form <img  src="sarasavi.png" />  </h3>
                        <%
                            Date dNow = new Date();
                            SimpleDateFormat ft = new SimpleDateFormat(" yyyy.MM.dd");
                            out.print("<h4 align=\"center\">" + ft.format(dNow) + "</h4>");
                        %>  

                </td>

            </tr>
            <tr>
                <td>
                    <h6 >
                        Enter ISBN or Scan the Barcode 
                    </h6>
                    <input id="isbn" type="text" placeholder="ISBN "/>

                </td>
            </tr>

        </table>

        <table border="1">
            <tr>
                <td>
                    <ul class=" tabs left  " >
                        <li><a href="#tabr1" >Stores</a></li>
                        <li><a href="#tabr2">Publishing Department</a></li>
                        <li><a href="#tabr3">Printing Department</a></li>
                        <li><a href="#tabr4">Director</a></li>
                    </ul>
                    <!-- End Tabs -->

                    <!-- Stores -->
                    <form action="####" method="Post"> 
                        <div id="tabr1" class="tab-content">
                            <!-- HALF & HALF -->

                            <div class=" col_6">
                                <label for="text1" style=" font-size: 16px;">Title  </label><br/>
                                <input id="text1" type="text" placeholder="Title" style="width: 355px; height: 28px;" /><br/><br/>
                                <label for="text2" style=" font-size: 16px;">Author  </label><br/>
                                <input id="text2" type="text" placeholder="Author" style="width: 355px; height: 28px;" /><br/><br/>
                                <label for="text3" style=" font-size: 16px;">Price   </label></span> <br/>
                                <input id="text3" type="text" placeholder="price" style="width: 95px; height: 28px;" /><br/><br/><br/>

                                <!-- Radio -->
                                <label style=" font-size: 16px;">Move</label><br/><br/>
                                <input type="radio" name="radio" id="radio1" />
                                <label for="radio1" class="inline">Fast</label><br/>
                                <input type="radio" name="radio" id="radio2" />
                                <label for="radio2" class="inline">Medium</label><br/>
                                <input type="radio" name="radio" id="radio3" />
                                <label for="radio3" class="inline">Slow</label><br/>
                                <!-- Radio -->
                            </div>

                            <div class="col_6">
                                <label for="text4" style=" font-size: 16px;">Stock in hand </label> <br/>
                                <input id="text4" type="text" placeholder="" style="width: 100px; height: 28px;" /><br/><br/>
                                <label style=" font-size: 16px;">Last GRN Date</label><br/>
                                <input type="date" ><br/><br/>
                                <label for="text5" style=" font-size: 16px;">Last GRN Quantity </label></span> <br/>
                                <input id="text5" type="text" placeholder="Qty" style="width: 100px; height: 28px;" /><br/><br/><br/>

                                <input type="submit" value="Save"  class="btn_hover"/>  
                                <input type="submit" value="Reset" class="btn_hover" />
                            </div>
                        </div>
                    </form>
                    <!-- Stores -->

                    <!-- Publishing Department -->
                    <form action="####" method="Post">
                        <div id="tabr2" class="tab-content">
                            <div class="col_4">
                                <!-- Check box -->
                                <input type="checkbox" id="check1" />
                                <label for="check1" class="inline" style="font-size: 16px; font-weight: bold;" >Informed the Author </label><br/><br/><br/>
                                <!-- Check box -->
                                <!-- Table sortable -->
                                <label style="font-size: 18px; font-weight: bold;"> Last Print </label> <br/><br/>
                                <table class="sortable" border='1'>
                                    <thead><tr>
                                            <th>Print</th>
                                            <th>Date</th>
                                            <th>Quantity</th>
                                        </tr></thead>
                                    <tbody>
                                        <tr>
                                            <td>Item1</td>
                                            <td>Item2</td>
                                            <td>Item3</td>
                                        </tr>
                                        <tr>
                                            <td>Item1</td>
                                            <td>Item2</td>
                                            <td>Item3</td>
                                        </tr>
                                </table>
                                <!-- Table sortable -->
                                <br/><br/>
                                <label for="text6" style=" font-size: 16px;">Printer  </label><br/>
                                <input id="text6" type="text" placeholder="Type Printer Name" style="width: 355px; height: 28px;" /><br/><br/>
                                <!-- Select -->
                                <label for="select1">Paper Type</label> <br/>
                                <select id="select1">
                                    <option value="0">- Choose a Paper Type -</option>
                                    <option value="1">Bank Paper</option>
                                    <option value="2">Book Printing Paper </option>
                                    <option value="3">Art Paper</option>
                                    <option value="4">Bulk</option>
                                </select>
                                <!-- Select -->
                                <br/><br/>
                                <label for="text7" style=" font-size: 16px;">Delivery for Printing  </label><br/>
                                <input id="text7" type="text" placeholder="Type here" style="width: 355px; height: 28px;" /><br/><br/>

                                <label for="text8" style=" font-size: 16px;">Quantity Suggested</label><br/>
                                <input id="text8" type="text" placeholder="Type here" style="width: 355px; height: 28px;" /><br/><br/> 
                            </div>

                            <div class="col_6" style="padding-removed 100px;">
                                <label style=" font-size: 16px;">Date</label><br/>
                                <input type="text" id="date1" readonly="true " ><br/><br/> 
                                <label for="text9" style=" font-size: 16px;">Altered Page Numbers </label></span> <br/>
                                <input id="text9" type="text" placeholder="Eg-: 4 , 5 , 6 , 34" style="width: 355px; height: 28px;" /><br/><br/><br/>
                                <!-- Check box -->
                                <input type="checkbox" id="check2" />
                                <label for="check2" class="inline" style="font-size: 16px; font-weight: bold;">Sample Copies </label><br/><br/><br/>
                                <!-- Check box -->
                                <label for="text10" style=" font-size: 16px;">Altered Tracing (No.s) </label> <br/>
                                <input id="text10" type="text" placeholder="" style="width: 355px; height: 28px;" /><br/><br/>

                                <label style=" font-size: 16px;">Book Cover</label><br/><br/>
                                <input type="radio" name="radio" id="radio4" />
                                <label for="radio4" class="inline">Same Cover</label><br/><br/>
                                <input type="radio" name="radio" id="radio5" />
                                <label for="radio5" class="inline">New Cover</label><br/><br/><br/>

                                <input type="submit" value="Save" class="btn_hover"/>   
                                <input type="submit" value="Reset" class="btn_hover" />
                            </div>

                        </div>

                    </form>
                    <!-- Publishing Department -->
                    <form action="####" method="Post"> 
                        <!-- Printing Department -->
                        <div id="tabr3" class="tab-content">
                            <div class="col_4">
                                <!-- Select2 -->
                                <label for="select2">Size</label> <br/>
                                <select id="select2">
                                    <option value="0">- Choose a Size -</option>
                                    <option value="1">SD 1/8</option>
                                    <option value="2">D 1/8</option>
                                    <option value="3">D 1/4</option>
                                    <option value="4">Cr 1/8</option>
                                    <option value="5">Cr 1/4</option>
                                    <option value="6">A4</option>
                                    <option value="7">A5</option>
                                    <option value="8">B4</option>
                                </select><br/><br/><br/>
                                <!-- Select2 -->  
                                <label style="font-size: 18px; font-weight: bold;">No. of Pages</label><br/><br/>
                                <label>Black & White -</label>
                                <input type="text"  id="text11"style="width: 100px; height: 28px;" ><br/><br/>
                                <label style="padding-right: 45px">Colour -</label>
                                <input type="text" id="text12 "style="width: 100px; height: 28px;" ><br/><br/><br/>

                                <label style="font-size: 18px; font-weight: bold;"> Last Production Cost</label><br/><br/>
                                <!-- Table sortable2 -->
                                <table class="sortable" border='1'>
                                    <thead><tr>
                                            <th>Year</th>
                                            <th>Qty</th>
                                            <th>Cost</th>
                                            <th>Unit Cost</th>
                                        </tr></thead>
                                    <tbody>
                                        <tr>
                                            <td>Item1</td>
                                            <td>Item2</td>
                                            <td>Item3</td>
                                            <td>Item4</td>
                                        </tr>

                                </table><br/><br/>
                                <!-- Table sortable2 -->

                                <label style="font-size: 18px; font-weight: bold;"> Estimated Printing Cost</label><br/><br/>
                                <label for="text13" style=" font-size: 16px;">Quantity</label> <br/>
                                <input id="text13" type="text" placeholder="" style="width: 155px; height: 28px;" /><br/><br/>
                                <label for="text14" style=" font-size: 16px;">Cost</label> <br/>
                                <input id="text14" type="text" placeholder="" style="width: 155px; height: 28px;" /><br/><br/>
                                <label for="text15" style=" font-size: 16px;">Unit Cost</label> <br/>
                                <input id="text15" type="text" placeholder="" style="width: 155px; height: 28px;" readonly="true" /><br/><br/>
                            </div>
                            <div class="col_3">
                                <!-- Select3 -->
                                <label for="select2">Paper</label> <br/>
                                <select id="select3">
                                    <option value="0">- Choose a Paper -</option>
                                    <option value="1">60 gsm</option>
                                    <option value="2">70 gsm</option>
                                    <option value="3">80 gsm</option>
                                    <option value="4">100 gsm</option>
                                    <option value="5">120 gsm</option>
                                    <option value="6">150 gsm</option>
                                </select><br/><br/>
                                <!-- Select3 -->  
                                <!-- Select4 -->
                                <label for="select4">Binding</label> <br/>
                                <select id="select4">
                                    <option value="0">- Choose a Binding Methode   -</option>
                                    <option value="1">Hard Binding</option>
                                    <option value="2">Perfect Binding</option>
                                    <option value="3">Suddle Binding</option>
                                    <option value="4">Thread Binding/Perfect Binding</option>

                                </select><br/><br/>

                                <!-- Select4 -->  
                                <br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/>
                                <input type="submit" value="Save"  class="btn_hover"/>   
                                <input type="submit" value="Reset" class="btn_hover" />

                            </div>
                            <div class="col_3">
                                <label style=" font-size: 16px;">Date</label><br/>
                                <input type="text" id="date" readonly="true" ><br/><br/>

                            </div>
                        </div>
                        <!-- Printing Department -->
                    </form>
                    <form action="####" method="Post"> 
                        <div id="tabr4" class="tab-content">
                            <div class="col_6">
                                <label for="text16" style=" font-size: 16px;">Present Price  </label><br/>
                                <input id="text16" type="text" placeholder="current Price" style="width: 355px; height: 28px;" /><br/><br/>
                                <label for="text17" style=" font-size: 16px;">Revise Price  </label><br/>
                                <input id="text17" type="text" placeholder="new Price" style="width: 355px; height: 28px;" /><br/><br/>
                                <label for="text18" style=" font-size: 16px;">Quantity   </label></span> <br/>
                                <input id="text18" type="text" placeholder="Qty" style="width: 355px; height: 28px;" /><br/><br/><br/>

                                <input type="submit" value="Approve"  class="btn_hover"/>  
                                <input type="submit" value="Cancel" class="btn_hover" />  
                                <input type="submit" value="Reset" class="btn_hover" />
                            </div>
                            <div class="col_4">
                                <!-- Textarea -->
                                <label for="textarea1" style="font-size: 18px; font-weight: bold;"> Remark</label><br/>
                                <textarea id="textarea1" placeholder="Type Here" style="width: 650px; height: 200px;" ></textarea>
                            </div>
                        </div> 
                    </form>

                </td>
            </tr>

        </table>
        <!-- Tabs  -->

    </body>
Posted
Updated 5-Nov-13 18:06pm
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900