锘??xml version="1.0" encoding="utf-8" standalone="yes"?>jizzjizz亚洲日本少妇,亚洲精品视频久久久,亚洲黑人嫩小videoshttp://m.tkk7.com/joey/zh-cnMon, 12 May 2025 00:58:15 GMTMon, 12 May 2025 00:58:15 GMT60Google 緗戠粶鐖櫕鐐瑰嚮Google騫垮憡http://m.tkk7.com/joey/archive/2009/12/07/305030.html鍗庡畻鏋?/dc:creator>鍗庡畻鏋?/author>Mon, 07 Dec 2009 09:27:00 GMThttp://m.tkk7.com/joey/archive/2009/12/07/305030.htmlhttp://m.tkk7.com/joey/comments/305030.htmlhttp://m.tkk7.com/joey/archive/2009/12/07/305030.html#Feedback0http://m.tkk7.com/joey/comments/commentRss/305030.htmlhttp://m.tkk7.com/joey/services/trackbacks/305030.html榪欎袱澶╀粠www.AskBenny.cn鐨刧oogle analytics 涓儕濂囩殑鍙戠幇錛屼粠Google鏉ョ殑緗戠粶鐖櫕灞呯劧鑷繁鐖簡Google騫垮憡錛岀敋鏄儕濂?






]]>
涓涓狾penSSO 鐨勫疄闄呭簲鐢?/title><link>http://m.tkk7.com/joey/archive/2009/01/05/87745.html</link><dc:creator>鍗庡畻鏋?/dc:creator><author>鍗庡畻鏋?/author><pubDate>Mon, 05 Jan 2009 07:14:00 GMT</pubDate><guid>http://m.tkk7.com/joey/archive/2009/01/05/87745.html</guid><wfw:comment>http://m.tkk7.com/joey/comments/87745.html</wfw:comment><comments>http://m.tkk7.com/joey/archive/2009/01/05/87745.html#Feedback</comments><slash:comments>31</slash:comments><wfw:commentRss>http://m.tkk7.com/joey/comments/commentRss/87745.html</wfw:commentRss><trackback:ping>http://m.tkk7.com/joey/services/trackbacks/87745.html</trackback:ping><description><![CDATA[<span style="color: red;">** 榪欎釜鏄疨DF鏍煎紡鐨勫師浠跺湴鍧錛宧ttp://m.tkk7.com/Files/joey/opensso.rar ,澶у鍙互鎷垮幓鍙傝冿紝浣嗘槸璇鋒敞鎰忚繖涓枃妗f槸2006騫村啓鐨勶紝鍚庢潵鍐嶆棤鏇存柊錛屾墍浠ヨ娉ㄦ剰鐗堟湰銆?/span><br /> <br /> <p>     榪欐槸涓涓狾penSSO鐨勫疄闄呭簲鐢ㄥ疄渚? 鍥犱負鏄鎴瘋姹傝嫳鏂?鎵浠ュ彧鏈夎嫳鏂囩増,鎴戠殑鑻辨枃姣旇緝鐑?鎵浠ヨ澶у鍖呮兜浜? 鍏跺疄濡傛灉浣犲湪鐢∣penSSO鐨勬椂鍊欐湁浠涔堥夯鐑?鎴戣涓烘渶濂界殑姹傚姪鍦版柟鏄疧penSSO灝忕粍鐨凪ailList,鍦∣penSSO緗戠珯涓婃湁, 浠栦滑鐪熺殑寰堢儹蹇?鍩烘湰鏈夐棶24灝忔椂鍐呭繀澶?鑰屼笖閮芥槸OpenSSO灝忕粍鐨勬垚鍛樼瓟澶嶇殑.鐪熺殑寰堟.<br />  <br /> 澶у瀵規垜鐨勬枃绔犻噷鏈変粈涔堢枒闂篃鍙互緇欐垜鐣欒█.榪樻湁鍥犱負鍘熸潵鏄疨DF鏍煎紡鐨? 鍚庤漿鎴恡xt鏍煎紡, 鎵浠ユ湁浜涘湴鏂逛笉鏄緢濂界湅.璇峰ぇ瀹惰璋?br /> <br /> <br />                 Implement SSO with AD </p> <p>                             Joey </p> <p>                        December 26, 2006 </p> <p> <br /> </p> <p>Contents </p> <p>1 Software Environment                                                    2 </p> <p>2 Create Users in AD                                                      2 </p> <p>3 Join Linux into Windows2003 Domain                                      2 </p> <p>4 Install JBoss server and JRE 5                                          3 </p> <p>5 Fix Windows TCP port                                                    3 </p> <p>6 Deploy and Cong Access Manager                                          4 <br />  6.1 Deploy Access Manager . . . . . . . . . . . . . . . . . . . . . . .  4 <br />  6.2 Cong Access Manager . . . . . . . . . . . . . . . . . . . . . . . .  4 </p> <p>7 Install Sun Java System Access Manager Policy Agent                     6 </p> <p>8 Make Application to support SSO                                         7 </p> <p>A Cong DHCP Server                                                        8 </p> <p>B Cong Domain controller                                                  9 </p> <p>C Authorize DHCP server                                                  10 </p> <p> </p> <p><br />                                 1 <br /> <br /> 1 Software Environment </p> <p> Roles                               Computer name       Platform </p> <p> Domain             Server,DHCP       srv-1.contoso.com   Window2003 Active Directory <br />  Server,DNS Server <br />  Application server 1                test-1.contoso.com  Win2K3/XP, JRE5.0, SJS AM <br />                                                        Policy Agent 2.2 For JBoss <br />  Application server 2                test-2.contoso.com  Win2K3/XP, JRE5.0, SJS AM <br />                                                        Policy Agent 2.2 For JBoss <br />  Access Manager server               ams.contoso.com     Ret Hat Linux, JBoss 4.02 or <br />                                                        above </p> <p><br /> 2 Create Users in AD </p> <p>Create two group in AD, add one user for each group, and create amadmin as <br /> administrator for AM. </p> <p> User                                Group in AD </p> <p> admin                               users <br />  danie                               users <br />  amadmin                             Users </p> <p><br /> 3 Join Linux into Windows2003 Domain( Only for WIndows2003 DC, Ret Hat Linux )</p> <p>  1. Modify /etc/krb5.conf </p> <p>           Replace ’EXAMPLE.COM’ with your domain name, replace ker- <br />            beros.example.com with your AD server name. (case-sensitive in this <br />            section,just follow this demo). </p> <p><br />      krb5.conf sample: suppose Domain name is contoso.com, <br />      AD server is srv-1.contoso.com, and IP is 10.0.0.2. <br />      and then keep others default setting in krb5.conf </p> <p><br />      [libdefaults] <br />                 default_realm = CONTOSO.COM <br />                 dns_lookup_kdc = false <br />                 dns_lookup_realm = false </p> <p><br />      [realms] <br />      CONTOSO.COM = { <br />                 admin_server = srv-1.contoso.com:749 <br />                 default_domain = contoso.com <br />                 kdc = 10.0.0.2:88 <br />      } </p> <p><br />      [domain_realm] <br />                 .contoso.com=CONTOSO.COM </p> <p> </p> <p> </p> <p>                                        2 <br /> <br />                 contoso.com=CONTOSO.COM </p> <p> </p> <p><br />   2. Modify /etc/samba/smb.cof smb.cof sample: </p> <p><br />          realm = contoso.com              # add this by your self. <br />          workgroup = CONTOSO <br />          security = ADS </p> <p> </p> <p>  3. Get a ticket. run kinit administrator(enter the administrator password <br />       when prompted command) in a shell window. </p> <p>      sample: kinit <a href="mailto:administrator@CONTOSO.COM">administrator@CONTOSO.COM</a> </p> <p>  4. Join the domain Run net join in a shell window. </p> <p>      sample: net ads join </p> <p>  5. restart samba or just restart system simply. </p> <p><br /> 4 Install JBoss server and JRE 5 </p> <p>Install JBoss server and JRE 5 on Test-1.contoso.com, Test-2.contoso.com ,an <br /> ams.contoso.com </p> <p><br /> 5 Fix Windows TCP port </p> <p>  1. Start Registry Editor. </p> <p>  2. Locate the following subkey in the registry, and then click Parameters: <br />       HKEY LOCAL MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters </p> <p>  3. On the Edit menu, click New, and then add the following registry entry: <br />       Value Name: MaxUserPort <br />       Value Type: DWORD <br />       Value data: 65534 <br />       Valid Range: 5000-65534 (decimal) <br />       Default: 0x1388 (5000 decimal) <br />       Description: This parameter controls the maximum port number that is <br />       used when a program requests any available user port from the system. <br />       Typically , ephemeral (short-lived) ports are allocated between the values <br />       of 1024 and 5000 inclusive. </p> <p>  4. Quit Registry Editor.      2 </p> <p> </p> <p><br />   2 For more information, check here <a >http://support.microsoft.com/default.aspx?scid=kb;EN</a>- <br /> US;196271 </p> <p> </p> <p>                                            3 <br /> <br /> 6 Deploy and Cong Access Manager </p> <p>Do this step on ams.contoso.com </p> <p><br /> 6.1 Deploy Access Manager </p> <p>Copy ”opensso.war” to (JBossDIR) \ server\default\deploy </p> <p><br /> 6.2 Cong Access Manager </p> <p>  1. Start JBoss server. </p> <p>  2. In Brower (From any client computer), access the link ”http://ams.contoso.com:8080/opensso”. <br />      See following picture. </p> <p>  3. In Congurator page, you can change anything according your need. But <br />      in this case I keep all default values, just input new password in Super <br />      Administrator password, password is ”12345678”. And cookie Domain: <br />      ”.contoso.com”Click Congure button. </p> <p>  4. If everything is ok, you can see this page after few seconds. and you can <br />      click link ”here” or wait for 5 seconds, It will be automatically redirected <br />      to ”Sun Java System Access Manager” login page. See following picture. </p> <p>  5. And we need to login Access Manager. Type ”amadmin” for User Name, <br />      and ”12345678” for password.(This password is we input in 6.2.3) </p> <p>  6. Cong AD Authentication After you nish 6.2.5, use this web link to <br />      access AM. <a >http://ams.contoso.com:8080/opensso</a>. </p> <p>         Set Core Service. </p> <p>             – Click Conguration→ Authentication → Service Name : Core </p> <p>             – Select User Prole : Dynamic </p> <p>             – Click ”Save”, Click ”Back to Conguration”. </p> <p>         Access Control → Realm Name - opensso → Authentication, see <br />           pic 3. </p> <p>         Cong AD Module Instances </p> <p>             – Click ”New” Button in ”Module Instances”. </p> <p>             – Type a Name for new Instances, we use ”AD” in here and select <br />                 ”Active Directory” for type options, click ok. see pic-4. </p> <p>             – Click ”AD” what we just created in last step. and Input ... </p> <p> </p> <p><br />                                           4 <br /> <br />              Item                                Values </p> <p>             Primary       Active    Directory     srv-1.contoso.com:389 (remove default value) <br />              Server <br />              DN to Start User Search             dc=contoso, dc=com (remove default value) <br />              DN for Root User Bind               cn=administrator,cn=users,dc=contoso, <br />                                                 dc=com (remove default value) <br />              Password for Root User Bind         (Password of Domain administrator) <br />              Password for Root User Bind         (Password of Domain administrator) <br />              (conrm) <br />              Attribute Used to Retrieve          cn <br />              User Prole <br />              Attributes Used to Search for       cn (remove default value) <br />              a User to be Authenticated <br />              Return User DN to Authenti-         DeSelected <br />              cate </p> <p>        – ”Save” and click ”Back to Authentication”. </p> <p>7. Cong Authentication Chaining. </p> <p>     Click ”New” Button in ”Authentication Chaining”. </p> <p>     Type a name for New Authentication Chain; we use ”ADChain” in <br />       there. Click ”OK” button. </p> <p>     In ”AD Chain-Properties” Page, Click ”Add” button, and select <br />       ”AD” for Instance. See pic-5, click ”Save” and ”Back to Authen- <br />       tication”. </p> <p>     Set Default Authentication Chain <br />       Authentication → General, </p> <p>        – select ”ADChain” for ”Default Authentication Chain” </p> <p>        – select ”ADChain” for ”Administrator Authentication Chain” </p> <p>        – click ”Save” button, click ”Realms” button. </p> <p>     Create Agent <br />       Main Page → Access Control , select OpenSSO → Subjects → <br />       Agent → new Agent </p> <p>        ID                       Agent1 <br />         Password                 (password) <br />         Password (conrm)         (password) <br />         Device status            Active </p> <p> </p> <p><br />                                      5 <br /> <br /> 7 Install Sun Java System Access Manager Pol- <br />    icy Agent </p> <p> 1. Create a pasword le for following step. Just input the agent password <br />     into this le. sample: d:\ deploy\ password.txt </p> <p> 2. Unzip Access Manager Policy Agent. </p> <p> 3. Change to the following directory. <br />     PolicyAgent-base/bin </p> <p> 4. Issue the following command, and ll the values follow this table. <br />     agentadmin –install </p> <p>     Item                              Values </p> <p>     JBoss Server Cong Directory       D:\deploy\jboss- <br />                                       4.0.5.GA\server\default\conf <br />      Access Manager Services Host      ams.contoso.com <br />      Access Manager Services Port      8080 <br />      Access Manager Services Pro-      http <br />      tocol <br />      Access Manager Services De-       /opensso <br />      ployment URI <br />      Agent Host name                   test-1.contoso.com <br />      Agent permissions gets added      false <br />      to java permissions policy le <br />      Application Server Instance       8080 <br />      Port number <br />      Protocol for Application            http <br />      Server instance <br />      Deployment URI for the Agent      /opensso <br />      Application <br />      Encryption Key                    iF95s8yb4EFZSJQ7qFKybmZdyuXvKofQ <br />      Agent Prole name                  Agent1 <br />      Agent Prole Password le           d:\deploy\password.txt <br />      name </p> <p> </p> <p><br />                                     6 <br /> <br /> 8 Make Application to support SSO </p> <p> 1. Copy amclientsdk.jar to Application lib directory. </p> <p> 2. Add lter to Application. </p> <p><br />     In web.xml, add following code. </p> <p><br />           <filter> <br />                 <filter-name>Agent</filter-name> <br />                 <filter-class> com.sun.identity.agents.filter.AmAgentFilter </filter-class> <br />           </filter> <br />           <filter-mapping> <br />                 <filter-name>Agent</filter-name> <br />                 <url-pattern>/*</url-pattern> <br />                 <dispatcher>REQUEST</dispatcher> <br />                 <dispatcher>INCLUDE</dispatcher> <br />                 <dispatcher>FORWARD</dispatcher> <br />                 <dispatcher>ERROR</dispatcher> <br />           </filter-mapping> </p> <p> 3. Get the user name who is login on. </p> <p>    import com. iplanet . sso . SSOTokenManager ; <br />     import com. iplanet . sso . SSOToken ; <br />     import com. iplanet . sso . SSOException ; </p> <p><br />     . . . . . . <br />            SSOTokenManager manager = SSOTokenManager . <br />                 getInstance () ; <br />            SSOToken token = manager . createSSOToken ( request ) ; <br />             // HttpServletRequest request <br />             if (manager . isValidToken ( token ) ) <br />                { <br />                String userDN = token . getPrincipal () . getName () ; <br />                String userName = userDN . substring (userDN . <br />                   indexOf (”=”) + 1 , userDN . indexOf (” ,”) ) ; <br />                 System . out . println (”User DN = ” + userDN) ; <br />                 System . out . println (”User Name = ” + userName) ; </p> <p>              } <br />     . . . . . </p> <p><br />  4. Deploy this application. <br />     If this application has been deployed before, you better undeploy it and <br />     clean JBoss temp directory. </p> <p> </p> <p><br />                                      7 <br /> <br /> A Cong DHCP Server </p> <p>DHCP server conguration steps, do it on srv-1.contoso.com </p> <p> 1. In ”Manage You Server” click ”Add or remove a role”. </p> <p> 2. ”Congure Your Server Wizard”, click ”Next”. </p> <p> 3. Select ”Custom conguration”, click ”Next”. </p> <p> 4. Select ”DHCP server” click ”Next”. </p> <p> 5. Summary, Click ”Next”. </p> <p> 6. ”New Scope Wizard” click ”Next” </p> <p> 7. ”Scope Name”, set Name is ”Contoso HQ”. Click ”Next”. </p> <p> 8. ”IP Address Range”, set ”start IP address” is 10.0.0.10; ”End IP address” <br />     is 10.0.0.254. click ”Next” </p> <p> 9. ”Add Exclusions”, no need do nothing, just click ”Next” </p> <p>10. ”Lease Duration”, click ”Next”. </p> <p>11. ” Congure DHCP Options”, click ”Next” </p> <p>12. ”Router (Default Gateway)”, set IP address 10.0.0.1, click add, next. </p> <p>13. ”Domain Name and DNS servers” set parent domain as ”contoso.com”, <br />     for IP address, add 10.0.0.2. click ”Next” </p> <p>14. ”WINS servers”, just click ”Next”. </p> <p>15. ”Activate Scope”, select ”Yes, I want to active this scope now”, click <br />     ”next”. </p> <p>16. Click nish (twice). </p> <p> </p> <p><br />                                        8 <br /> <br /> B Cong Domain controller </p> <p>Steps for cong Domain controller On server srv-1.contoso.com </p> <p>  1. Run command ”DCPROMO”. </p> <p>  2. ”Welcome to the Active Directory Installation Wizard”, click ”Next”. </p> <p>  3. ”Operating System Compatibility”, click ”Next”. </p> <p>  4. ”Domain Controller type”, select ”Domain controller for a new domain”, <br />      click ”Next”. </p> <p>  5. ”Create New Domain”, select ”Domain in a new forest”, and click ”Next”. </p> <p>  6. ”Install or Congure DNS”, select ”No, just install and congure DNS on <br />      this computer”, click ”Next”. </p> <p>  7. ”New Domain Name”, type ”contoso.com”, clicks ”Next ”. </p> <p>  8. ”NetBIOS Domain Name”, accept ”CONTOSO” as Domain NetBIOS <br />      Name. Click ”Next”. </p> <p>  9. ”Database and Log Folders”, accept default value for Database and Log <br />      folder. Click ”Next”. </p> <p> 10. ”Shared System Volume”, accept default for Folder location, click ”Next”. </p> <p> 11. ”Permissions”, select ”Permissions compatible only with Windows 2000 <br />      or Windows Server2003 operating systems”. Click ”Next”. </p> <p> 12. ”Directory Services Restore Mode Administrator Password”, type pass- <br />      word, clicks ”Next”. </p> <p> 13. ”Summary”, click ”Next”. </p> <p> 14. ”Optional Networking Components”(a modal dialog).click ”ok”. </p> <p> 15. ”Local Area Connection Properties” pops up. Select TCP/IP, assign <br />      10.0.0.2 to IP address, type TAB two times, assign 10.0.0.1 to Default <br />      gateway. Assign 127.0.0.1 to Preferred DNS server. Click ”Ok” and then <br />      click ”Close”. </p> <p> 16. ”Completing the Active Directory Installation Wizard” click ”Finish”. </p> <p> 17. Click Restart Now. </p> <p> </p> <p><br />                                         9 <br /> <br /> C Authorize DHCP server </p> <p>On server srv-1.contoso.com <br /> Manage your Server → Manage this DHCP server → right click ”srv-1.contoso.com”, <br /> select ”Authorize”. </p> <p> </p> <p><br />                                   10 <br /> <br /> </p> <img src ="http://m.tkk7.com/joey/aggbug/87745.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.tkk7.com/joey/" target="_blank">鍗庡畻鏋?/a> 2009-01-05 15:14 <a href="http://m.tkk7.com/joey/archive/2009/01/05/87745.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>Applying the MVC Design Pattern Using Strutshttp://m.tkk7.com/joey/archive/2006/12/14/87744.html鍗庡畻鏋?/dc:creator>鍗庡畻鏋?/author>Thu, 14 Dec 2006 08:36:00 GMThttp://m.tkk7.com/joey/archive/2006/12/14/87744.htmlhttp://m.tkk7.com/joey/comments/87744.htmlhttp://m.tkk7.com/joey/archive/2006/12/14/87744.html#Feedback0http://m.tkk7.com/joey/comments/commentRss/87744.htmlhttp://m.tkk7.com/joey/services/trackbacks/87744.html http://www.ftponline.com/javapro/2002_05/magazine/columns/weblication/default.aspx


