태터데스크 관리자

도움말
닫기
적용하기   첫페이지 만들기

태터데스크 메시지

저장하였습니다.


http://java.sun.com/products/servlet/2.2/servlet-2.2-publicdraft.pdf
top

Trackback Address :: http://www.ssial.com/trackback/224 관련글 쓰기

  1. Chanel Outlet 2011/09/17 21:20 댓글주소 | 수정/삭제 | 댓글

    Time is what you make of it.

  2. Chanel Outlet 2011/09/17 21:22 댓글주소 | 수정/삭제 | 댓글

    Time is what you make of it.

  3. Burberry Bags 2011/10/13 16:48 댓글주소 | 수정/삭제 | 댓글

    I'm happy I found this blog! From time to time students want to cognitive the keys of productive literary essays composing. Your first-class knowledge about this good post can become a proper basis for such people. Thanks.

  4. Burberry Bags 2011/10/13 16:51 댓글주소 | 수정/삭제 | 댓글

    I'm happy I found this blog! From time to time students want to cognitive the keys of productive literary essays composing. Your first-class knowledge about this good post can become a proper basis for such people. Thanks.

  5. Burberry Bags 2011/10/13 17:03 댓글주소 | 수정/삭제 | 댓글

    I'm happy I found this blog! From time to time students want to cognitive the keys of productive literary essays composing. Your first-class knowledge about this good post can become a proper basis for such people. Thanks.

  6. Coach Outlet Online 2011/11/15 12:39 댓글주소 | 수정/삭제 | 댓글

    It's very good!Thank you for sharing it!I like buying handbags of the internet website:http://www.mycoachoutletstoreonline.com

  7. Coach Factory Online 2011/12/11 22:57 댓글주소 | 수정/삭제 | 댓글

    http://www.coachsfactoryonlines.net

  8. Coach Factory Outlet Online 2011/12/14 15:55 댓글주소 | 수정/삭제 | 댓글

    Great Coach Factory Outlet Online
    . A lot of useful information here. I’m sending it to some friends!

  9. red bottom shoes 2011/12/23 11:15 댓글주소 | 수정/삭제 | 댓글

    Christian louboutin pumps have a round toe, a button-fastening ankle christian louboutin pumps strap and a signature red sole. louboutin sale amber tone to bring the feeling of luxurious elegance,red sole shoes the classic expression of women’s fine with sexy charm. Upper cross lace style is full of surrealist avant-garde style at red bottoms Outlet. http://www.louboutinredbottomsshoes.com The color is more low-key fit the body color. Red bottom shoes sale black mood makes an imaginative,christian louboutin shoes glass-shaped heel painfully sweet love. Embrace the occasion of the retro arms embrace the future while the geometric style, to let people see the limitless design ingenuity. http://www.louboutinredbottomsshoes.com

  10. Burberry Shop Online 2012/01/11 15:21 댓글주소 | 수정/삭제 | 댓글

    <p><strong><a href="http://www.burberrydiscount.org/">Burberry Discount</a></strong> developed a local community utilizing bags to write about in her appreciation and consciousness and also to preserve people within your loop about high quality replica artist handbag sites, such as touch bags.<br>
    <a href="http://www.burberryoutletshoponline.com/"><strong>Burberry Shop Online</strong></a> puts inside the work to can be found throughout only the extremely perfect high quality sites, steering toward magnitude of placing her on the internet protection inside the collection by attempting to purchase a replica artist handbag by method of the website itself.<br>
    <a href="http://www.onlinesburberryoutlet.com/"><strong>Burberry Outlet</strong></a> then talks concerning the website on blog of handbags. Luckily, these various quality websites are acquiring shut affordable inside the droves to make certain that people aren't scammed away from their hard-earned money.</p>

  11. Burberry Shop Online 2012/01/11 15:21 댓글주소 | 수정/삭제 | 댓글

    <p><strong><a href="http://www.burberrydiscount.org/">Burberry Discount</a></strong> developed a local community utilizing bags to write about in her appreciation and consciousness and also to preserve people within your loop about high quality replica artist handbag sites, such as touch bags.<br>
    <a href="http://www.burberryoutletshoponline.com/"><strong>Burberry Shop Online</strong></a> puts inside the work to can be found throughout only the extremely perfect high quality sites, steering toward magnitude of placing her on the internet protection inside the collection by attempting to purchase a replica artist handbag by method of the website itself.<br>
    <a href="http://www.onlinesburberryoutlet.com/"><strong>Burberry Outlet</strong></a> then talks concerning the website on blog of handbags. Luckily, these various quality websites are acquiring shut affordable inside the droves to make certain that people aren't scammed away from their hard-earned money.</p>

  12. Burberry Shop Online 2012/01/11 15:21 댓글주소 | 수정/삭제 | 댓글

    <p><strong><a href="http://www.burberrydiscount.org/">Burberry Discount</a></strong> developed a local community utilizing bags to write about in her appreciation and consciousness and also to preserve people within your loop about high quality replica artist handbag sites, such as touch bags.<br>
    <a href="http://www.burberryoutletshoponline.com/"><strong>Burberry Shop Online</strong></a> puts inside the work to can be found throughout only the extremely perfect high quality sites, steering toward magnitude of placing her on the internet protection inside the collection by attempting to purchase a replica artist handbag by method of the website itself.<br>
    <a href="http://www.onlinesburberryoutlet.com/"><strong>Burberry Outlet</strong></a> then talks concerning the website on blog of handbags. Luckily, these various quality websites are acquiring shut affordable inside the droves to make certain that people aren't scammed away from their hard-earned money.</p>

  13. Burberry Shop Online 2012/01/11 15:21 댓글주소 | 수정/삭제 | 댓글

    <p><strong><a href="http://www.burberrydiscount.org/">Burberry Discount</a></strong> developed a local community utilizing bags to write about in her appreciation and consciousness and also to preserve people within your loop about high quality replica artist handbag sites, such as touch bags.<br>
    <a href="http://www.burberryoutletshoponline.com/"><strong>Burberry Shop Online</strong></a> puts inside the work to can be found throughout only the extremely perfect high quality sites, steering toward magnitude of placing her on the internet protection inside the collection by attempting to purchase a replica artist handbag by method of the website itself.<br>
    <a href="http://www.onlinesburberryoutlet.com/"><strong>Burberry Outlet</strong></a> then talks concerning the website on blog of handbags. Luckily, these various quality websites are acquiring shut affordable inside the droves to make certain that people aren't scammed away from their hard-earned money.</p>

  14. Burberry Shop Online 2012/01/11 15:21 댓글주소 | 수정/삭제 | 댓글

    <p><strong><a href="http://www.burberrydiscount.org/">Burberry Discount</a></strong> developed a local community utilizing bags to write about in her appreciation and consciousness and also to preserve people within your loop about high quality replica artist handbag sites, such as touch bags.<br>
    <a href="http://www.burberryoutletshoponline.com/"><strong>Burberry Shop Online</strong></a> puts inside the work to can be found throughout only the extremely perfect high quality sites, steering toward magnitude of placing her on the internet protection inside the collection by attempting to purchase a replica artist handbag by method of the website itself.<br>
    <a href="http://www.onlinesburberryoutlet.com/"><strong>Burberry Outlet</strong></a> then talks concerning the website on blog of handbags. Luckily, these various quality websites are acquiring shut affordable inside the droves to make certain that people aren't scammed away from their hard-earned money.</p>

  15. Burberry Shop Online 2012/01/11 15:21 댓글주소 | 수정/삭제 | 댓글

    <p><strong><a href="http://www.burberrydiscount.org/">Burberry Discount</a></strong> developed a local community utilizing bags to write about in her appreciation and consciousness and also to preserve people within your loop about high quality replica artist handbag sites, such as touch bags.<br>
    <a href="http://www.burberryoutletshoponline.com/"><strong>Burberry Shop Online</strong></a> puts inside the work to can be found throughout only the extremely perfect high quality sites, steering toward magnitude of placing her on the internet protection inside the collection by attempting to purchase a replica artist handbag by method of the website itself.<br>
    <a href="http://www.onlinesburberryoutlet.com/"><strong>Burberry Outlet</strong></a> then talks concerning the website on blog of handbags. Luckily, these various quality websites are acquiring shut affordable inside the droves to make certain that people aren't scammed away from their hard-earned money.</p>

  16. Abercrombie and Fitch Düsseldorf 2012/02/07 16:54 댓글주소 | 수정/삭제 | 댓글

    I’m glad that i found a place to get such good information. Keep up the good work!.

  17. Abercrombie Düsseldorf 2012/02/07 16:55 댓글주소 | 수정/삭제 | 댓글

    Keep up the good work!.

Write a comment


Web-Tier Security Details

When the deployment container gets a request for a resource that is protected by the web-tier declarative security-constraint, it must evaluate the credentials of the user against the agent realm to ensure that only authorized requests go through. In order to process such a request, the deployment container requires the user to sign on using the specified form login page as mentioned in the form-login-config element of the web.xml descriptor. Based on the specification of the FORM authentication mechanism, it is required that the user submits a valid user name as j_username and a valid password as j_password to the special URI j_security_check using the HTTP POST method of form submission.

The agent, once configured to support web-tier declarative security for the given application can isolate the request for accessing form-login-page and instead can stream out some data to the client browser. This data contains the user’s login name and temporary encrypted password, which in turn uses Javascript to do automatic form submission as required. This gives the user a seamless single sign-on experience since the user does not have to re-login in order to access the protected resources for a deployed application that uses web-tier declarative security.

By default, the content that the agent sends to the client browser on intercepting a request for the form login page is read from the file called FormLoginContent.txt located in the locale directory of the agent installation. This file contains the following HTML code:


<html>
   <head>
      <title>Security Check</title>
   </head>
   <body onLoad="document.security_check_form.submit()">
      <form name="security_check_form" action="j_security_check" method="POST">
         <input type="hidden" value="am.filter.j_username" name="j_username">
         <input type="hidden" value="am.filter.j_password" name="j_password">
      </form>
   </body>
</html>

      

Before the agent streams out the contents of this file, it replaces all occurrences of the string am.filter.j_username by the appropriate user name. Similarly, all occurrences of the string am.filter.j_password are replaced by a temporary encrypted string that acts as a one-time password for the user.



출처 : http://docs.sun.com/app/docs/doc/820-4802/gazki?l=en&a=view

top

Trackback Address :: http://www.ssial.com/trackback/223 관련글 쓰기

  1. Chanel Outlet 2011/09/17 21:23 댓글주소 | 수정/삭제 | 댓글

    Time is what you make of it.

  2. Burberry Bags 2011/10/13 16:50 댓글주소 | 수정/삭제 | 댓글

    I'm happy I found this blog! From time to time students want to cognitive the keys of productive literary essays composing. Your first-class knowledge about this good post can become a proper basis for such people. Thanks.

  3. Coach Outlet Online 2011/11/15 12:21 댓글주소 | 수정/삭제 | 댓글

    It's very good!Thank you for sharing it!I like buying handbags of the internet website:http://www.mycoachoutletstoreonline.com

  4. Coach Factory Online 2011/12/11 23:09 댓글주소 | 수정/삭제 | 댓글

    댓글주소 | 수정/삭제 | 댓글

  5. Coach Factory Outlet Online 2011/12/14 15:59 댓글주소 | 수정/삭제 | 댓글

    Great Coach Factory Outlet Online
    . A lot of useful information here. I’m sending it to some friends!

  6. Coach Factory Outlet Online 2011/12/14 15:59 댓글주소 | 수정/삭제 | 댓글

    Great Coach Factory Outlet Online
    . A lot of useful information here. I’m sending it to some friends!

  7. Abercrombie and Fitch Düsseldorf 2012/02/07 16:54 댓글주소 | 수정/삭제 | 댓글

    I’m glad that i found a place to get such good information. Keep up the good work!.

  8. Abercrombie Düsseldorf 2012/02/07 16:55 댓글주소 | 수정/삭제 | 댓글

    Keep up the good work!.

Write a comment


Understanding Login Authentication

When you try to access a protected Web resource, the Web container activates the authentication mechanism that has been configured for that resource. You can specify the following authentication mechanisms:

  • HTTP basic authentication
  • Form-based login authentication
  • Client certificate authentication
  • Mutual authentication
  • Digest authentication

If you do not specify one of these mechanisms, the user will not be authenticated.

Using HTTP Basic Authentication

Figure 32-2 shows what happens if you specify HTTP basic authentication.

HTTP Basic Authentication

Figure 32-2 HTTP Basic Authentication

With basic authentication, the following things occur:

  1. A client requests access to a protected resource.
  2. The Web server returns a dialog box that requests the user name and password.
  3. The client submits the user name and password to the server.
  4. The server validates the credentials and, if successful, returns the requested resource.

HTTP basic authentication is not particularly secure. Basic authentication sends user names and passwords over the Internet as text that is uu-encoded (Unix-to-Unix encoded) but not encrypted. This form of authentication, which uses Base64 encoding, can expose your user names and passwords unless all connections are over SSL. If someone can intercept the transmission, the user name and password information can easily be decoded.

Example: Basic Authentication with JAX-RPC is an example application that uses HTTP basic authentication in a JAX-RPC service.

Using Form-Based Authentication

Figure 32-3 shows what happens if you specify form-based authentication, in which you can customize the login screen and error pages that an HTTP browser presents to the end user.

Form-Based Authentication

Figure 32-3 Form-Based Authentication

With form-based authentication, the following things occur:

  1. A client requests access to a protected resource.
  2. If the client is unauthenticated, the server redirects the client to a login page.
  3. The client submits the login form to the server.
  4. If the login succeeds, the server redirects the client to the resource. If the login fails, the client is redirected to an error page.

Form-based authentication is not particularly secure. In form-based authentication, the content of the user dialog box is sent as plain text, and the target server is not authenticated. This form of authentication can expose your user names and passwords unless all connections are over SSL. If someone can intercept the transmission, the user name and password information can easily be decoded.

Example: Using Form-Based Authentication is an example application that uses form-based authentication.

Using Client-Certificate Authentication

