<td>
          <input type="radio" name="traMethod" value="1" <%info.getTraMethod()="1"?"checked":""%>>航空
          <input type="radio" name="traMethod" value="2" <%info.getTraMethod()="2"?"checked":""%>>铁路
          <input type="radio" name="traMethod" value="3" <%info.getTraMethod()="3"?"checked":""%>>公路
        </td>请问错在那里?

解决方案 »

  1.   

    info.getTraMethod()是哪里来的方法
      

  2.   

    <%info.getTraMethod()="1"?"checked":""%>觉得这个有问题我觉得应该是<%=info.getTraMethod().equals("1")?"checked":""%>其他的类推
      

  3.   

    <td>
              <input type="radio" name="traMethod" value="1" <%=info.getTraMethod()="1"?"checked":""%>>航空
              <input type="radio" name="traMethod" value="2" <%=info.getTraMethod()="2"?"checked":""%>>铁路
              <input type="radio" name="traMethod" value="3" <%=info.getTraMethod()="3"?"checked":""%>>公路
            </td>
      

  4.   

    <td>
              <input type="radio" name="traMethod" value="1" <%info.getTraMethod()="1"?out.print("checked"):""%>>航空
              <input type="radio" name="traMethod" value="2" <%info.getTraMethod()="2"?out.print("checked"):""%>>铁路
              <input type="radio" name="traMethod" value="3" <%info.getTraMethod()="3"?out.print("checked"):""%>>公路
            </td>
      

  5.   

    <%后面要加=才能在页面上输出值。而且info.getTraMethod()="1"也应该是"1".equals(info.getTraMethod())比较合适。
    <%="1".equals(info.getTraMethod())?"checked":""%>
      

  6.   

    <%info.getTraMethod()="3"?"checked":""%> 应该有问题
      

  7.   

    <td>
              <input type="radio" name="traMethod" value="1" <%info.getTraMethod()=="1"?"checked":""%>>航空
              <input type="radio" name="traMethod" value="2" <%info.getTraMethod()=="2"?"checked":""%>>铁路
              <input type="radio" name="traMethod" value="3" <%info.getTraMethod()=="3"?"checked":""%>>公路
            </td>
    判断时应该“==”!!!!!!