The Jakarta Stuts project takes care of some of the details when combining servlets and JavaBeans with JavaServer Pages
by Peter Varhol

May 2002 Issue

The Model-View-Controller (MVC) architecture leverages the strengths of servlets and JavaServer Pages (JSP), while minimizing their weaknesses. In essence, user requests are sent to a controller servlet, which determines the nature of the request and passes it off to the appropriate handler for that request type. Each handler is associated with a particular model, which encapsulates business logic to perform a specific and discrete set of functions. Once the operation is completed, the results are sent back to the controller, which determines the appropriate view and displays it (see my Weblication column "Strut Your Stuff," April 2002).

Struts, a Jakarta project, provides a framework for writing applications using the MVC architecture. Struts uses "ActionMapping," which enables the servlet to turn user requests into application actions. ActionMapping usually specifies a request path, the object type to act upon the request, and other properties as needed.

The Action object used as a part of the ActionMapping is responsible for either handling the request and sending the response back to the appropriate view (normally a Web browser), or passing the request along to the appropriate model.

The bridge between the model and the view is a form bean that can be created by subclassing org.apache.struts.action.ActionForm. The form bean can be used to hold data from the user prior to processing, or from a model prior to display back to the user. Struts includes custom tags that can automatically populate fields from the form bean created.