Client-certificate authentication is a more secure method of authentication than either basic or form-based authentication. It uses HTTP over SSL, in which the server and, optionally, the client authenticate one another using public key certificates. Secure Socket Layer (SSL) provides data encryption, server authentication, message integrity, and optional client authentication for a TCP/IP connection. You can think of a public key certificate as the digital equivalent of a passport. It is issued by a trusted organization, which is called a certificate authority (CA), and provides identification for the bearer.

If you specify client-certificate authentication, the Web server will authenticate the client using the client's X.509 certificate, a public key certificate that conforms to a standard that is defined by X.509 Public Key Infrastructure (PKI). Before running an application that uses SSL, you must configure SSL support on the server (see Installing and Configuring SSL Support) and set up the public key certificate (see Understanding Digital Certificates).

Example: Client-Certificate Authentication over HTTP/SSL with JAX-RPC describes an example application that uses client-certificate authentication.

Using Mutual Authentication

With mutual authentication, the server and the client authenticate each other. There are two types of mutual authentication:

  • Certificate-based mutual authentication (see Figure 32-4)
  • User name- and password-based mutual authentication (see Figure 32-5)

Figure 32-4 shows what occurs during certificate-based mutual authentication.

Certificate-Based Mutual Authentication

Figure 32-4 Certificate-Based Mutual Authentication

In certificate-based mutual authentication, the following things occur:

  1. A client requests access to a protected resource.
  2. The Web server presents its certificate to the client.
  3. The client verifies the server's certificate.
  4. If successful, the client sends its certificate to the server.
  5. The server verifies the client's credentials.
  6. If successful, the server grants access to the protected resource requested by the client.

Example: Client-Certificate Authentication over HTTP/SSL with JAX-RPC describes an example application that uses certificate-based mutual authentication.

Figure 32-5 shows what occurs during user name- and password-based mutual authentication.

Username/Password-Based Mutual Authentication

Figure 32-5 User Name- and Password-Based Mutual Authentication

In user name- and password-based mutual authentication, the following things occur:

  1. A client requests access to a protected resource.
  2. The Web server presents its certificate to the client.
  3. The client verifies the server's certificate.
  4. If successful, the client sends its user name and password to the server, which verifies the client's credentials.
  5. If the verification is successful, the server grants access to the protected resource requested by the client.

Using Digest Authentication

Like HTTP basic authentication, HTTP digest authentication authenticates a user based on a user name and a password. However, the authentication is performed by transmitting the password in an encrypted form which is much more secure than the simple base64 encoding used by basic authentication. Digest authentication is not currently in widespread use, therefore, there is no further discussion of it in this document.

Configuring Authentication

To configure the authentication mechanism that the Web resources in a WAR will use, select the WAR in the deploytool tree. Select the Security tabbed pane, and then proceed as follows:

  1. Select one of the user authentication methods described earlier.
  2. Specify a security realm. If omitted, the file realm is assumed. Select the Settings button beside the User Authentication Mechanism field to specify the realm.
  3. If the authentication method is specified as form-based, specify a form login page and form error page. Select the Settings button beside the User Authentication Mechanism field to specify the login page and the error page to be used for form-based authentication.

Example: Using Form-Based Authentication

In this section, we discuss how to add form-based authentication to a basic JSP page. With form-based authentication, you can customize the login screen and error pages that are presented to the Web client for authentication of their user name and password. If the topic of authentication is new to you, please refer to the section Understanding Login Authentication.

The example application discussed in this tutorial can be found in <INSTALL>/j2eetutorial14/examples/security/formbasedauth/. In general, the following steps are necessary to add form-based authentication to a Web client. In the example application included with this tutorial, most of these steps have been completed for you and are listed here to show what needs to be done should you wish to create a similar application.

  1. Map the role name to the appropriate users and groups defined for the Application Server. See Adding Authorized Users for more information on needed modifications.
  2. Edit the build.properties file. The build.properties file needs to be modified because the properties in this file are specific to your installation of the Application Server and J2EE 1.4 Tutorial. See Building the Examples for information on which properties need to be set.
  3. Create the Web client. For this example, the Web client, a very simple JSP page, is already created. The client is discussed in Creating a Web Client for Form-Based Authentication.
  4. Create the login form and login error form pages. For this example, these files are already created. These pages are discussed in Creating the Login Form and Error Page.
  5. Add the appropriate security elements using deploytool. See Specifying Security Elements for Form-Based Authentication for information on which settings need to be made.
  6. Build, package, deploy, and run the Web application (see Building, Packaging, Deploying, and Running the Form-Based Authentication Example). You will use the asant tool to compile the example application and to run the client. You will use deploytool to package and deploy the server.

Adding Authorized Users

This example application will be configured to authorize access for users assigned to the role of loginUser. To specify which users can assume that role and can access the protected parts of the application, you must map this role to users and groups defined for the Application Server.

When the Application Server is started, it reads the settings in its configuration files. When a constrained resource is accessed, the Application Server verifies that the user name and password are authorized to access that resource before granting access to the requester. The roles that are authorized to access a resource are specified in the security constraint for that application.

Information for adding users to the Application Server is provided in Managing Users. For this example, create a new user and assign that user to the group loginUser. For information about the steps required to map the user assigned to the group of loginUser as defined on the Application Server to the role of loginUser authorized to access this application, see Adding Security to the Form-Based Example.

Creating a Web Client for Form-Based Authentication

The Web client is a standard JSP page. None of the code that adds form-based authentication to the example is included in the Web client. The information that adds the form-based authentication to this example is specified in the deployment descriptor, which is created with deploytool. The code for the JSP page used in this example, formbasedauth/web/index.jsp, is listed next. The running application is shown later in Figure 32-7.

<html>
<head><title>Hello</title></head>
<body bgcolor="white">

<img src="duke.waving.gif">
<h2>My name is Duke.</h2>
<h2><font color="black">Hello,
   ${pageContext.request.userPrincipal.name}!</font></h2>
</body>
</html> 

Creating the Login Form and Error Page

When you create a form-based login mechanism, you must specify which JSP page contains the form to obtain the user name and password to verify access. You also must specify which page is displayed if login authentication fails. This section discusses how to create the login form and error page. Adding Security to the Form-Based Example discusses how to specify these pages when you are setting up form-based authentication.

The login page can be an HTML page, a JSP page, or a servlet, and it must return an HTML page containing a form that conforms to specific naming conventions (see the Java Servlet 2.4 specification for more information on these requirements). The content of the login form in an HTML page, JSP page, or servlet for a login page should be coded as follows:

<form method=post action="j_security_check" >
 <input type="text"  name= "j_username" >
 <input type="password"  name= "j_password" >
</form> 

The full code for the login page used in this example can be found at <INSTALL>/j2eetutorial14/examples/security/formbasedauth/web/logon.jsp. An example of the running login form page is shown later in Figure 32-6.

The login error page is displayed if the user enters a user name and password combination that is not authorized to access the protected URI. For this example, the login error page can be found at <INSTALL>/j2eetutorial14/examples/security/formbasedauth/web/logonError.jsp. Here is the code for this page:

<%@ taglib uri="http://java.sun.com/jsp/jstl/core" 
   prefix="c" %>
<html>
<head>
<title>
   Login Error
</title>
</head>
<body>
   <c:url var="url" value="/index.jsp"/>
   <p><a href="${url}">Try again.</a></p>
