If this <%=s_year%> is shown as the value it could be because that tag doesn t allow you to use runtime expressions (<%=...%> as values for that attribute. Then whatever text you enter will be used as it is.
I can see that you are using Struts for the form, right? Struts is really helpful in many cases, but once in a while you run into requirements that are easier to implement using ordinary JSP/HTML. You can achieve what you want like this:
somewhat easier than trying to tweak the other stuff into the Struts tags. Those who say scriptlets are forbidden, bad stuff, are only right 95% of the time I think. The last 5% of the times scriptlets are exactly the easiest and most elegant way to achieve what you need.
Don't worry that Struts won't be able to work with that form value. Struts can't see the difference when the data reaches the server anyways. It will populate your form bean just fine no matter if you use the Struts tag libs to generate the form, or ordinary HTML.
Jakob Jenkov<br />Softare Architect<br /><a href="http://www.jenkov.com" target="_blank" rel="nofollow">www.jenkov.com</a>
Joined: Jun 25, 2004
Thanks Jakob for your reply. You are right I was trying to be more sophisticated by using tag library. My goal is to populate all date/time values using collection and then pre-select current values. But I guess I have go back to good old days and use for loops to populate <select>