In practice, here's an outline of how Struts may work. A user enters a request on a JSP page for, say, information on train schedules between two cities. The controller servlet receives the request and determines where in the application it can be processed. The Action object passes the request on to a JavaBean that contains the appropriate schedule-retrieving business logic. That business-logic bean will connect to and query the database, receive the results, and return the results to the Action object. The Action object stores the result in a form bean as a part of the request. Once all of the data needed to fulfill the request has been collected, it's ready to be formatted and displayed. The last step is when the JavaServer Page displays the result to the view in HTML form.

The Controller, Model, and View
The primary component of the controller in Struts is the servlet defined from the class ActionServlet, which is configured by the ActionMappings. The ActionMapping class represents the name and location of the Action object. When a request comes into the controller, it maps the path of the request to the location of the Action, and the request is passed off to that Action. Struts' ActionMapping classes may also contain other information that may be unique to your application, like local variables, environment-specific data, or other URIs.

The activities surrounding the controller are the key to Struts. The Struts controller servlet maps events to classes (an event generally being an HTTP POST, GET, or similar request). ActionServlet is the command part of the MVC design pattern and is the core of the Struts framework. ActionServlet creates and uses Action, an ActionForm, and ActionForward. The struts-config.xml file configures the Action. During the creation of the Web application, you extend Action and ActionForm to solve the problem of how to respond to a user's request. The struts-config.xml file instructs ActionServlet on how to use the extended classes. You can also extend ActionServlet to provide your Struts application with custom features.