</body>
</html> 

Specifying Security Elements for Form-Based Authentication

To enable form-based authentication, you add the following elements to this application using deploytool.

  • A security constraint, which is used to define the access privileges to a collection of resources using their URL mapping.
  • A Web resource collection, which is used to identify a subset of the resources within a Web application to which a security constraint applies. In this example, by specifying a URL pattern of /*, we are specifying that all resources in this application are protected.
  • An authorized roles list, which indicates the user roles that should be permitted access to this resource collection. In this example, it is users assigned the role of loginUser. If no role name is provided, no user is allowed to access the portion of the Web application described by the security constraint.
  • A user authentication method, which is used to configure the authentication method used and the attributes needed by the form login mechanism. The login page parameter provides the URI of a Web resource relative to the document root that will be used to authenticate the user. The error page parameter requires a URI of a Web resource relative to the document root that sends a response when authentication has failed.

In the Application Server, these security elements are added to the application using deploytool, after the application has been packaged. Information on adding the security elements to this application using deploytool is discussed in Adding Security to the Form-Based Example.

Building, Packaging, Deploying, and Running the Form-Based Authentication Example

To build, package, deploy, and run the security/formbasedauth example, which uses form-based authentication, follow these steps.

Building the Form-Based Authentication Example
  1. Follow the instructions in Building the Examples.
  2. Follow the instructions in Adding Authorized Users.
  3. Go to the <INSTALL>/j2eetutorial14/examples/security/formbasedauth/ directory.
  4. Build the Web application by entering the following command at the terminal window or command prompt:
  5.   asant build

Packaging the Web Application

You can package the form-based authentication example using asant or deploytool, or you can just open the WAR file located in the <INSTALL>/j2eetutorial14/examples/security/provided-wars/formbasedauth.war file.

To package the example using asant, run the following command:

asant create-war 

To package the example using deploytool, follow these steps:

  1. Start the Application Server if you have not already done so. For information on starting the Application Server, see Starting and Stopping the Application Server.
  2. Start deploytool. Information on starting deploytool can be found in Starting the deploytool Utility.
  3. Package the formbasedauth example using deploytool following these steps. More detail on packaging Web applications can be found in Packaging Web Modules.
    1. Select FileRight ArrowNewRight ArrowWeb Component from the deploytool menu.
    2. Select Next from the Introduction page.
    3. Select the Create New Stand-Alone WAR Module radio button.
    4. In the WAR Location field, browse to the <INSTALL>/j2eetutorial14/examples/security/formbasedauth/ directory and create the file formbasedauth.war. Give the WAR the name FormBasedAuth.
    5. Enter /formbasedauth in the Context Root field.
    6. Click Edit Contents to add the contents of the application to the WAR file. Select the formbasedauth/ directory from the Starting Directory list. Select each of the files index.jsp, logon.jsp, logonError.jsp, and duke.waving.gif from the build/ directory, and then click Add. Click OK to close this dialog box.
    7. Click Next.
    8. Select JSP.
    9. Click Next.
    10. Select index.jsp in the JSP File Name field.
    11. Click Next.
    12. Click Finish. The FormBasedAuth example displays in the deploytool tree.
    13. Select Save from the File menu to save the Web component.
Adding Security to the Form-Based Example

To add form-based authentication to your application, select the application in the deploytool tree and then follow these steps:

  1. Select the Security tabbed pane.
  2. Select Form Based in the User Authentication Method field.
  3. Select the Settings button. Set the following properties in this dialog box:
    1. Set Realm Name to file.
    2. Select logon.jsp from the Login Page list.
    3. Select logonError.jsp from the Login Error Page list.
    4. Click OK.
  4. Select Add Constraints to add a security constraint to this example.
  5. Select Add Collections to add a Web resource collection to this example.
  6. With the security constraint and Web resource collection selected, click the Edit Contents button.
  7. In the Edit Contents dialog box, select Add URL Pattern. In the edit box, make sure that the URL pattern reads /*. Click OK to close this dialog box. Using a URL pattern of /* and selecting no HTTP patterns means that all files and methods in this application are protected and may be accessed only by a user who provides an authorized login.
  8. Click OK.
  9. Click Edit Roles on the Security tabbed pane and then Edit Roles again in the Authorized Roles dialog box. Click Add, and then enter the role loginUser in the Name column. This is the authorized role for this security constraint. Click OK to close this dialog box.
  10. Select loginUser in the left pane and click Add to add it to the list of authorized roles for this application. Select OK to close this dialog box.

The next step is to map the authorized role of loginUser, as defined in the application, to the group of loginUser that is defined for the Application Server. To do this, follow these steps:

  1. Select the General tabbed pane.
  2. Click the Sun-specific Settings button.
  3. In the Sun-specific Settings dialog box, select User to Role Mappings from the View list.
  4. Select loginUser from the list of roles.
  5. Click the Edit button under the Group box.
  6. Select loginUser from the Available Groups list, and then click the Add button to map the role of loginUser (defined for the application) to the group of loginUser (defined for the Application Server). Click OK.

Note: If you don't see the list of users or groups that you defined using the Admin Console, connect to the Admin Server by double-clicking localhost:4848 in the deploytool tree and entering your admin user name and password. If this is not the current target server, change to this server by selecting it and then selecting FileRight ArrowSet Current Target Server.


  1. Click Close to return to the General tabbed pane.
  2. Select FileRight ArrowSave to save these changes.

After all the security elements have been added, view the generated deployment descriptor by selecting ToolsRight ArrowDescriptor ViewerRight ArrowDescriptor Viewer from the deploytool menu.

Deploying the Web Application

To deploy the example using asant, run the following command:

asant deploy-war 

To deploy the example using deploytool, follow these steps:

  1. Select the FormBasedAuth application in the deploytool tree.
  2. Select ToolsRight ArrowDeploy.
  3. Make sure the server is correct.
  4. Enter your admin user name and password.
  5. Click OK.
  6. Click the Close button after the messages indicating successful completion are finished.
Running the Web Application

Run the Web client by entering the following URL in your Web browser:

http://localhost:8080/formbasedauth 

The login form displays in the browser, as shown in Figure 32-6. Enter a user name and password combination that corresponds to the role of loginUser, and then click the Submit button.

Form-based Login Page

Figure 32-6 Form-Based Login Page

If you entered Debbie as the name and if there is a user defined for the Application Server with the user name of Debbie that also matches the password you entered and is assigned to the group of loginUser that we mapped to the role of loginUser, the display will appear as in Figure 32-7.

Image of running form-based login authentication example, shows Duke waving, and the text "My name is Duke, Hello your name!"

Figure 32-7 The Running Form-Based Authentication Example


Note: For repetitive testing of this example, you may need to close and reopen your browser.


Using Authentication with SSL

Passwords are not protected for confidentiality with HTTP basic or form-based authentication, meaning that passwords sent between a client and a server on an unprotected session can be viewed and intercepted by third parties. To overcome this limitation, you can run these authentication protocols over an SSL-protected session and ensure that all message content is protected for confidentiality. To configure HTTP basic or form-based authentication over SSL, specify CONFIDENTIAL or INTEGRAL as the network security requirement on the WAR's Security pane in deploytool. Read the section Specifying a Secure Connection for more information.

 출처 : http://java.sun.com/j2ee/1.4/docs/tutorial-update2/doc/Security5.html
top

Trackback Address :: http://www.ssial.com/trackback/222 관련글 쓰기

  1. Chanel Outlet 2011/09/17 21:29 댓글주소 | 수정/삭제 | 댓글

    Time is what you make of it.

  2. Burberry Bags 2011/10/13 17:02 댓글주소 | 수정/삭제 | 댓글

    I'm happy I found this blog! From time to time students want to cognitive the keys of productive literary essays composing. Your first-class knowledge about this good post can become a proper basis for such people. Thanks.

  3. transcription services 2011/11/03 08:46 댓글주소 | 수정/삭제 | 댓글

    wow, I had no idea about this password authentication thing. now I will be able to protect my privacy better. Thanks.

  4. Coach Outlet Online 2011/11/15 12:40 댓글주소 | 수정/삭제 | 댓글

    I'm happy I found this blog ! It's very good and thank you for sharing it !

  5. 이청용 2011/12/18 11:17 댓글주소 | 수정/삭제 | 댓글

    호랑이도 제 말하면 온다

  6. Abercrombie and Fitch Düsseldorf 2012/02/07 16:54 댓글주소 | 수정/삭제 | 댓글

    I’m glad that i found a place to get such good information. Keep up the good work!.

  7. Abercrombie Düsseldorf 2012/02/07 16:55 댓글주소 | 수정/삭제 | 댓글

    Keep up the good work!.

Write a comment


URL descript

JSP/Advance 2008/12/03 14:38
The following are two example URIs and their component parts

 foo://username:password@example.com:8042/over/there/?name=ferret#nose
  \ /   |________________|   |___________||__||_________|  |_________| |___|
   |                    |                      |             |           |                 |          |
   |                userinfo          hostname      port      path            query   fragment
   |     |________________________________|
scheme                  authority
   |
   |                 path
   |   ___________|____________
  | | |                                  |
  urn:example:animal:ferret:nose






출처 : http://en.wikipedia.org/wiki/URI_scheme
top

Trackback Address :: http://www.ssial.com/trackback/221 관련글 쓰기

  1. Chanel Outlet 2011/09/17 21:40 댓글주소 | 수정/삭제 | 댓글

    Time is what you make of it.

  2. Burberry Bags 2011/10/13 17:04 댓글주소 | 수정/삭제 | 댓글

    I'm happy I found this blog! From time to time students want to cognitive the keys of productive literary essays composing. Your first-class knowledge about this good post can become a proper basis for such people. Thanks.

  3. Coach Outlet Online 2011/11/15 12:23 댓글주소 | 수정/삭제 | 댓글

    It's very good!Thank you for sharing it!I like buying handbags of the internet website:http://www.mycoachoutletstoreonline.com

  4. Coach Factory Online 2011/12/11 22:57 댓글주소 | 수정/삭제 | 댓글

    댓글주소 | 수정/삭제 | 댓글

  5. Burberry Shop Online 2012/01/11 15:23 댓글주소 | 수정/삭제 | 댓글

    <p><strong><a href="http://www.burberrydiscount.org/">Burberry Discount</a></strong> developed a local community utilizing bags to write about in her appreciation and consciousness and also to preserve people within your loop about high quality replica artist handbag sites, such as touch bags.<br>
    <a href="http://www.burberryoutletshoponline.com/"><strong>Burberry Shop Online</strong></a> puts inside the work to can be found throughout only the extremely perfect high quality sites, steering toward magnitude of placing her on the internet protection inside the collection by attempting to purchase a replica artist handbag by method of the website itself.<br>
    <a href="http://www.onlinesburberryoutlet.com/"><strong>Burberry Outlet</strong></a> then talks concerning the website on blog of handbags. Luckily, these various quality websites are acquiring shut affordable inside the droves to make certain that people aren't scammed away from their hard-earned money.</p>

  6. Abercrombie and Fitch Düsseldorf 2012/02/07 16:54 댓글주소 | 수정/삭제 | 댓글

    I’m glad that i found a place to get such good information. Keep up the good work!.

  7. Abercrombie Düsseldorf 2012/02/07 16:55 댓글주소 | 수정/삭제 | 댓글

    Keep up the good work!.

  8. Buy best quality replica Hermes handbags right now! 2012/02/12 12:43 댓글주소 | 수정/삭제 | 댓글

    The article is so beautiful, so I feel very good, thought I saw my favorite @ the same, thank you of you are very

Write a comment


http://struts.apache.org/1.3.8/struts-taglib/index.html
top

Trackback Address :: http://www.ssial.com/trackback/194 관련글 쓰기

  1. Chanel Outlet 2011/09/17 21:35 댓글주소 | 수정/삭제 | 댓글

    Time is what you make of it.

  2. Burberry Bags 2011/10/13 17:10 댓글주소 | 수정/삭제 | 댓글

    I'm happy I found this blog! From time to time students want to cognitive the keys of productive literary essays composing. Your first-class knowledge about this good post can become a proper basis for such people. Thanks.

  3. Burberry Bags 2011/10/13 17:11 댓글주소 | 수정/삭제 | 댓글

    I'm happy I found this blog! From time to time students want to cognitive the keys of productive literary essays composing. Your first-class knowledge about this good post can become a proper basis for such people. Thanks.

  4. Coach Outlet Online 2011/11/15 12:22 댓글주소 | 수정/삭제 | 댓글

    It's very good!Thank you for sharing it!I like buying handbags of the internet website:http://www.mycoachoutletstoreonline.com

  5. Coach Outlet Online 2011/11/15 12:22 댓글주소 | 수정/삭제 | 댓글

    It's very good!Thank you for sharing it!I like buying handbags of the internet website:http://www.mycoachoutletstoreonline.com

  6. cctv camera 2011/11/29 15:27 댓글주소 | 수정/삭제 | 댓글

    Buy high quality CCTV camera, CCTV DVR, IP Camera, IP DVR, security camera and surveillance camera online with competitive price and fast worldwide shipping.

  7. Coach Factory Online 2011/12/11 22:51 댓글주소 | 수정/삭제 | 댓글

    댓글주소 | 수정/삭제 | 댓글

  8. Coach Factory Outlet Online 2011/12/14 15:52 댓글주소 | 수정/삭제 | 댓글

    Great Coach Factory Outlet Online
    . A lot of useful information here. I’m sending it to some friends!

  9. Burberry Shop Online 2012/01/11 15:22 댓글주소 | 수정/삭제 | 댓글

    <p><strong><a href="http://www.burberrydiscount.org/">Burberry Discount</a></strong> developed a local community utilizing bags to write about in her appreciation and consciousness and also to preserve people within your loop about high quality replica artist handbag sites, such as touch bags.<br>
    <a href="http://www.burberryoutletshoponline.com/"><strong>Burberry Shop Online</strong></a> puts inside the work to can be found throughout only the extremely perfect high quality sites, steering toward magnitude of placing her on the internet protection inside the collection by attempting to purchase a replica artist handbag by method of the website itself.<br>
    <a href="http://www.onlinesburberryoutlet.com/"><strong>Burberry Outlet</strong></a> then talks concerning the website on blog of handbags. Luckily, these various quality websites are acquiring shut affordable inside the droves to make certain that people aren't scammed away from their hard-earned money.</p>

  10. Abercrombie and Fitch Düsseldorf 2012/02/07 16:54 댓글주소 | 수정/삭제 | 댓글

    I’m glad that i found a place to get such good information. Keep up the good work!.

  11. Abercrombie Düsseldorf 2012/02/07 16:55 댓글주소 | 수정/삭제 | 댓글

    Keep up the good work!.

Write a comment


http://docs.sun.com/app/docs/doc/819-3669/bnakc?l=en&q=jstl&a=view
top

Trackback Address :: http://www.ssial.com/trackback/164 관련글 쓰기

  1. Chanel Outlet 2011/09/17 21:21 댓글주소 | 수정/삭제 | 댓글

    Time is what you make of it.

  2. Burberry Bags 2011/10/13 16:50 댓글주소 | 수정/삭제 | 댓글

    I'm happy I found this blog! From time to time students want to cognitive the keys of productive literary essays composing. Your first-class knowledge about this good post can become a proper basis for such people. Thanks.

  3. Coach Outlet Online 2011/11/15 12:38 댓글주소 | 수정/삭제 | 댓글

    I'm happy I found this blog ! It's very good and thank you for sharing it !

  4. Coach Factory Online 2011/12/11 22:51 댓글주소 | 수정/삭제 | 댓글

    댓글주소 | 수정/삭제 | 댓글

  5. Coach Factory Outlet Online 2011/12/14 15:52 댓글주소 | 수정/삭제 | 댓글

    Great Coach Factory Outlet Online
    . A lot of useful information here. I’m sending it to some friends!

  6. Burberry Shop Online 2012/01/11 15:22 댓글주소 | 수정/삭제 | 댓글

    <p><strong><a href="http://www.burberrydiscount.org/">Burberry Discount</a></strong> developed a local community utilizing bags to write about in her appreciation and consciousness and also to preserve people within your loop about high quality replica artist handbag sites, such as touch bags.<br>
    <a href="http://www.burberryoutletshoponline.com/"><strong>Burberry Shop Online</strong></a> puts inside the work to can be found throughout only the extremely perfect high quality sites, steering toward magnitude of placing her on the internet protection inside the collection by attempting to purchase a replica artist handbag by method of the website itself.<br>
    <a href="http://www.onlinesburberryoutlet.com/"><strong>Burberry Outlet</strong></a> then talks concerning the website on blog of handbags. Luckily, these various quality websites are acquiring shut affordable inside the droves to make certain that people aren't scammed away from their hard-earned money.</p>

  7. abercrombie and fitch deutschland 2012/02/07 16:56 댓글주소 | 수정/삭제 | 댓글

    Keep up the good work!.

  8. abercrombie 2012/02/07 16:56 댓글주소 | 수정/삭제 | 댓글

    This was very informative. I have been reading your blog a lot over the past few days and it has earned a place in my bookmarks.

Write a comment


jstl API

JSP/Basic 2008/11/27 09:16
http://java.sun.com/products/jsp/jstl/1.1/docs/tlddocs/index.html
top

Trackback Address :: http://www.ssial.com/trackback/163 관련글 쓰기

  1. louis vuitton 2011/09/29 17:27 댓글주소 | 수정/삭제 | 댓글

    [url=http://www.my-coachoutletonline.com/]coach outlet store online[/url]
    [url=http://www.coachoutletonline-malls.com/]coach factory outlet[/url]
    [url=http://www.coachfactoryonline-outlets.com/]coach factory outlet online[/url]
    [url=http://www.cheapcoachbags-purses.com/]cheap coach bags[/url]
    [url=http://www.coachhandbags-outletonline.net/]coach outlet online[/url]
    [url=http://www.lvbags-louisvuitton.com/]lv bags[/url]
    [url=http://www.coachwallets-outlet.net/]coach wallet[/url]
    [url=http://www.louisvuitton9.net/]louis vuitton outlet[/url]
    [url=http://www.louisvuitton0.net/]louis vuitton[/url]
    [url=http://www.louisvuittonoutlet0.net/]louis vuitton outlet[/url]
    [url=http://www.coachfactoryonline-outlets.com/]coach factory outlet[/url]
    [url=http://www.outletcoachfactoryonline.com/]coach factory[/url]
    [url=http://www.topoutletmalls.net/]louis vuitton outlet[/url]
    [url=http://www.gogooutletonline.net/]louis vuitton outlet online[/url]

  2. Burberry Bags 2011/10/13 16:50 댓글주소 | 수정/삭제 | 댓글

    I'm happy I found this blog! From time to time students want to cognitive the keys of productive literary essays composing. Your first-class knowledge about this good post can become a proper basis for such people. Thanks.

  3. Coach Outlet Online 2011/11/15 12:23 댓글주소 | 수정/삭제 | 댓글

    It's very good!Thank you for sharing it!I like buying handbags of the internet website:http://www.mycoachoutletstoreonline.com

  4. Coach Factory Online 2011/12/11 23:00 댓글주소 | 수정/삭제 | 댓글

    I댓글주소 | 수정/삭제 | 댓글

  5. Coach Factory Outlet Online 2011/12/14 15:57 댓글주소 | 수정/삭제 | 댓글

    Great Coach Factory Outlet Online
    . A lot of useful information here. I’m sending it to some friends!

  6. Burberry Shop Online 2012/01/11 15:22 댓글주소 | 수정/삭제 | 댓글

    <p><strong><a href="http://www.burberrydiscount.org/">Burberry Discount</a></strong> developed a local community utilizing bags to write about in her appreciation and consciousness and also to preserve people within your loop about high quality replica artist handbag sites, such as touch bags.<br>
    <a href="http://www.burberryoutletshoponline.com/"><strong>Burberry Shop Online</strong></a> puts inside the work to can be found throughout only the extremely perfect high quality sites, steering toward magnitude of placing her on the internet protection inside the collection by attempting to purchase a replica artist handbag by method of the website itself.<br>
    <a href="http://www.onlinesburberryoutlet.com/"><strong>Burberry Outlet</strong></a> then talks concerning the website on blog of handbags. Luckily, these various quality websites are acquiring shut affordable inside the droves to make certain that people aren't scammed away from their hard-earned money.</p>

  7. abercrombie and fitch deutschland 2012/02/07 16:56 댓글주소 | 수정/삭제 | 댓글

    Keep up the good work!.

  8. abercrombie 2012/02/07 16:56 댓글주소 | 수정/삭제 | 댓글

    This was very informative. I have been reading your blog a lot over the past few days and it has earned a place in my bookmarks.

Write a comment


taglib download site

JSP/Basic 2008/11/25 11:17
http://jakarta.apache.org/site/downloads/downloads_taglibs.html

jstl.jar 와 standard.jar를 WEB-INF\lib에 복사한다.
jstl은 인터페이스이고 standard는 구현체이다.

http://java.sun.com/products/jsp/taglibraries/index.jsp
top

Trackback Address :: http://www.ssial.com/trackback/161 관련글 쓰기

  1. Chanel Outlet 2011/09/17 21:45 댓글주소 | 수정/삭제 | 댓글

    Time is what you make of it.

  2. louis vuitton 2011/09/29 17:27 댓글주소 | 수정/삭제 | 댓글

    <a href="http://www.my-coachoutletonline.com/" title="coach outlet store online">coach outlet store online</a>
    <a href="http://www.coachoutletonline-malls.com/" title="coach factory outlet">coach factory outlet</a>
    <a href="http://www.coachfactoryonline-outlets.com/" title="coach factory outlet online">coach factory outlet online</a>
    <a href="http://www.cheapcoachbags-purses.com/" title="cheap coach bags">cheap coach bags</a>
    <a href="http://www.coachhandbags-outletonline.net/" title="coach outlet online">coach outlet online</a>
    <a href="http://www.lvbags-louisvuitton.com/" title="lv bags">lv bags</a>
    <a href="http://www.coachwallets-outlet.net/" title="coach wallet">coach wallet</a>
    <a href="http://www.louisvuitton9.net/" title="louis vuitton outlet">louis vuitton outlet</a>
    <a href="http://www.louisvuitton0.net/" title="louis vuitton">louis vuitton</a>
    <a href="http://www.louisvuittonoutlet0.net/" title="louis vuitton outlet">louis vuitton outlet</a>
    <a href="http://www.coachfactoryonline-outlets.com/" title="coach factory outlet">coach factory outlet</a>
    <a href="http://www.outletcoachfactoryonline.com/" title="coach factory">coach factory</a>
    <a href="http://www.topoutletmalls.net/" title="louis vuitton outlet">louis vuitton outlet</a>
    <a href="http://www.gogooutletonline.net/" title="louis vuitton outlet online">louis vuitton outlet online</a>
    <a href="http://www.louisvuitton-outlet.ca/" title="louis vuitton outlet">louis vuitton outlet</a>
    <a href="http://www.coachoutletonline-max.com/" title="coach outlet online">coach outlet online</a>
    <a href="http://www.ca-coach.com/" title="coach outlet online">coach outlet online</a>

  3. Coach Outlet Online 2011/11/15 12:44 댓글주소 | 수정/삭제 | 댓글

    I'm happy I found this blog ! It's very good and thank you for sharing it !

  4. new era cap 2011/12/21 15:34 댓글주소 | 수정/삭제 | 댓글

    That was a reversal of <a href="http://www.wholesalenewerahatscaps.com/">new era caps</a> his sour bets earlier in the year that <a href="http://www.wholesalenewerahatscaps.com/">new era hat</a> Treasury yields would climb

  5. abercrombie and fitch deutschland 2012/02/07 16:56 댓글주소 | 수정/삭제 | 댓글

    Keep up the good work!.

  6. abercrombie 2012/02/07 16:56 댓글주소 | 수정/삭제 | 댓글

    This was very informative. I have been reading your blog a lot over the past few days and it has earned a place in my bookmarks.

Write a comment


=========================== PagingTest.jsp ==================================

<html>
<head><title>페이징   블록 처리 테스트</title>
<link href="style.css" rel="stylesheet" type="text/css">
<body>
 <center>
  <br>
  <br>
  <h2>페이징   블록 처리 테스트</h2>
  <FORM METHOD=POST ACTION="PagingResult.jsp">
   총 레코드 값 : <INPUT TYPE="text" NAME="totalRecord">&nbsp;
      <INPUT TYPE="submit" value="보내기">
  </FORM>
 </center>
</body>
</html>

=========================== PagingResult.jsp ==================================

<%@ page contentType="text/html;charset=EUC-KR"%>
<%

 /*
  페이징에 필요한 변수 10가지
 
 // 초기값 변수 3개
 01. totalRecord  //전체 record 수 , 배열의 length, size(), length(), sql문의 count()
 02. NUM_PER_PAGE = 10; // 한 페이지에 보여질 행(목록)의 수 지정 , 상수
 03. PAGE_PER_BLOCK = 20; // 한 블록에서 보여질 페이지의 수 지정, 상수
 
 // 사용자 요청 변수 2개
 04. nowPage   //  디폴트 값은 1페이지(인덱스 값은 0), 사용자의 요청의 의해서 결정 ,
      //  request.getParameter("nowPage"); 으로 받아서 사용
      //  beginPerPage를 계산하는 데 사용하기 때문에 타입케스팅이 필요하다.
      //  Integer.parseInt(request.getParameter("nowPage"));
 05. nowBlock  //  디폴트 값은 1 블록(인덱스 값은 0), 사용자의 요청의 의해서 결정 ,
      // request.getParameter("nowBlock"); 으로 받아서 사용
      // 페이징의 페이지에 표시되는 숫자의 인덱스 값을 구하기 위해서 타입케스팅이 필요하다.
      //  Integer.parseInt(request.getParameter("nowBlock"));
 
 // 검색 처리 변수 2개
 06. keyField  // 검색기능을 수행 할 때 필요한 필드명를 저장하는 변수, sql문에서 사용
 07. keyWord   // 검색기능을 수행 할 때 필요한 필드의 검색하려는 내용을 저장하는 변수, sql문에서 사용
        // select * from board where " + keyField + " like '%" + keyWord + "%'
 
 // 페이징을 화면에 표시 할 때 필요한 변수 3개
 08. beginPerPage  // 페이지를 출력 할 때 첫번째 위치를 찾는 변수, for문의 초기값에 사용
                   // 계산하는 방법은  = (nowPage * NUM_PER_PAGE) + 1;
 09. totalPage   // 전체 페이지의 숫자를 저장해서 페이징의 페이지 숫자를 표시 할 때 필요,
          // 계산하는 방법은  = (totalREecord / NUM_PER_PAGE) + (((totalRecord % NUM_PER_PAGE) != 0) ? 1 : 0);
          // 계산하는 방법은  = (int)Math.ceil((double)totalRecord / NUM_PER_PAGE);
 10. totalBlock  // 전체 블록수를 저장해서 페이징의 블록 숫자를 표시 할 때 필요,
     // 계산하는 방법은  = (totalPage / NUM_PER_BLOCK) + (((totalRecord % NUM_PER_BLOCK) != 0) ? 1 : 0);
      // 계산하는 방법은  = (int)Math.ceil((double)totalPage / NUM_PER_BLOCK);
 */
 
    int nowPage = 0;
    int nowBlock = 0;
    int totalRecord = Integer.parseInt(request.getParameter("totalRecord"));
    int NUM_PER_PAGE = 7;          
    int PAGE_PER_BLOCK = 10;   
   
 int totalPage =(int)Math.ceil((double)totalRecord / NUM_PER_PAGE);
 int totalBlock =(int)Math.ceil((double)totalPage / PAGE_PER_BLOCK);
 
 if (request.getParameter("nowPage") != null){
   nowPage= Integer.parseInt(request.getParameter("nowPage")); }
 if (request.getParameter("nowBlock") != null){
   nowBlock = Integer.parseInt(request.getParameter("nowBlock"));}
 int beginPerPage =   nowPage * NUM_PER_PAGE; 
