SET AS HOME PAGE

ADD TO FAVORITES / BOOKMARK THIS WEBSITE (More Details)

Introduction

Servlet

Jsp

Security

Enterprise Beans

Contact Us


Securing Web Applications - Project (Continue...)

 Introduction

  1. To counter security threats, you can implement different security techniques, such as:
    • Authentication: Identifies a user.
    • Authorization: Specifies the rights assigned to an authenticated user to access resources of a Web application.
    • Data Integrity: Ensures that data is not modified while being transferred between the server and the client.
    • Auditing: Secures Web applications by maintaining a record of the rights assigned to different types of Web users.
CLICK HERE to download this complete example (zip file)


 Steps to deploy and run Securing Web Application Project

  1. Write a java file and name it as "LoginSuccess.java"
  2. Write a html file and name it as "login.html"
  3. Write a html file and name it as "error.html"
  4. Set the path in the "command prompt"
    set path=.;D:\progra~1\java\j2sdk1.5.0\bin;D:\Sun\AppServer\bin;
    Set classpath=.;D:\progra~1\java\j2sdk1.5.0\lib;D:\Sun\AppServer\lib\j2ee.jar;
    (OR)
    Set the path in the system itself. CLICK HERE for details
  5. Now compile the LoginSuccess.java. CLICK HERE to see how to compile
  6. After the java programs are compiled successfully, you can close the command prompt.
  7. Now goto Start -> Programs -> Sun Microsystems ->Application Server PE -> Start Default Server (wait till it start and then press any key). CLICK HERE to see how to Start the Server
  8. Important Note: Before deploying this project, you need to create a user in J2EE application server Admin Console. CLICK HERE for details
  9. Next goto Start -> Programs -> Sun Microsystems ->Application Server PE -> Deploytool. CLICK HERE to see how to Start the Deploytool
    Now in the deploytool,
    1. Goto File ->New -> Application

      (Click the Browse button)


    2. (Select the folder in the Look In dropdown box, and then give a file name "SecurityLogin". Next click the New Application button)


    3. (Click the OK button)
    4. Now goto File -> Save to save the file
    5. Next, goto File -> New -> Web Component

      (Click Next button)


    6. (Enter the WAR Name as "WebApp" and then click the Edit Contents… button)


    7. (Note: It is importatnt that LoginSuccess.class, login.html, error.html need to be stored inside a folder security.
      Select the LoginSuccess.class, login.html, error.html files and click the Add button)


    8. (Now click the OK button)


    9. (Now click the Next button)


    10. (Now select the Servlet option button and then click the Next button)


    11. (Now select the "LoginSuccess" from the Servlet Class dropdown box)


    12. (Now select the Next button)


    13. (Now select the Finish button)


    14. (Now select the WebApp in the left pane and select the General tab in the right pane. Here give a name "login_example" in the Context Root text box)
    15. Next select the SecurityLogin in the left side

      (Now select the SecurityLogin in the left pane and then select the Aliases tab in the right pane. Next select the Add button)


    16. (Now add a name as "loginpage")

  10. Now select the SecurityLogin (New application name) in the left pane.
  11. Next click the Roles tab in the right pane
  12. Now click the Add button to enter a new security role. Type a role name as User in the Name text field
  13. Now click the folder-paper icon near the Name text field. Now a Description for user dialog box will display
  14. Now enter any text in it. (For example, enter any text like "Security Role for the User")
  15. Now click the OK button
  16. Now select the WebApp in the left pane
  17. Now click the Security tab in the right pane
  18. Select the Form Based from the User Authentication Method drop down box
  19. Now click the Settings button to open the User Authentication Settings dialog box. Next type the Realm Name as "Form Based Security", select the "login.html" file from the Login Page drop-down box and the "error.html" from the Error Page drop-down box
  20. Now click the OK button

 Click Next To Continue ...
<- PREVIOUSNEXT ->