This approach has several advantages. First, the entire logical flow of the application is in a hierarchical text file. This makes it easier to view and understand, especially with large applications. Second, the HTML writer doesn't have to search through Java code to understand the flow of the application to make page changes, and the Java developer doesn't have to recompile code when making flow changes.

聽ActionForm maintains the session state for the Web application. ActionForm is an abstract class that is subclassed for each input form model. It represents a general concept of data that is set or updated by an HTML form. For instance, your application may have a UserActionForm that is set by an HTML Form. The Struts framework will check to see if a UserActionForm exists; if not, it creates an instance of the class. Struts will set the state of the UserActionForm using corresponding fields from the HttpServletRequest. The Struts framework updates the state of the UserActionForm before passing it to the business wrapper UserAction.

The Struts model consists of the state of the system and the actions that can be performed on it. You can use a wide variety of structures to represent the model (other servlets or JSP, for example), but most of the time you'll use JavaBeans. The JavaBean properties鈥攐r data drawn from external data sources in the case of Enterprise JavaBeans (EJBs)鈥攔epresent the state, while the methods represent the actions that can be performed. The actions do not need to be defined by JavaBean methods; in simple cases, the actions can be embedded into the Action object, although this tends to blur the distinction between processing and orchestration.

The view of a Struts MVC application typically is constructed using JSP, which provide for a way of statically formatting pages using HTML or XML, plus a method for dynamically inserting customized content in response to a user request. A key aspect of Struts is its custom tag library, which provides a way to create user interfaces easily using JSP.