%>
<html>
<head><title>JSPBoard</title>
<link href="style.css" rel="stylesheet" type="text/css">
<script>
function preBlock(nowBlock,nowPage){
      document.total.nowBlock.value = nowBlock;
   document.total.nowPage.value = nowPage;
      total.submit();
 }

function prePage(nowBlock,nowPage){
      document.total.nowBlock.value = nowBlock;
   document.total.nowPage.value = nowPage;
      total.submit();
 }

function afterBlock(nowBlock,nowPage){
      document.total.nowBlock.value = nowBlock;
   document.total.nowPage.value = nowPage;
      total.submit();
 }
</script>
</head>
<body><center><br>
 <h2>페이징  블록 처리 테스트</h2>
 <br>
  <table>
   <tr>
   <td>게시물번호 : &nbsp;</td>
   </tr>
  
 <%
 for (int i = beginPerPage;i < (beginPerPage+NUM_PER_PAGE); i++) {
  if (i==totalRecord){ break;}
 %>
 <tr>
 <td align=center><%= i + 1  %>&nbsp;</td>
 </tr>
 <%}%>
 </table><p>
 <table>
  <tr>
   <td align="left" >
 <% if(totalRecord !=0){ %> Go to Page
 <% if (nowBlock > 0) {%>
 <a href="javascript:preBlock('<%=nowBlock - 1 %>','<%=((nowBlock - 1) * PAGE_PER_BLOCK)%>')">
 이전 <%=PAGE_PER_BLOCK %>개</a>
 <%}%>

 :::

 <%
    for (int i = 0; i < PAGE_PER_BLOCK; i++) { %>
    <a href="javascript:prePage('<%=nowBlock%>','<%=(nowBlock*PAGE_PER_BLOCK) + i %>')">
 <%=(nowBlock * PAGE_PER_BLOCK) + i + 1 %></a>
    <% if ((nowBlock * PAGE_PER_BLOCK) + i + 1 == totalPage) { break; } %>
 <%} %>

 :::

 <% if (totalBlock > nowBlock + 1) { %>
 <a href="javascript:afterBlock('<%=nowBlock + 1 %>','<%=((nowBlock +1) * PAGE_PER_BLOCK)%>')">
 다음 <%=PAGE_PER_BLOCK%>개</a>
 <%}%>

 <%} else{out.println("등록된 게시물이 없습니다."); }%>
    </td>
   </tr>
  </table>
  <form name="total">
   <input type="hidden" name ="totalRecord" value="<%=totalRecord%>">
   <input type="hidden" name ="nowBlock">
   <input type="hidden" name ="nowPage">
  </form>
  </center>
 </body>
