ÿþ<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=unicode" /> <meta http-equiv="Content-Language" content="en-us" /> <style> <!-- p.MsoNormal {margin-top:0mm; margin-right:0mm; margin-bottom:10.0pt; margin-left:0mm; line-height:115%; font-size:12.0pt; font-family:"Times New Roman","serif";} h1 {margin-right:0mm; margin-left:0mm; font-size:24.0pt; font-family:"Times New Roman","serif"; font-weight:bold} a:link {color:blue; text-decoration:underline;} a:visited {color:purple; text-decoration:underline;} p {margin-right:0mm; margin-left:0mm; font-size:12.0pt; font-family:"Times New Roman","serif";} --> </style> <title>Creating an Action Class for Java Struts web framework</title> <meta name="keywords" content="opensource, Java, programs, examples, tutorial, web framework, technology, system, database, online" /> <meta name="description" content="A tutorial on how to create an action class for Java Struts web framework with screenshots" /> </head> <body lang="EN-US" link="#0000FF" vlink="#800080" topmargin="20" leftmargin="20" rightmargin="20" bottommargin="20"> <div class="WordSection1"> <h1 align="center" style="margin-bottom:0mm;margin-bottom:0; text-align:center;background:white; margin-top:0; margin-right:0"> <font size="6" face="Arial"><span style="font-weight:400">Introduction to the Struts Web Framework 4</span></font></h1> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;background:white; margin-top:0; margin-right:0">&nbsp;</p> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;background:white; margin-top:0; margin-right:0">&nbsp;</p> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;background:white; margin-top:0; margin-right:0">&nbsp;</p> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;background:white; margin-top:0; margin-right:0" align="center"><script type="text/javascript"><!-- google_ad_client = "pub-8089415323104206"; /* 728x90, created 5/16/08 javaos */ google_ad_slot = "1917524460"; google_ad_width = 728; google_ad_height = 90; //--> </script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script></p> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;background:white; margin-top:0; margin-right:0">&nbsp;</p> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;background:white; margin-top:0; margin-right:0">&nbsp;</p> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;background:white; margin-top:0; margin-right:0">&nbsp;</p> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;background:white; margin-top:0; margin-right:0"> &nbsp;</p> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;background:white; margin-top:0; margin-right:0"> <b><font size="3" face="Arial"> <span style="font-size:12.0pt;font-weight:bold">Creating an </span></font> <font face="Courier New"> <span style="font-family:&quot;Arial&quot;; font-weight:bold">Action</span></font></b><font face="Arial"><b><span style="font-weight:bold"> Class</span></b></font></p> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;background:white; margin-top:0; margin-right:0"> <font size="3" face="Arial"><span style="font-size:12.0pt">&nbsp;</span></font></p> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;background:white; margin-top:0; margin-right:0"> <font size="3" face="Arial"><span style="font-size:12.0pt">The </span> </font><font face="Courier New"><span style="font-family:&quot;Arial&quot;"> Action</span></font><font face="Arial"> class contains the <b> <span style="font-weight:bold">business logic in the application</span></b>. When form data is received, it is the </font><font face="Courier New"> <span style="font-family:&quot;Arial&quot;">execute</span></font><font face="Arial"> method of an </font><font face="Courier New"> <span style="font-family:&quot;Arial&quot;">Action</span></font><font face="Arial"> object that processes the data and determines which view to forward the processed data to. Because the </font><font face="Courier New"> <span style="font-family: &quot;Arial&quot;">Action</span></font><font face="Arial"> class is integral to the Struts framework, NetBeans IDE provides you with a wizard.</font></p> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;background:white; margin-top:0; margin-right:0"> <font size="3" face="Arial"><span style="font-size:12.0pt">&nbsp;</span></font></p> <p class="MsoNormal" style="margin-top:0;margin-right:0;margin-bottom:0mm; margin-left:18.0pt;margin-bottom:0;text-indent:-18.0pt;background:white"> <span style="font-size: 12.0pt"><font size="3" face="Arial">1.</font><font size="1" face="Times New Roman"><span style="font-style:normal; font-variant:normal; font-weight:normal; font-size:7.0pt; font-family:Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></font></span><font face="Arial">In the Projects window, right-click the </font><font face="Courier New"> <span style="font-family:&quot;Arial&quot;">MyStrutsApp</span></font><font face="Arial"> project node and choose New &gt; Other. From the Struts category choose Struts Action and click Next.</font></p> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;background:white; margin-top:0; margin-right:0"> <font size="3" face="Arial"><span style="font-size:12.0pt">&nbsp;</span></font></p> <p class="MsoNormal" align="center" style="margin-bottom:0mm;margin-bottom:0; text-align:center;background:white; margin-top:0; margin-right:0"> <font size="3" face="Arial"><span style="font-size:12.0pt"> <img border="0" width="561" height="382" src="StrutsWebFrameworkwithMVCNetbeans_files/structsjavawebservernetbeans041.png" alt="NetBeans with struts framework project - adding new component into the struts project" /></span></font></p> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;background:white; margin-top:0; margin-right:0"> <font size="3" face="Arial"><span style="font-size:12.0pt">&nbsp;</span></font></p> <p class="MsoNormal" align="center" style="margin-bottom:0mm;margin-bottom:0; text-align:center;background:white; margin-top:0; margin-right:0"> <font size="3" face="Arial"><span style="font-size:12.0pt"> <img border="0" width="608" height="401" src="StrutsWebFrameworkwithMVCNetbeans_files/structsjavawebservernetbeans042.png" alt="NetBeans with struts framework project - adding struts Action into the project" /></span></font></p> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;background:white; margin-top:0; margin-right:0"> <font size="3" face="Arial"><span style="font-size:12.0pt">&nbsp;</span></font></p> <p class="MsoNormal" style="margin-top:0;margin-right:0;margin-bottom:0mm; margin-left:18.0pt;margin-bottom:0;text-indent:-18.0pt;background:white"> <span style="font-size: 12.0pt"><font size="3" face="Arial">2.</font><font size="1" face="Times New Roman"><span style="font-style:normal; font-variant:normal; font-weight:normal; font-size:7.0pt; font-family:Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></font></span><font face="Arial">In the Name and Location panel, change the name to </font><font face="Courier New"> <span style="font-family:&quot;Arial&quot;">LoginAction</span></font><font face="Arial">.</font></p> <p class="MsoNormal" style="margin-top:0;margin-right:0;margin-bottom:0mm; margin-left:18.0pt;margin-bottom:0;text-indent:-18.0pt;background:white"> <span style="font-size: 12.0pt"><font size="3" face="Arial">3.</font><font size="1" face="Times New Roman"><span style="font-style:normal; font-variant:normal; font-weight:normal; font-size:7.0pt; font-family:Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></font></span><font face="Arial">Select </font> <font face="Courier New"><span style="font-family:&quot;Arial&quot;">com.myapp.struts</span></font><font face="Arial"> in the Package drop-down list.</font></p> <p class="MsoNormal" style="margin-top:0;margin-right:0;margin-bottom:0mm; margin-left:18.0pt;margin-bottom:0;text-indent:-18.0pt;background:white"> <span style="font-size: 12.0pt"><font size="3" face="Arial">4.</font><font size="1" face="Times New Roman"><span style="font-style:normal; font-variant:normal; font-weight:normal; font-size:7.0pt; font-family:Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></font></span><font face="Arial">Type </font> <font face="Courier New"><span style="font-family:&quot;Arial&quot;">/login</span></font><font face="Arial"> in Action Path. This value must match the value you set for the </font> <font face="Courier New"><span style="font-family:&quot;Arial&quot;">action</span></font><font face="Arial"> attribute of the </font><font face="Courier New"> <span style="font-family:&quot;Arial&quot;">&lt;html:form&gt;</span></font><font face="Arial"> tags in </font><font face="Courier New"> <span style="font-family:&quot;Arial&quot;">login.jsp</span></font><font face="Arial">. Make sure settings appear as in the screenshot below, and then click Next. </font></p> <p class="MsoNormal" style="margin-top:0;margin-right:0;margin-bottom:0mm; margin-left:18.0pt;margin-bottom:0;text-indent:-18.0pt;background:white">&nbsp;</p> <p class="MsoNormal" align="center" style="margin-bottom:0mm;margin-bottom:0; text-align:center;background:white; margin-top:0; margin-right:0"> <font size="3" face="Arial"><span style="font-size:12.0pt"> <img border="0" width="603" height="418" src="StrutsWebFrameworkwithMVCNetbeans_files/structsjavawebservernetbeans043.png" alt="NetBeans with struts framework project - setting the name and location for new strut action" /></span></font></p> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;background:white; margin-top:0; margin-right:0"> <font size="3" face="Arial"><span style="font-size:12.0pt">&nbsp;</span></font></p> <p class="MsoNormal" style="margin-top:0;margin-right:0;margin-bottom:0mm; margin-left:18.0pt;margin-bottom:0;text-indent:-18.0pt;background:white"> <span style="font-size: 12.0pt"><font size="3" face="Arial">5.</font><font size="1" face="Times New Roman"><span style="font-style:normal; font-variant:normal; font-weight:normal; font-size:7.0pt; font-family:Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></font></span><font face="Arial">In the third step of the wizard, you are given the opportunity to associate the </font> <font size="2" face="Courier New"> <span style="font-size:10.0pt;font-family:&quot;Arial&quot;">Action</span></font><font face="Arial"> class with a form bean. Notice that the </font><font face="Courier New"> <span style="font-family: &quot;Arial&quot;">LoginForm</span></font><font face="Arial"> bean you previously created is listed as an option for ActionForm Bean Name. Make the following adjustments to the panel:</font></p> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;background:white; margin-top:0; margin-right:0"> <font size="3" face="Arial"><span style="font-size:12.0pt">&nbsp;</span></font></p> <p class="MsoNormal" style="margin-top:0;margin-right:0;margin-bottom:0mm; margin-left:54.0pt;margin-bottom:0;text-indent:-18.0pt;background:white"> <span style="font-size: 12.0pt"><font size="3" face="Arial">a.</font><font size="1" face="Times New Roman"><span style="font-style:normal; font-variant:normal; font-weight:normal; font-size:7.0pt; font-family:Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></font></span><font face="Arial">Delete the forward slash for the Input Resource field.</font></p> <p class="MsoNormal" style="margin-top:0;margin-right:0;margin-bottom:0mm; margin-left:54.0pt;margin-bottom:0;text-indent:-18.0pt;background:white"> <span style="font-size: 12.0pt"><font size="3" face="Arial">b.</font><font size="1" face="Times New Roman"><span style="font-style:normal; font-variant:normal; font-weight:normal; font-size:7.0pt; font-family:Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></font></span><font face="Arial">Set Scope to Request (Session is the default scope setting in Struts.)</font></p> <p class="MsoNormal" style="margin-top:0;margin-right:0;margin-bottom:0mm; margin-left:54.0pt;margin-bottom:0;text-indent:-18.0pt;background:white"> <span style="font-size: 12.0pt"><font size="3" face="Arial">c.</font><font size="1" face="Times New Roman"><span style="font-style:normal; font-variant:normal; font-weight:normal; font-size:7.0pt; font-family:Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></font></span><font face="Arial">Deselect the Validate ActionForm Bean option.</font></p> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;background:white; margin-top:0; margin-right:0"> <font size="3" face="Arial"><span style="font-size:12.0pt">&nbsp;</span></font></p> <p class="MsoNormal" align="center" style="margin-bottom:0mm;margin-bottom:0; text-align:center;background:white; margin-top:0; margin-right:0"> <font size="3" face="Arial"><span style="font-size:12.0pt"> <img border="0" width="655" height="373" src="StrutsWebFrameworkwithMVCNetbeans_files/structsjavawebservernetbeans044.png" alt="NetBeans with struts framework project - setting the ActionForm bean parameters" /></span></font></p> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;background:white; margin-top:0; margin-right:0"> <font size="3" face="Arial"><span style="font-size:12.0pt">&nbsp;</span></font></p> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;background:white; margin-top:0; margin-right:0"> <font size="3" face="Arial"><span style="font-size:12.0pt">Click Finish. The </span></font><font face="Courier New"> <span style="font-family:&quot;Arial&quot;">LoginAction</span></font><font face="Arial"> class is generated, and the file opens in the Source Editor. Also note that the following </font><font face="Courier New"> <span style="font-family:&quot;Arial&quot;">action</span></font><font face="Arial"> entry is added to the </font><font face="Courier New"> <span style="font-family:&quot;Arial&quot;">struts-config.xml</span></font><font face="Arial"> file:</font></p> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;background:white; margin-top:0; margin-right:0"> <font size="3" face="Arial"><span style="font-size:12.0pt">&nbsp;</span></font></p> <blockquote> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;background:white; margin-top:0; margin-right:0"> <font size="3" face="Courier New"> <span style="font-size:12.0pt;font-family:&quot;Arial&quot;">&lt;action-mappings&gt;</span></font></p> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;background:white; margin-top:0; margin-right:0"> <font size="3" face="Courier New"> <span style="font-size:12.0pt;font-family:&quot;Arial&quot;">&nbsp;&nbsp;&nbsp; <b><span style="font-weight:bold">&lt;action name=&quot;LoginForm&quot; path=&quot;/login&quot; scope=&quot;request&quot; type=&quot;com.myapp.struts.LoginAction&quot; validate=&quot;false&quot;/&gt;</span></b></span></font></p> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;background:white; margin-top:0; margin-right:0"> <font size="3" face="Courier New"> <span style="font-size:12.0pt;font-family:&quot;Arial&quot;">&nbsp;&nbsp;&nbsp; &lt;action path=&quot;/Welcome&quot; forward=&quot;/welcomeStruts.jsp&quot;/&gt;</span></font></p> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;background:white; margin-top:0; margin-right:0"> <font size="3" face="Courier New"> <span style="font-size:12.0pt;font-family:&quot;Arial&quot;">&lt;/action-mappings&gt;</span></font></p> </blockquote> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;background:white; margin-top:0; margin-right:0"> <font size="3" face="Arial"><span style="font-size:12.0pt">&nbsp;</span></font></p> <p class="MsoNormal" align="center" style="margin-bottom:0mm;margin-bottom:0; text-align:center;background:white; margin-top:0; margin-right:0"> <font size="3" face="Arial"><span style="font-size:12.0pt"> <img border="0" width="680" height="132" src="StrutsWebFrameworkwithMVCNetbeans_files/structsjavawebservernetbeans045.png" alt="NetBeans with struts framework project - the action-mapping of the actionForm bean" /></span></font></p> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;background:white; margin-top:0; margin-right:0"> <font size="3" face="Arial"><span style="font-size:12.0pt">&nbsp;</span></font></p> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;background:white; margin-top:0; margin-right:0"> <font size="3" face="Arial"><span style="font-size:12.0pt">The </span> </font><font face="Courier New"><span style="font-family:&quot;Arial&quot;"> name</span></font><font face="Arial"> and </font><font face="Courier New"> <span style="font-family:&quot;Arial&quot;">scope</span></font><font face="Arial"> attributes apply to the form bean that is associated with the action. Specifically, when an incoming request matches </font><font face="Courier New"> <span style="font-family:&quot;Arial&quot;">/login</span></font><font face="Arial">, the Struts framework automatically instantiates a </font> <font face="Courier New"><span style="font-family: &quot;Arial&quot;">LoginForm</span></font><font face="Arial"> object and populates it with the form data sent in the request. The default value of </font> <font face="Courier New"><span style="font-family:&quot;Arial&quot;">validate</span></font><font face="Arial"> is set to </font><font face="Courier New"> <span style="font-family:&quot;Arial&quot;">true</span></font><font face="Arial">. This tells the framework to call the </font><font face="Courier New"> <span style="font-family:&quot;Arial&quot;">validate</span></font><font face="Arial"> method of the form bean. You deselected this option in the wizard however because you will hand-code simple validation in the next step, which does not require the </font><font face="Courier New"> <span style="font-family:&quot;Arial&quot;">validate</span></font><font face="Arial"> method.</font></p> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;background:white; margin-top:0; margin-right:0"> <font size="3" face="Arial"><span style="font-size:12.0pt">&nbsp;</span></font></p> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;background:white; margin-top:0; margin-right:0"> <b><font size="3" face="Arial"> <span style="font-size:12.0pt;font-weight:bold">Implementing Simple Validation</span></font></b></p> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;background:white; margin-top:0; margin-right:0"> <font size="3" face="Arial"><span style="font-size:12.0pt">&nbsp;</span></font></p> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;background:white; margin-top:0; margin-right:0"> <font size="3" face="Arial"><span style="font-size:12.0pt">In the Source Editor, browse through the </span></font><font face="Courier New"> <span style="font-family:&quot;Arial&quot;">LoginAction</span></font><font face="Arial"> class (LoginAction.java) and look at the </font><font face="Courier New"> <span style="font-family:&quot;Arial&quot;">execute</span></font><font face="Arial"> method:</font></p> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;background:white; margin-top:0; margin-right:0"> <font size="3" face="Arial"><span style="font-size:12.0pt">&nbsp;</span></font></p> <blockquote> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;background:white; margin-top:0; margin-right:0"> <font size="3" face="Courier New"> <span style="font-size:12.0pt;font-family:&quot;Arial&quot;">public ActionForward execute(ActionMapping mapping, ActionForm form,</span></font></p> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;background:white; margin-top:0; margin-right:0"> <font size="3" face="Courier New"> <span style="font-size:12.0pt;font-family:&quot;Arial&quot;">&nbsp;&nbsp;&nbsp; HttpServletRequest request, HttpServletResponse response)</span></font></p> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;background:white; margin-top:0; margin-right:0"> <font size="3" face="Courier New"> <span style="font-size:12.0pt;font-family:&quot;Arial&quot;">&nbsp;&nbsp;&nbsp; throws Exception {</span></font></p> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;background:white; margin-top:0; margin-right:0"> <font size="3" face="Courier New"> <span style="font-size:12.0pt;font-family:&quot;Arial&quot;">&nbsp;</span></font></p> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;background:white; margin-top:0; margin-right:0"> <font size="3" face="Courier New"> <span style="font-size:12.0pt;font-family:&quot;Arial&quot;">&nbsp;&nbsp;&nbsp; return mapping.findForward(SUCCESS);</span></font></p> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;background:white; margin-top:0; margin-right:0"> <font size="3" face="Courier New"> <span style="font-size:12.0pt;font-family:&quot;Arial&quot;">}</span></font></p> </blockquote> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;background:white; margin-top:0; margin-right:0"> &nbsp;</p> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;background:white; margin-top:0; margin-right:0"> &nbsp;</p> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;background:white; margin-top:0; margin-right:0" align="center"> <script type="text/javascript"><!-- google_ad_client = "pub-8089415323104206"; /* 300x250, created 5/16/08javaos */ google_ad_slot = "8146009330"; google_ad_width = 300; google_ad_height = 250; //--> </script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script></p> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;background:white; margin-top:0; margin-right:0"> &nbsp;</p> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;background:white; margin-top:0; margin-right:0"> &nbsp;</p> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;background:white; margin-top:0; margin-right:0"> &nbsp;</p> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;background:white; margin-top:0; margin-right:0" align="center"> <font face="Arial">---------------------------------------------------------</font></p> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;background:white; margin-top:0; margin-right:0"> &nbsp;</p> <p class="MsoNormal" align="center" style="margin-bottom:0mm;margin-bottom:0; text-align:center;background:white; margin-top:0; margin-right:0"> <font size="3" face="Arial"><span style="font-size:12.0pt"> <img border="0" width="612" height="401" src="StrutsWebFrameworkwithMVCNetbeans_files/structsjavawebservernetbeans046.png" alt="NetBeans with struts framework project - the execute method" /></span></font></p> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;background:white; margin-top:0; margin-right:0"> <font size="3" face="Arial"><span style="font-size:12.0pt">&nbsp;</span></font></p> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;background:white; margin-top:0; margin-right:0"> <font size="3" face="Arial"><span style="font-size:12.0pt">Notice the definition of </span></font><font face="Courier New"> <span style="font-family:&quot;Arial&quot;">SUCCESS</span></font><font face="Arial">, listed beneath the </font><font face="Courier New"> <span style="font-family:&quot;Arial&quot;">LoginAction</span></font><font face="Arial"> class declaration:</font></p> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;background:white; margin-top:0; margin-right:0"> <font size="3" face="Arial"><span style="font-size:12.0pt">&nbsp;</span></font></p> <blockquote> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;background:white; margin-top:0; margin-right:0"> <font size="3" face="Courier New"> <span style="font-size:12.0pt;font-family:&quot;Arial&quot;; font-weight:700"> private final static String SUCCESS = &quot;success&quot;;</span></font></p> </blockquote> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;background:white; margin-top:0; margin-right:0"> <font size="3" face="Arial"><span style="font-size:12.0pt">&nbsp;</span></font></p> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;background:white; margin-top:0; margin-right:0"> <font size="3" face="Arial"><span style="font-size:12.0pt">Currently, the </span></font><font face="Courier New"> <span style="font-family:&quot;Arial&quot;">mapping.findForward</span></font><font face="Arial"> method is set to unconditionally forward any request to an output view called </font><font face="Courier New"><span style="font-family:&quot;Arial&quot;"> success</span></font><font face="Arial">. This is not really desirable; you want to first perform some sort of validation on the incoming data to determine whether to send the </font><font face="Courier New"> <span style="font-family:&quot;Arial&quot;">success</span></font><font face="Arial"> view, or any different view.</font></p> <ol> <li> <p class="MsoNormal" style="margin-top:0;margin-right:0;margin-bottom:0mm; margin-left:18.0pt;margin-bottom:0;text-indent:-18.0pt;background:white"> <font face="Arial">Accessing Bean Data and Preparing a Forwarding Condition</font></p> </li> <li> <p class="MsoNormal" style="margin-top:0;margin-right:0;margin-bottom:0mm; margin-left:18.0pt;margin-bottom:0;text-indent:-18.0pt;background:white"> <font face="Arial">Setting Up an Error Message</font></p> </li> </ol> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;background:white; margin-top:0; margin-right:0"> <font size="3" face="Arial"><span style="font-size:12.0pt">&nbsp;</span></font></p> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;background:white; margin-top:0; margin-right:0"> <b><font size="3" face="Arial"> <span style="font-size:12.0pt;font-weight:bold">Accessing Bean Data and Preparing a Forwarding Condition</span></font></b></p> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;background:white; margin-top:0; margin-right:0"> <font size="3" face="Arial"><span style="font-size:12.0pt">&nbsp;</span></font></p> <p class="MsoNormal" style="margin-top:0;margin-right:0;margin-bottom:0mm; margin-left:18.0pt;margin-bottom:0;text-indent:-18.0pt;background:white"> <span style="font-size: 12.0pt"><font size="3" face="Arial">1.</font><font size="1" face="Times New Roman"><span style="font-style:normal; font-variant:normal; font-weight:normal; font-size:7.0pt; font-family:Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></font></span><font face="Arial">Type in the following code within the body of the </font><font face="Courier New"> <span style="font-family:&quot;Arial&quot;">execute</span></font><font face="Arial"> method:</font></p> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;background:white; margin-top:0; margin-right:0"> <font size="3" face="Arial"><span style="font-size:12.0pt">&nbsp;</span></font></p> <blockquote> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;background:white; margin-top:0; margin-right:0"> <font size="3" face="Courier New"> <span style="font-size:12.0pt;font-family:&quot;Arial&quot;; font-weight:700"> // extract user data</span></font></p> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;background:white; margin-top:0; margin-right:0"> <font size="3" face="Courier New"> <span style="font-size:12.0pt;font-family:&quot;Arial&quot;; font-weight:700"> LoginForm formBean = (LoginForm)form;</span></font></p> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;background:white; margin-top:0; margin-right:0"> <font size="3" face="Courier New"> <span style="font-size:12.0pt;font-family:&quot;Arial&quot;; font-weight:700"> String name = formBean.getName();</span></font></p> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;background:white; margin-top:0; margin-right:0"> <font size="3" face="Courier New"> <span style="font-size:12.0pt;font-family:&quot;Arial&quot;; font-weight:700"> String email = formBean.getEmail();</span></font></p> </blockquote> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;background:white; margin-top:0; margin-right:0"> <font size="3" face="Arial"><span style="font-size:12.0pt">&nbsp;</span></font></p> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;background:white; margin-top:0; margin-right:0"> <font size="3" face="Arial"><span style="font-size:12.0pt">In order to use the incoming form data, you need to take </span></font><font face="Courier New"> <span style="font-family:&quot;Arial&quot;">execute</span></font><font face="Arial">&#39;s </font><font face="Courier New"><span style="font-family:&quot;Arial&quot;"> ActionForm</span></font><font face="Arial"> argument and cast it as </font> <font face="Courier New"><span style="font-family:&quot;Arial&quot;">LoginForm</span></font><font face="Arial">, then apply the getter methods that you created earlier.</font></p> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;background:white; margin-top:0; margin-right:0"> <font size="3" face="Arial"><span style="font-size:12.0pt">&nbsp;</span></font></p> <p class="MsoNormal" style="margin-top:0;margin-right:0;margin-bottom:0mm; margin-left:18.0pt;margin-bottom:0;text-indent:-18.0pt;background:white"> <span style="font-size: 12.0pt"><font size="3" face="Arial">2.</font><font size="1" face="Times New Roman"><span style="font-style:normal; font-variant:normal; font-weight:normal; font-size:7.0pt; font-family:Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></font></span><font face="Arial">Type in the following conditional clause to perform validation on the incoming data:</font></p> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;background:white; margin-top:0; margin-right:0"> <font size="3" face="Arial"><span style="font-size:12.0pt">&nbsp;</span></font></p> <blockquote> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;background:white; margin-top:0; margin-right:0"> <font size="3" face="Courier New"> <span style="font-size:12.0pt;font-family:&quot;Arial&quot;; font-weight:700"> // perform validation</span></font></p> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;background:white; margin-top:0; margin-right:0"> <font size="3" face="Courier New"> <span style="font-size:12.0pt;font-family:&quot;Arial&quot;; font-weight:700"> if ((name == null) ||&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // name parameter does not exist</span></font></p> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;background:white; margin-top:0; margin-right:0"> <font size="3" face="Courier New"> <span style="font-size:12.0pt;font-family:&quot;Arial&quot;; font-weight:700">&nbsp;&nbsp;&nbsp; email == null&nbsp; ||&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // email parameter does not exist</span></font></p> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;background:white; margin-top:0; margin-right:0"> <font size="3" face="Courier New"> <span style="font-size:12.0pt;font-family:&quot;Arial&quot;; font-weight:700">&nbsp;&nbsp;&nbsp; name.equals(&quot;&quot;) ||&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // name parameter is empty</span></font></p> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;background:white; margin-top:0; margin-right:0"> <font size="3" face="Courier New"> <span style="font-size:12.0pt;font-family:&quot;Arial&quot;; font-weight:700">&nbsp;&nbsp;&nbsp; email.indexOf(&quot;@&quot;) == -1) {&nbsp;&nbsp; // email lacks &#39;@&#39;</span></font></p> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;background:white; margin-top:0; margin-right:0"> <font size="3" face="Courier New"> <span style="font-size:12.0pt;font-family:&quot;Arial&quot;; font-weight:700">&nbsp;</span></font></p> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;background:white; margin-top:0; margin-right:0"> <font size="3" face="Courier New"> <span style="font-size:12.0pt;font-family:&quot;Arial&quot;; font-weight:700">&nbsp;&nbsp;&nbsp; return mapping.findForward(FAILURE);</span></font></p> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;background:white; margin-top:0; margin-right:0"> <font size="3" face="Courier New"> <span style="font-size:12.0pt;font-family:&quot;Arial&quot;; font-weight:700"> }</span></font></p> </blockquote> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;background:white; margin-top:0; margin-right:0"> <font size="3" face="Arial"><span style="font-size:12.0pt">&nbsp;</span></font></p> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;background:white; margin-top:0; margin-right:0"> <font size="3" face="Arial"><span style="font-size:12.0pt">At this stage, the </span></font><font face="Courier New"> <span style="font-family:&quot;Arial&quot;">execute</span></font><font face="Arial"> method should look as follows:</font></p> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;background:white; margin-top:0; margin-right:0"> <font size="3" face="Arial"><span style="font-size:12.0pt">&nbsp;</span></font></p> <blockquote> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;background:white; margin-top:0; margin-right:0"> <font size="3" face="Courier New"> <span style="font-size:12.0pt;font-family:&quot;Arial&quot;; font-weight:700"> public ActionForward execute(ActionMapping mapping, ActionForm form,</span></font></p> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;background:white; margin-top:0; margin-right:0"> <font size="3" face="Courier New"> <span style="font-size:12.0pt;font-family:&quot;Arial&quot;; font-weight:700">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; HttpServletRequest request, HttpServletResponse response)</span></font></p> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;background:white; margin-top:0; margin-right:0"> <font size="3" face="Courier New"> <span style="font-size:12.0pt;font-family:&quot;Arial&quot;; font-weight:700">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; throws Exception {</span></font></p> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;background:white; margin-top:0; margin-right:0"> <font size="3" face="Courier New"> <span style="font-size:12.0pt;font-family:&quot;Arial&quot;; font-weight:700">&nbsp;</span></font></p> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;background:white; margin-top:0; margin-right:0"> <font size="3" face="Courier New"> <span style="font-size:12.0pt;font-family:&quot;Arial&quot;; font-weight:700">&nbsp;&nbsp;&nbsp; // extract user data</span></font></p> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;background:white; margin-top:0; margin-right:0"> <font size="3" face="Courier New"> <span style="font-size:12.0pt;font-family:&quot;Arial&quot;; font-weight:700">&nbsp;&nbsp;&nbsp; LoginForm formBean = (LoginForm) form;</span></font></p> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;background:white; margin-top:0; margin-right:0"> <font size="3" face="Courier New"> <span style="font-size:12.0pt;font-family:&quot;Arial&quot;; font-weight:700">&nbsp;&nbsp;&nbsp; String name = formBean.getName();</span></font></p> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;background:white; margin-top:0; margin-right:0"> <font size="3" face="Courier New"> <span style="font-size:12.0pt;font-family:&quot;Arial&quot;; font-weight:700">&nbsp;&nbsp;&nbsp; String email = formBean.getEmail();</span></font></p> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;background:white; margin-top:0; margin-right:0"> <font size="3" face="Courier New"> <span style="font-size:12.0pt;font-family:&quot;Arial&quot;; font-weight:700">&nbsp;</span></font></p> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;background:white; margin-top:0; margin-right:0"> <font size="3" face="Courier New"> <span style="font-size:12.0pt;font-family:&quot;Arial&quot;; font-weight:700">&nbsp;&nbsp;&nbsp; // perform validation</span></font></p> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;background:white; margin-top:0; margin-right:0"> <font size="3" face="Courier New"> <span style="font-size:12.0pt;font-family:&quot;Arial&quot;; font-weight:700">&nbsp;&nbsp;&nbsp; if ((name == null) || // name parameter does not exist</span></font></p> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;background:white; margin-top:0; margin-right:0"> <font size="3" face="Courier New"> <span style="font-size:12.0pt;font-family:&quot;Arial&quot;; font-weight:700">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; email == null || // email parameter does not exist</span></font></p> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;background:white; margin-top:0; margin-right:0"> <font size="3" face="Courier New"> <span style="font-size:12.0pt;font-family:&quot;Arial&quot;; font-weight:700">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; name.equals(&quot;&quot;) || // name parameter is empty</span></font></p> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;background:white; margin-top:0; margin-right:0"> <font size="3" face="Courier New"> <span style="font-size:12.0pt;font-family:&quot;Arial&quot;; font-weight:700">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; email.indexOf(&quot;@&quot;) == -1) {&nbsp;&nbsp; // email lacks &#39;@&#39;</span></font></p> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;background:white; margin-top:0; margin-right:0"> <font size="3" face="Courier New"> <span style="font-size:12.0pt;font-family:&quot;Arial&quot;; font-weight:700">&nbsp;</span></font></p> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;background:white; margin-top:0; margin-right:0"> <font size="3" face="Courier New"> <span style="font-size:12.0pt;font-family:&quot;Arial&quot;; font-weight:700">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return mapping.findForward(FAILURE);</span></font></p> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;background:white; margin-top:0; margin-right:0"> <font size="3" face="Courier New"> <span style="font-size:12.0pt;font-family:&quot;Arial&quot;; font-weight:700">&nbsp;&nbsp;&nbsp; }</span></font></p> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;background:white; margin-top:0; margin-right:0"> <font size="3" face="Courier New"> <span style="font-size:12.0pt;font-family:&quot;Arial&quot;; font-weight:700">&nbsp;</span></font></p> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;background:white; margin-top:0; margin-right:0"> <font size="3" face="Courier New"> <span style="font-size:12.0pt;font-family:&quot;Arial&quot;; font-weight:700">&nbsp;&nbsp;&nbsp; return mapping.findForward(SUCCESS);</span></font></p> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;background:white; margin-top:0; margin-right:0"> <font size="3" face="Courier New"> <span style="font-size:12.0pt;font-family:&quot;Arial&quot;; font-weight:700"> }</span></font></p> </blockquote> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;background:white; margin-top:0; margin-right:0"> <font size="3" face="Arial"><span style="font-size:12.0pt">&nbsp;</span></font></p> <p class="MsoNormal" align="center" style="margin-bottom:0mm;margin-bottom:0; text-align:center;background:white; margin-top:0; margin-right:0"> <font size="3" face="Arial"><span style="font-size:12.0pt"> <img border="0" width="610" height="368" src="StrutsWebFrameworkwithMVCNetbeans_files/structsjavawebservernetbeans047.png" alt="NetBeans with struts framework project - the edited execute method" /></span></font></p> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;background:white; margin-top:0; margin-right:0"> <font size="3" face="Arial"><span style="font-size:12.0pt">&nbsp;</span></font></p> <p class="MsoNormal" style="margin-top:0;margin-right:0;margin-bottom:0mm; margin-left:18.0pt;margin-bottom:0;text-indent:-18.0pt;background:white"> <span style="font-size: 12.0pt"><font size="3" face="Arial">3.</font><font size="1" face="Times New Roman"><span style="font-style:normal; font-variant:normal; font-weight:normal; font-size:7.0pt; font-family:Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></font></span><font face="Arial">Add a declaration for </font> <font size="2" face="Courier New"> <span style="font-size:10.0pt;font-family:&quot;Arial&quot;">FAILURE</span></font><font face="Arial"> to the </font><font size="2" face="Courier New"> <span style="font-size:10.0pt; font-family:&quot;Arial&quot;">LoginAction</span></font><font face="Arial"> class (changes in <b><span style="font-weight:bold">bold</span></b>):</font></p> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;background:white; margin-top:0; margin-right:0"> <font size="3" face="Arial"><span style="font-size:12.0pt">&nbsp;</span></font></p> <blockquote> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;background:white; margin-top:0; margin-right:0"> <font size="3" face="Courier New"> <span style="font-size:12.0pt;font-family:&quot;Arial&quot;">private static final String SUCCESS = &quot;success&quot;;</span></font></p> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;background:white; margin-top:0; margin-right:0"> <b><font size="3" face="Courier New"> <span style="font-size:12.0pt;font-family:&quot;Arial&quot;;font-weight:bold"> private static final String FAILURE = &quot;failure&quot;;</span></font></b></p> </blockquote> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;background:white; margin-top:0; margin-right:0"> <font size="3" face="Arial"><span style="font-size:12.0pt">&nbsp;</span></font></p> <p class="MsoNormal" align="center" style="margin-bottom:0mm;margin-bottom:0; text-align:center;background:white; margin-top:0; margin-right:0"> <font size="3" face="Arial"><span style="font-size:12.0pt"> <img border="0" width="564" height="114" src="StrutsWebFrameworkwithMVCNetbeans_files/structsjavawebservernetbeans048.png" alt="NetBeans with struts framework project - adding the LoginAction class" /></span></font></p> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;background:white; margin-top:0; margin-right:0"> <font size="3" face="Arial"><span style="font-size:12.0pt">&nbsp;</span></font></p> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;background:white; margin-top:0; margin-right:0"> <font size="3" face="Arial"><span style="font-size:12.0pt">Using the above logic, the </span></font><font face="Courier New"> <span style="font-family:&quot;Arial&quot;">execute</span></font><font face="Arial"> method forwards the request to the </font><font face="Courier New"> <span style="font-family:&quot;Arial&quot;">success</span></font><font face="Arial"> view if the user provides an entry for both </font><font face="Courier New"> <span style="font-family: &quot;Arial&quot;">name</span></font><font face="Arial"> and </font> <font face="Courier New"><span style="font-family:&quot;Arial&quot;">email</span></font><font face="Arial"> fields, and the email entered contains an &#39;@&#39; sign. Otherwise, the </font> <font face="Courier New"><span style="font-family:&quot;Arial&quot;">failure</span></font><font face="Arial"> view is forwarded. As will be demonstrated below in Adding<u><font color="blue"><span style="color: blue"> </span></font></u></font><font face="Courier New"> <span style="font-family: &quot;Arial&quot;">forward</span></font><font face="Arial"><u><font color="blue"><span style="color: blue"> </span></font></u>Entries to<u><font color="blue"><span style="color:blue"> </span></font></u></font><font face="Courier New"> <span style="font-family:&quot;Arial&quot;">struts-config.xml</span></font><font face="Arial">, you can set the </font><font face="Courier New"> <span style="font-family:&quot;Arial&quot;">failure</span></font><font face="Arial"> view to point back to the form page, so that the user has another chance to enter data in the correct format.</font></p> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;background:white; margin-top:0; margin-right:0">&nbsp;</p> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;background:white; margin-top:0; margin-right:0">&nbsp;</p> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;background:white; margin-top:0; margin-right:0">&nbsp;</p> <p class="MsoNormal" style="margin-bottom:0mm;margin-bottom:0;background:white; margin-top:0; margin-right:0" align="center"><script type="text/javascript"><!-- google_ad_client = "pub-8089415323104206"; /* 728x15, created 5/16/08javaos */ google_ad_slot = "3545464564"; google_ad_width = 728; google_ad_height = 15; //--> </script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script></p> <hr color="#FF0000" /> <p class="MsoNormal" style="line-height: 100%; margin-top: 0; margin-bottom: 0" align="center"> <font face="Arial" size="5">&nbsp;<a title="Creating a Success Page" target="_top" href="http://www.visualcplusdotnet.com/javaopensource/StrutsWebFrameworkwithMVCNetbeans2.html">Strut &amp; Web 3</a> | <a title="The Java and open source applications" target="_top" href="http://www.javaguicodexample.com/"> Back to Main</a> | <a title="Setting Up an Error Message" target="_top" href="http://www.visualcplusdotnet.com/javaopensource/StrutsWebFrameworkwithMVCNetbeans4.html"> Strut &amp; Web 5</a></font></p> <p class="MsoNormal" style="margin-right: 0; margin-top: 0; margin-bottom: 0; background: white url('')">&nbsp;</p> <div align="center"><script src="http://tag.contextweb.com/TagPublish/getjs.aspx?action=VIEWAD&cwrun=200&cwadformat=728X90&cwpid=527221&cwwidth=728&cwheight=90&cwpnet=1&cwtagid=85440"></script></div> </div> </body> </html>