聽The Struts framework includes custom tag libraries, which are used in a variety of ways. Although these libraries aren't required to use the framework, they contain tags that will be useful in many of your applications. Some of the Struts tag libraries included are:

聽聽聽 * struts-html tag library. This library can be used for creating dynamic HTML user interfaces and forms.
聽聽聽 * struts-bean tag library. This library provides substantial enhancements to the basic capability of bringing JavaBean code into a JSP page, which is provided by <jsp:useBean> tag.
聽聽聽 * struts-logic tag library. This library can manage conditional generation of output text, looping over object collections for repetitive generation of output text, and application flow management.
聽聽聽 * struts-template tag library. This library contains tags that are useful in creating dynamic JSP templates for pages that share a common look and feel, or common format.

You use these tag libraries just as you would any such library. Because the library is already written, all you have to do is tell the servlet engine about it. In Tomcat, you use the <taglib> tag in the web.xml file to specify the URI of the tag library, and the location of the tag library descriptor file on the Web server system.

The Small Print
The Jakarta project enables you to download either a binary distribution of Struts, or build it directly from source code. The binary usually works just fine, but if you have an unusual software platform, or want to build it as a learning experience, it's not difficult to do. Whichever you decide, Struts has several software prerequisites:

#聽 Java Development Kit (JDK). You have to download and install a Java 2 JDK implementation for your operating-system platform.
# Servlet container. You also have to download and install a servlet container that is compatible with the Servlet API specification, version 2.2 or later, and the JSP specification, version 1.1 or later. One good choice is to download Apache's Tomcat, which provides the ability to both serve Web pages and run servlets and JSP.
# XML parser. Struts requires the presence of an XML parser that is compatible with the Java API for XML Parsing (JAXP) specification, 1.1 or later.
# Servlet API classes. To compile Struts, or applications that use Struts, you will need a servlet.jar file containing the servlet and JSP API classes. Most servlet containers include this JAR file.
# JDBC 2.0 optional package classes. Struts supports an optional implementation of javax.sql.DataSource, so it requires that the API classes be compiled. You can download these package classes from http://java.sun.com/products/jdbc/download.html.