</html>

top

Trackback Address :: http://www.ssial.com/trackback/149 관련글 쓰기

  1. asd 2011/11/13 21:47 댓글주소 | 수정/삭제 | 댓글

    asd

  2. abercrombie and fitch deutschland 2012/02/07 16:56 댓글주소 | 수정/삭제 | 댓글

    Keep up the good work!.

  3. abercrombie 2012/02/07 16:56 댓글주소 | 수정/삭제 | 댓글

    This was very informative. I have been reading your blog a lot over the past few days and it has earned a place in my bookmarks.

Write a comment


Container를 이용해서 pool객체를 이용하기 위해서는 JNDI를 이용해야 한다.
JNDI는 J2EE의 javax.naming.* 패키지안의 JNDI 클래스를 import해야한다.

==============   데이터를 처리하는 JDBC 로직을 수행하는 파일  ==============

<%@ page import="javax.sql.*"%>
<%@ page import="javax.naming.*"%>

<%
.
.
.
 Context initCtx = new InitialContext();
 Context envCtx = (Context)initCtx.lookup("java:comp/env");
 DataSource ds = (DataSource)envCtx.lookup("jdbc/MySQLDataSource");
 con = ds.getConnection();
.
.
.
%>


그리고 프로젝트 WEB-INF\web.xml과 %CATALINA_HOME%\conf\server.xml 을 수정해야 한다.
================ web.xml ============================
<resource-ref>element를 추가한다.
=====================================================

