JSP code change

I am new to JSP, i am using the some tags here, It is having some problem with syntax, can you please correct it and give me?

<html:select name="manageFeedbackForm" onchange="temp()" property="feedbackCategory.emailId" styleClass="text">

<html:option value="-1">Select</html:option>

<%

String referer = request.getHeader("Referer");

for(int i=0; i<feedbackList.size();i++)

{

%>

<html:options collection="feedbackList" property="emailId" labelProperty="categoryDesc" ><%if((String)feedbackList.get(i).equals(referer)){%>selected<%}%>/>

<%}%>

</html:select>

[1119 byte] By [kasima] at [2007-11-27 9:07:31]
# 1

feedbackList.get(i).equals(referer)

should return a bolean... but you are typecasting it to a String object. And you are checking the string object in an if statement. If statement checks boolean value not a string.. I hope the correct code you want is:

<html:options collection="feedbackList" property="emailId" labelProperty="categoryDesc" ><%if(((String)feedbackList.get(i)).equals(referer)){%>selected<%}%>/>

NOTE an extra brace in the if statement

Hope it helps :)

diptaPBa at 2007-7-12 21:44:23 > top of Java-index,Java Essentials,New To Java...
# 2
If nothing matches, then the select statement need to get selected, otherwise corresponding values need to get selected. Is it sysntax is correct?
kasima at 2007-7-12 21:44:23 > top of Java-index,Java Essentials,New To Java...