To use Struts to build an application, you need to follow these steps. First, copy the files lib/commons-*.jar and lib/struts.jar from the Struts distribution into the WEB-INF/lib directory of your application. Then copy the entire tag library descriptor file in lib/struts-*.tld from the Struts distribution into the WEB-INF directory of your Web application.

Once you have the files copied over, you can modify the web.xml file for your Web application to include a <servlet> element to define the controller servlet, and a <servlet-mapping> element to establish which request URIs are mapped to this servlet. If you are doing a standard installation with default directories, you can use the web.xml file from the Struts example application for an example of how to do this. Modify the web.xml file of your Web application to include the appropriate tag library declarations. Once again, you can follow the example of these declarations in the Struts example application.

After finishing the web.xml file, create a file called struts-config.xml in the WEB-INF directory that defines the action mappings and other characteristics of your specific application. Last, at the top of each JSP page that will use the Struts custom tags, add lines declaring the Struts custom tag libraries used on that particular page.

Struts was named for the type of supporting wires and frameworks used in buildings and old airplanes. Its intent is to provide a software framework to help you overcome the time-consuming aspects of applying the MVC design pattern in Web applications. You still have to learn and apply the framework, but it will accomplish some of the heavy lifting. If you want to build scalable applications combining the advantages of both servlets and JSP, Struts can get you a good part of the way there.