<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">

.
.
.

  <resource-ref>
   <res-ref-name>jdbc/MySQLDataSource</res-ref-name>
   <res-type>javax.sql.DataSource</res-type>
   <res-auth>Container</res-auth>
  </resource-ref>
.
.
.
</web-app>

================ server.xml ============================
<Resource>element를 두 곳에 추가한다.
=======================================================

<Server port="8005" shutdown="SHUTDOWN">
.
.
.
  <GlobalNamingResources>
       <Resource auth="Container" description="User database that can be updated and saved" factory="org.apache.catalina.users.MemoryUserDatabaseFactory" name="UserDatabase" pathname="conf/tomcat-users.xml" type="org.apache.catalina.UserDatabase"/>


      <Resource auth="Container" name="jdbc/MySQLDataSource" type="javax.sql.DataSource" driverClassName="com.mysql.jdbc.Driver" password="1234" maxIdle="2" maxWait="5000" username="jspuser"
   url="jdbc:mysql://localhost:3306/testboarddb"
   maxActive="4"/>

  </GlobalNamingResources>
.
.
.
  <Service name="Catalina">
.
.
.
    <Engine defaultHost="localhost" name="Catalina">
.
.
.
        <Host appBase="webapps" autoDeploy="true" name="localhost" unpackWARs="true" xmlNamespaceAware="false" xmlValidation="false">
