Ecco una jsp tipo:
<%@ page import="it.nullpointer.bsc.beans.UserBean"%>
<%@ taglib uri="/tags/struts-logic" prefix="logic" %>
<%@ taglib uri="/tags/struts-html" prefix="html" %>
<%@ taglib uri="/tags/struts-bean" prefix="bean" %>
<%@ taglib uri="/tags/jstl-fmt" prefix="fmt" %>
<%@ taglib uri="/tags/struts-tiles" prefix="tiles" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Expires" content="-1" />
<meta http-equiv="Cache-Control" content="no-cache" />
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>xxxxxxx</title>
<link type="text/css" rel="stylesheet" href="css/bsc.css">
<style type="text/css">
<!--
.Stile1 {color: #000099}
-->
</style>
<script language="JavaScript" src="PreloadImages.js" ></script>
<script type="text/javascript">
function autofitIframe(id){ // v.1.0
//copyright 2004 Eddie Traversa http://www.dhtmlnirvana.com/
//!document.mimeType &&
if (!window.opera && document.all && document.getElementById){
parent.document.getElementById(id).style.height=th is.document.body.offsetHeight+"px";
}
else if(document.getElementById) {
parent.document.getElementById(id).style.height=th is.document.body.scrollHeight+"px"
}
}
function submitlogin()
{
if(document.all.formlogin.username.value.length>0 && document.all.formlogin.pwd.value.length>0 )
{
document.all.formlogin.submit();
}
else alert("<fmt:message key="app.login.alert.insert" />");
}
function logout()
{
document.forms["loginForm"].target="_parent";
document.forms["loginForm"].submit();
}
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
</script>
</head>
<body onload="autofitIframe('intestazione');MM_preloadIm ages('bandiere/lock_open.gif')" leftmargin="0" topmargin="0">
<jsp:useBean id="now" class="java.util.Date" scope="page" />
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" class="barra">
<tr class="barra">
<td ></td>
<td width="58%" class="barrasup"> </td>
<td width="24%" ><div align="center">
</div>
</td>
</tr>
<tr>
<td height="79" >[img]img/logo2.jpg[/img]</td>
<td><fmt:message key="app.label.home" /> | <fmt:message key="account.openAccount" /> | <fmt:message key="app.selectLanguage" /> | <fmt:message key="app.guide" /> | <fmt:message key="app.legalNotices" /></td>
<td width="24%" >
<logic:notPresent name="user" scope="session">
<fmt:formatDate value="${now}" pattern="yyyy" var="currYear" scope="page" />
<html:form action="login" >
<html:hidden property="dispatch" value="login"/>
<bean:define id="dispatchRegister" value="registerPage" />
<div align="center">
<table width="100%" border="0" cellspacing="0" bgcolor="#F1F0F0" class="pio">
<tr>
<td width="29%"><fmt:message key="app.utente" /></td>
<td width="27%"><html:text property="username" size="16" maxlength="16" styleClass="pio2" tabindex="1"/></td>
<td width="44%"><div align="left"><html:link target="_parent" page="/user.do" paramName="dispatchRegister" paramId="dispatch" styleClass="Stile1" ><fmt:message key="app.signIn" /></html:link></div></td>
</tr>
<tr>
<td><fmt:message key="app.password" /></td>
<td ><htmlassword property="pwd" size="16" maxlength="12" styleClass="pio2" tabindex="2"/></td>
<td><div align="left"><input type="image" style="width:24px;height:24px;font-size:10px" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image2','','bandiere/lock_open.gif',1)" value="login" onclick="submitlogin();return false;" src="bandiere/lock.gif" tabindex="3" name='Image2'></div></td>
</tr>
<tr>
<td colspan="3"> <div align=center>Lost password?</div> </td>
</tr>
</table>
</div>
</html:form>
</logic:notPresent>
<logicresent name="user" scope="session">
<html:form action="login" >
<html:hidden property="dispatch" value="logout"/>
</html:form>
<div align="center">[img]<fmt:message key=[/img]" width="215" height="31">
<span class="benvenuto">${user.name}${user.surname}</span>
<bean:define id="dispatchLogout" value="logout" scope="page" />
<bean:define id="dispatchAccount" value="template" scope="page" />
<html:link page="/accountAction.do" paramName="dispatchAccount" paramId="dispatch" styleClass="barrasup" target="_parent"> <fmt:message key="account.myAccount" /> </html:link> |<fmt:message key="app.logOut" />
<%--html:link page="/login.do" paramName="dispatchLogout" paramId="dispatch" styleClass="barrasup"> </html:link--%>
</div>
</logicresent>
</td>
</tr>
<logicresent name="user" scope="session">
<tr>
<td colspan="3" ></td>
</tr>
</logicresent>
</table>
<logic:notPresent name="user" scope="session">
<table width="997" border="0" align="left" cellpadding="0" cellspacing="0">
<tr>
<td width="8%" height="28"><span class="ora"><div id="serverTime" align="left" ></span></td>
<td width="1%"></td>
<td width="18%"><span class="ora">[img]img/flag-${localeForm.language}.gif[/img]</span></td>
<td width="80%">
<logic:messagesPresent message="true" >
<html:messages id="msg" message="true" >
<span class=error> <logicresent name="msg"><bean:write name="msg" /></logic
resent></span>
</html:messages>
</logic:messagesPresent>
</td>
</tr>
</table>
</logic:notPresent>
<logicresent name="user" scope="session">
<c:choose>
<c:when test="${user.currency.currency.currencyCode == serverConf.defaultCurrencies.currency.currencyCode }" >
<c:set scope="page" var="userExchangeRate" value="1" />
</c:when>
<ctherwise>
<logic:iterate name="exchangeRates" id="currency">
<c:if test="${currency.key == user.currency.currency.currencyCode}">
<c:set value="${currency.value.exchangeRate}" var="userExchangeRate" />
</c:if>
</logic:iterate>
</ctherwise></c:choose>
<table width="230" border="0" align="left" cellpadding="0" cellspacing="0">
<tr>
<td width="27%" height="28"><span class="ora"><div id="serverTime" align="left" ></span></td>
<td width="30%"><div id="userLang" align="left" ></td>
<td width="16%"><div id="userCurr" align="left" ></td>
<td width="27%"><span class="personale"><fmt:message key="app.welcome" />${user.name}${user.surname}</span></td>
</tr>
</logicresent>
<script>
var starttime = "<fmt:formatDate value="${now}" pattern="HH:mm:ss" />";
function clock(){
pos = starttime.indexOf(":");
hours = starttime.substring(0,pos);
left = starttime.substring(pos+1);
pos = left.indexOf(":");
minutes = left.substring(0,pos);
seconds = left.substring(pos+1);
if(seconds<59)
{
seconds++;
if(seconds.toString().length==1)
{
seconds = "0" + seconds.toString();
}
}else{
seconds = "00";
if(minutes<59){
minutes++;
if(minutes.toString().length==1){
minutes = "0" + minutes.toString();
}
}else{
minutes="00";
if(hours<24){
hours++;
if(hours.toString().length==1){
hours = "0" + hours.toString();
}
}else{
hours="00";
}
}
}
theDiv = document.getElementById("serverTime");
starttime = hours + ":" + minutes + ":" + seconds;
theDiv.innerHTML = starttime + " ";
setTimeout(clock,1000);
}
clock();
//document.all.formBet.submit();
</script>
<div align="left"></div>
</body>
</html>