About the Author
Peter Varhol is a technical evangelist for Compuware Corporation. You can reach him at Peter.Varhol@ compuware.com.



]]>
Just say I am coming...http://m.tkk7.com/joey/archive/2006/02/11/30286.html鍗庡畻鏋?/dc:creator>鍗庡畻鏋?/author>Sat, 11 Feb 2006 11:31:00 GMThttp://m.tkk7.com/joey/archive/2006/02/11/30286.htmlhttp://m.tkk7.com/joey/comments/30286.htmlhttp://m.tkk7.com/joey/archive/2006/02/11/30286.html#Feedback0http://m.tkk7.com/joey/comments/commentRss/30286.htmlhttp://m.tkk7.com/joey/services/trackbacks/30286.html

]]>
主站蜘蛛池模板: 亚洲综合日韩久久成人AV| 亚洲人成伊人成综合网久久| 男人都懂www深夜免费网站| 亚洲av无码精品网站| 无码精品国产一区二区三区免费| 亚洲偷自精品三十六区| 亚洲欧洲中文日韩久久AV乱码| jizz在线免费观看| 亚洲综合小说久久另类区| 国内精品免费视频自在线| 男女作爱在线播放免费网站| 亚洲a无码综合a国产av中文| 亚洲深深色噜噜狠狠爱网站| 免费无码AV片在线观看软件| 日韩在线视频播放免费视频完整版| 亚洲成在人天堂在线| 成人影片麻豆国产影片免费观看 | 亚欧人成精品免费观看| 99亚洲乱人伦aⅴ精品| 亚洲精品国产情侣av在线| 亚洲国产aⅴ综合网| 69成人免费视频| 天黑黑影院在线观看视频高清免费| 国产成人精品日本亚洲网址| 国产亚洲综合网曝门系列| 日韩免费a级在线观看| 最近免费中文字幕视频高清在线看| 亚洲精品国产免费| 国产日韩AV免费无码一区二区| 亚洲黄片手机免费观看| 免费人成视频在线播放| 日本在线观看免费高清| 青青久久精品国产免费看 | 免费爱爱的视频太爽了| 91免费国产在线观看| 999国内精品永久免费视频| 3344免费播放观看视频| 18禁网站免费无遮挡无码中文| 免费精品国产日韩热久久| 成年在线观看网站免费| 成人奭片免费观看|