.
.
.
           <Context docBase="TestBoard" path="/TestBoard" reloadable="true" source="org.eclipse.jst.jee.server:TtestBoard">

              <Resource auth="Container" name="jdbc/MySQLDataSource" type="javax.sql.DataSource" driverClassName="com.mysql.jdbc.Driver" password="1234" maxIdle="2" maxWait="5000" username="jspuser"
   url="jdbc:mysql://localhost:3306/testboarddb"
   maxActive="4"/>

           </Context>

       </Host>
    </Engine>
  </Service>
</Server>
top

Trackback Address :: http://www.ssial.com/trackback/139 관련글 쓰기

  1. Chanel Outlet 2011/09/17 21:30 댓글주소 | 수정/삭제 | 댓글

    Time is what you make of it.

  2. Burberry Bags 2011/10/13 17:11 댓글주소 | 수정/삭제 | 댓글

    I'm happy I found this blog! From time to time students want to cognitive the keys of productive literary essays composing. Your first-class knowledge about this good post can become a proper basis for such people. Thanks.

  3. Coach Outlet Online 2011/11/15 12:24 댓글주소 | 수정/삭제 | 댓글

    It's very good!Thank you for sharing it!I like buying handbags of the internet website:http://www.mycoachoutletstoreonline.com

  4. Coach Factory Online 2011/12/11 23:00 댓글주소 | 수정/삭제 | 댓글

    댓글주소 | 수정/삭제 | 댓글

  5. Coach Factory Outlet Online 2011/12/14 15:58 댓글주소 | 수정/삭제 | 댓글

    Great Coach Factory Outlet Online
    . A lot of useful information here. I’m sending it to some friends!

  6. abercrombie and fitch deutschland 2012/02/07 16:56 댓글주소 | 수정/삭제 | 댓글

    Keep up the good work!.

  7. abercrombie 2012/02/07 16:56 댓글주소 | 수정/삭제 | 댓글

    This was very informative. I have been reading your blog a lot over the past few days and it has earned a place in my bookmarks.

Write a comment