Código:
Y del jsp ytiene la siguiente estructura:<script type='text/javascript' >
* * window.onload = mostrarfoto();
* * *
* * function mostrarfoto() {
* * * * * *
<%
Date ahora = new Date();
SimpleDateFormat formateador = new SimpleDateFormat("dd-MM-yyyy");
String cadena= formateador.format(ahora);
String[] formatos=cadena.split("-");
int mayor=Integer.parseInt(formatos[2]);
int menor=mayor-100;
System.out.println("menor "+menor+ " mayor "+mayor);
for(int i = menor; i <mayor; i++){
%>
document.getElementById("anio").options[i] =new Option('<%=i%>');
document.getElementById("anio").options[i].value=<%=i%>;
i++;
<%
}
%>
}
</script>
Código HTML:
<select name="anio" id="anio" > <option value="2012">2012</option> </select>


