Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Incompatible operand types int and String

843838Nov 16 2006 — edited Nov 16 2006
hi all,
in jsp I have
<td>Handicap:</td>
    <td ><select name="handicapType" class="selectCourse2">
        <% String[] handicapT = new String[]{
                HandicapType.getShortString(HandicapType.HANDICAP),
                HandicapType.getShortString(HandicapType.NON_HANDICAP)};

            for (int k = 0; k < handicapT.length; k++) {
                String check = "";
                if (k == handicapType) {
                    check = " selected";
                }
        %>
        <option value="<%=k%>" <%=check%>><%=handicapT[k]%>
        </option>
        <% }
        %>
    </select>
in java class I have
 String gameType = request.getParameter("gameType");
        int GType=0;
        GType=Integer.parseInt(gameType);
do I have anything wrong?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 14 2006
Added on Nov 16 2006
1 comment
427 views