最近我照着别人的程序写了一个例子:功能是查询数据,然后把某一条数据返回到另一个页面。出现了如下问题:
页面上的jsp代码:
<td width="60" align="center"><bean:write name="rList" property="emplCode"/></td>
     <html:hidden name="rList" property="emplCode"/>
页面上的javascript代码:
 try{
     emplCode = window.document.forms[0].emplCode[index].value;
     }catch(e){
       emplCode = window.document.forms[0].emplCode.value;
    }
问题一:当查询数据只有一条时   我的页面调javascript的时候走的是catch分支,但是为什么别人的页面走的是try分支呢?很奇怪啊!有请大侠们指教!!!
问题二:为什么要用 <html:hidden name="rList" property="emplCode"/> 这句话呢?