Secure Web Forms & Struts Extensions
by Hari Gopal 

Listing One
 ...
 ...
<!-Use of OBJECT tag in HTML to access Microsoft CAPICOM component -- >
<object
       id="oCAPICOM"
       classid="clsid:A996E48C-D3DC-4244-89F7-AFA33EC60679"
       codebase="capicom.cab#version=2,0,0,0">
</object>

<!-Inclusion of signscript library into HTML -- >
<script src="signscript.js"></script>

</head>
<body bgcolor="#ffffcc">

<!- calling signing functionality on the form's onSubmit event -- >

<form action="js-leaveprocess.jsp" method="post" name="leaveform" 
                    onsubmit='return fsSignData(this,this.signatureData);'>
 ...
 ...
 ...
<!- Hidden variable that holds the PKCS#7 signature datat -- >
<input type="hidden" name="signatureData" value=""> 
 ...
 ...
 ...
</body>
</html>


Listing Two
 
<! - including appropriate tag libraries.  In this case 
     struts -html.tld is updated with signform tag information as well-- >
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>

<html:html>
<head>
<title>Eazy Leave - Struts Sample</title>

</head>
<body bgcolor="#ffffcc">
<html:errors/>
 ...
 ...
 ...
<! - defining signform tag -- >

<html:signform action="/leave"
    name="leaveForm"
    type="com.infosys.strutsample.eazyleave.LeaveForm"
    >
 ...
 ...
 ...
<! - closing of signform tag -- >
</html:signform>

</center>
</body>
</html:html>


Listing Three

(a)
<html:form action="/actionname"
        name="formName"
        type="actionType"
onSubmit="myValidation(document.formName) ">

(b) 
<html:form action="/actionname"
        name="formName"
        type="actionType"
        onSubmit="myValidation(this)">






1


