<body topmargin="0" leftmargin="0">
  <Br><br>
  <table width="500" height="28px"  border="0" align="center" cellpadding="0" cellspacing="0" id="y_tab">
    <tr align="center">
      <td align="center">
    <UL>
     <%if(request.getAttribute("type")==null){%>
       <LI class="yschfirst">
 <%}else{%>
      <LI>
     <%}%>
     <span id="address">地址</span>
 </LI>
     <LI> 
    <span id="name" ><a  href="#" onMouseDown="sb('name')">名称</a></span>
 </LI>
     <LI> 
    <span id="mobil" ><a  href="#" onMouseDown="sb('mobil')">手机号码</a></span>
 </LI>
     <LI> 
    <span id="standard" ><a  href="#" onMouseDown="sb('standard')">地址标准化</a></span>
 </LI>
</UL>
  </td>
</tr>  
  </table>
  <table width="550" height="70px"  border="0" align="center" cellpadding="0" cellspacing="0">
    <tr height="5px">
      <td width="5px" height="5px"  background="../images/y_box_a.gif"></td>
  <td width="590px" height="5px" background="../images/y_box_top_bg.gif"></td>
  <td width="5px" height="5px" background="../images/y_box_b.gif"></td>
    </tr>
    <tr bgcolor="#ffffc6" height="60px">
     <form action="<%=request.getContextPath()%>/allSearchAction.do?method=searchDo" method="post" name="form1">
  <td width="600" height="60px" colspan="3" style="border-right:1px solid #FFA800;border-left:1px solid #FFA800">
      &nbsp;<input type="hidden" name="type" id="type" value="address">
      <%if(request.getAttribute("searchText")==null){%>
    <input type="text" id="y_sch_box_input" name="searchText" >
  <%}else{%>
    <input type="text" id="y_sch_box_input" name="searchText" value="<%=(String)request.getAttribute("searchText")%>">
  <%}%>
  &nbsp;&nbsp;<input type="submit" class="y_sch_box_btn" value="搜   索"> 
  </td>
 </form> 
    </tr>
    <tr>
      <td width="5px" height="5px"  background="../images/y_box_d.gif"></td>
  <td width="590px" height="5px" background="../images/y_box_bot_bg.gif"></td>
  <td width="5px" height="5px" background="../images/y_box_c.gif"></td>
    </tr>
  </table>
  <table width="550" border="0" align="center" cellpadding="1" cellspacing="0">
    <tr class="result_bar">
      <td><span id="result_title">搜索结果</span></td>
    </tr>
    <logic:equal name="have_return" scope="request" value="false">
    <tr>
      <td  class="table_border_end">搜索不到符合条件的记录!</td>
    </tr>
    </logic:equal>
    <logic:equal name="have_return" scope="request" value="true"> <!--表示搜索得到记录 -->
      <logic:equal name="type" scope="request" value="address">
        <logic:present name="dataList" scope="request">
          <logic:iterate name="dataList" scope="request" id="xdata" type="com.unicom.gzaddr.entity.vo.AddressSearchVO">
            <tr>
              <td  class="table_border_end">
                 <html:link page="/addrview.do?method=view" paramProperty="addr_id" paramName="xdata"  paramId="addr_id"  style="color:blue;font-size:12px; "> <bean:write name="xdata" property="addr_name"/></html:link><br>
                 <bean:write name="xdata" property="addr_path"/>
              </td>
            </tr>
         </logic:iterate>
       </logic:present>
      </logic:equal>
    </logic:equal>
  </table>
  <p>&nbsp;</p>
  <p><br>
  </p>
  </body>
</html:html>

解决方案 »

  1.   

    Oh,my god!什么都提示都没有,这么长的代码!!
      

  2.   

    问题是这样的:
     <UL>
       <%if(request.getAttribute("type")==null){%>
        <LI class="yschfirst">
      <%}else{%>
        <LI>
      <%}%>
        <span id="address">地址</span>
      </LI>
      <LI> 
        <span id="name" ><a  href="#" onMouseDown="sb('name')">名称</a></span>
      </LI>
     <LI> 
        <span id="mobil" ><a  href="#" onMouseDown="sb('mobil')">手机号码</a></span>
     </LI>
     <LI> 
       <span id="standard" ><a  href="#" onMouseDown="sb('standard')">地址标准化</a></span>
      </LI>
    </UL>
    这是一个搜索,如果用户刚进这个页面时先中的是按”地址“搜索此时地址的北景样式是
    <LI class="yschfirst">地址</LI>
    我是通过sb("v")这个参数在控制当前是按啥搜索的。你可以看一下sb()函数。现在所遇的问题是,搜索得到结果后返回到当前页面时那个搜索类型按钮没有选中。也就是说<LI>没切换到正确的样式!!就是这样???愿意帮我的加我的QQ:286870817