⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 jsp页面内实现动态下拉框!!.htm

📁 有关JSP的技巧
💻 HTM
📖 第 1 页 / 共 2 页
字号:
            <HR>
            <SMALL>&nbsp;<A 
            href="http://www.chinaunix.net/forum/profile.php?mode=viewprofile&amp;u=46833" 
            target=_blank>full</A> 回复于:2003-07-03 21:33:51</SMALL></TD></TR>
        <TR>
          <TD>还是不行啊!不知道是不是我理解错误,代码如下: 
            <BR><BR>String[]&nbsp;runcardResult&nbsp;=&nbsp;new&nbsp;String&nbsp;[xr.getRuncard().length];&nbsp;&nbsp; 
            <BR>String[]&nbsp;runcard2ISO&nbsp;=&nbsp;new&nbsp;String&nbsp;[runcardResult.length];&nbsp;&nbsp;//转为ISO8859_1字符集的流程名 
            <BR>runcardResult&nbsp;=&nbsp;xr.getRuncard(); 
            <BR>String&nbsp;runcard&nbsp;=&nbsp;new&nbsp;String&nbsp;(request.getParameter("runcard"));//用于显示 
            <BR>if(runcard&nbsp;==null){&nbsp; 
            <BR>&nbsp;&nbsp;&nbsp;&nbsp;runcard=runcardResult[0];&nbsp; 
            <BR>&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp; 
            <BR><BR>String&nbsp;runcardToQuery&nbsp;=&nbsp;new&nbsp;String&nbsp;(runcard.getBytes("8859_1"));//用于查询 
            <BR><BR>String[]&nbsp;stepnameResult&nbsp;=&nbsp;new&nbsp;String&nbsp;[xr.getStepname(runcardToQuery).length];&nbsp;&nbsp;//流程名 
            <BR>String[]&nbsp;stepname2ISO&nbsp;=&nbsp;new&nbsp;String&nbsp;[stepnameResult.length];&nbsp;&nbsp;//转为ISO8859_1字符集的流程名 
            <BR>stepnameResult&nbsp;=&nbsp;xr.getStepname(runcardToQuery); 
            <BR>String&nbsp;stepname&nbsp;=&nbsp;new&nbsp;String(request.getParameter("stepname"));//用于显示 
            <BR>if(stepname&nbsp;==null){&nbsp; 
            <BR>stepname=stepnameResult[0];&nbsp; 
            <BR>&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp; 
            <BR><BR><BR><BR>还是[color=red:4bcd9f061c]NullPointer[/color:4bcd9f061c]例外!<BR><BR></TD></TR>
        <TR>
          <TD>
            <HR>
            <SMALL>&nbsp;<A 
            href="http://www.chinaunix.net/forum/profile.php?mode=viewprofile&amp;u=46833" 
            target=_blank>full</A> 回复于:2003-07-03 21:34:28</SMALL></TD></TR>
        <TR>
          <TD>还是不行啊!不知道是不是我理解错误,代码如下: 
            <BR><BR>String[]&nbsp;runcardResult&nbsp;=&nbsp;new&nbsp;String&nbsp;[xr.getRuncard().length];&nbsp;&nbsp; 
            <BR>String[]&nbsp;runcard2ISO&nbsp;=&nbsp;new&nbsp;String&nbsp;[runcardResult.length];&nbsp;&nbsp;//转为ISO8859_1字符集的流程名 
            <BR>runcardResult&nbsp;=&nbsp;xr.getRuncard(); 
            <BR>String&nbsp;runcard&nbsp;=&nbsp;new&nbsp;String&nbsp;(request.getParameter("runcard"));//用于显示 
            <BR>if(runcard&nbsp;==null){&nbsp; 
            <BR>&nbsp;&nbsp;&nbsp;&nbsp;runcard=runcardResult[0];&nbsp; 
            <BR>&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp; 
            <BR><BR>String&nbsp;runcardToQuery&nbsp;=&nbsp;new&nbsp;String&nbsp;(runcard.getBytes("8859_1"));//用于查询 
            <BR><BR>String[]&nbsp;stepnameResult&nbsp;=&nbsp;new&nbsp;String&nbsp;[xr.getStepname(runcardToQuery).length];&nbsp;&nbsp;//流程名 
            <BR>String[]&nbsp;stepname2ISO&nbsp;=&nbsp;new&nbsp;String&nbsp;[stepnameResult.length];&nbsp;&nbsp;//转为ISO8859_1字符集的流程名 
            <BR>stepnameResult&nbsp;=&nbsp;xr.getStepname(runcardToQuery); 
            <BR>String&nbsp;stepname&nbsp;=&nbsp;new&nbsp;String(request.getParameter("stepname"));//用于显示 
            <BR>if(stepname&nbsp;==null){&nbsp; 
            <BR>stepname=stepnameResult[0];&nbsp; 
            <BR>&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp; 
            <BR><BR><BR><BR>还是[color=red:1a0b5e9e00]NullPointer[/color:1a0b5e9e00]例外!<BR><BR></TD></TR>
        <TR>
          <TD>
            <HR>
            <SMALL>&nbsp;<A 
            href="http://www.chinaunix.net/forum/profile.php?mode=viewprofile&amp;u=31634" 
            target=_blank>rollingpig</A> 回复于:2003-07-04 09:40:26</SMALL></TD></TR>
        <TR>
          <TD>String&nbsp;stepname&nbsp;=&nbsp;new&nbsp;String(request.getParameter("stepname"));// 
            <BR><BR>---&gt; 
            <BR><BR>String&nbsp;stepname&nbsp;=&nbsp;&nbsp;request.getParameter("stepname"));// 
            <BR><BR>new&nbsp;String(null)是会有Exception的<BR><BR></TD></TR>
        <TR>
          <TD>
            <HR>
            <SMALL>&nbsp;<A 
            href="http://www.chinaunix.net/forum/profile.php?mode=viewprofile&amp;u=46833" 
            target=_blank>full</A> 回复于:2003-07-04 18:53:28</SMALL></TD></TR>
        <TR>
          <TD>搞定了!!好高兴,多谢两位版主啦!!<BR><BR></TD></TR>
        <TR>
          <TD>
            <HR>
            <SMALL>&nbsp;<A 
            href="http://www.chinaunix.net/forum/profile.php?mode=viewprofile&amp;u=31634" 
            target=_blank>rollingpig</A> 回复于:2003-07-07 10:32:56</SMALL></TD></TR>
        <TR>
          <TD>不用谢,有空多来走走!!<BR><BR></TD></TR>
        <TR>
          <TD>
            <HR>
            <SMALL>&nbsp;<A 
            href="http://www.chinaunix.net/forum/profile.php?mode=viewprofile&amp;u=44763" 
            target=_blank>test_tmp</A> 回复于:2003-07-30 12:31:10</SMALL></TD></TR>
        <TR>
          <TD>可不可以请“rollingpig”谈一下: <BR>3。比较特殊的方法&nbsp; 
            <BR>在A选中之后,到服务器去下载一段动态script,在script里改动B的值 <BR>具体要怎么实现! 
            <BR>谢谢!<BR><BR></TD></TR>
        <TR>
          <TD>
            <HR>
            <SMALL>&nbsp;<A 
            href="http://www.chinaunix.net/forum/profile.php?mode=viewprofile&amp;u=70569" 
            target=_blank>pipen</A> 回复于:2003-07-30 15:01:41</SMALL></TD></TR>
        <TR>
          <TD>恩,也想学习学习,同楼上的问题<BR><BR></TD></TR>
        <TR>
          <TD>
            <HR>
            <SMALL>&nbsp;<A 
            href="http://www.chinaunix.net/forum/profile.php?mode=viewprofile&amp;u=31634" 
            target=_blank>rollingpig</A> 回复于:2003-07-30 16:43:48</SMALL></TD></TR>
        <TR>
          <TD>may&nbsp;like&nbsp;this <BR><BR>[code:1:c51ef70a01] <BR>data.jsp 
            <BR><BR>&lt;%@&nbsp;page&nbsp;contentType="text/html;&nbsp;charset=GB2312"&nbsp;%&gt; 
            <BR>&lt;?xml&nbsp;version="1.0"&nbsp;encoding="GB2312"&nbsp;standalone="yes"?&gt; 
            <BR>&lt;dummy&gt; <BR>&lt;% 
            <BR>String&nbsp;id=request.getParameter("id"); 
            <BR>java.sql.ResultSet&nbsp;rs=null; 
            <BR>rs=dbConn.exceute("select&nbsp;codes,name&nbsp;from&nbsp;aa&nbsp;where&nbsp;id&nbsp;=&nbsp;"&nbsp;+&nbsp;id); 
            <BR>while(rs.next()){ <BR>%&gt; <BR>&lt;dummy2&gt; <BR>&lt;codes&gt; 
            <BR>&lt;%=rs.getString(1)%&gt; <BR>&lt;/codes&gt; <BR>&lt;name&gt; 
            <BR>&lt;%=rs.getString(2)%&gt; <BR>&lt;/name&gt; <BR>&lt;/dummy2&gt; 
            <BR>&lt;%}%&gt; <BR>&lt;/dummy&gt; <BR><BR>[/code:1:c51ef70a01] 
            <BR><BR>[code:1:c51ef70a01] <BR>test.jsp 
            <BR><BR>&lt;form&nbsp;name=test&gt; 
            <BR>&lt;select&nbsp;name=a&nbsp;onchange="change()"&gt; 
            <BR>&lt;option&nbsp;value=1&gt;ONE&lt;/option&gt; 
            <BR>&lt;option&nbsp;value=2&gt;TWO&lt;/option&gt; 
            <BR>&lt;option&nbsp;value=3&gt;THREE&lt;/option&gt; 
            <BR>&lt;select&gt; <BR>&lt;select&nbsp;name=b&gt;&lt;/select&gt; 
            <BR>&lt;/form&gt; <BR>&lt;XML&nbsp;id=xmldso&gt;&lt;/XML&gt; 
            <BR>&lt;script&gt; <BR>function&nbsp;change(){ 
            <BR>xmldso.async&nbsp;=&nbsp;false; 
            <BR>xmldso.load("data.jsp?id="+document.test.a.value); 
            <BR>with(document.test.b){ <BR>xmldso.recordset.MoveFirst(); 
            <BR>for&nbsp;(var&nbsp;i=0;!xmldso.recordset.eof;i++){ 
            <BR>length=i+1; 
            <BR>options[i].value=xmldso.recordset.fields(0).value; 
            <BR>options[i].text=xmldso.recordset.fields(1).value; 
            <BR>xmldso.recordset.MoveNext(); <BR>} <BR>} <BR>} <BR>change(); 
            <BR>&lt;/script&gt; <BR><BR>[/code:1:c51ef70a01]<BR><BR></TD></TR>
        <TR>
          <TD>
            <HR>
            <SMALL>&nbsp;<A 
            href="http://www.chinaunix.net/forum/profile.php?mode=viewprofile&amp;u=44763" 
            target=_blank>test_tmp</A> 回复于:2003-08-01 21:06:14</SMALL></TD></TR>
        <TR>
          <TD>谢了rollingpig,正在看!<BR><BR></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE>
<TABLE cellSpacing=0 cellPadding=0 width="75%" border=0>
  <TBODY>
  <TR>
    <TD width="100%" bgColor=#49ade9 colSpan=5 height=2><IMG height=1 
      src="jsp页面内实现动态下拉框!!.files/bline.gif" 
width=1></TD></TR></TBODY></TABLE><BR><SMALL>Copyright &copy; ChinaUnix.net 
<BR>&nbsp;*&nbsp; 请尊重我们的劳动,转载请注明出自<A 
href="http://www.chinaunix.net/">ChinaUnix.net</A>及作者名 &nbsp;*&nbsp; 
</SMALL></CENTER></DIV></BODY></HTML>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -