目前我有两个action分别是priorityOptionAction,LocationOptionAction,然后我写了两个jsp页来用selelct形式显示出来,代码如下(目前都能工作), 问题是我怎么把这两个jsp合并成一个也能工作,请问怎么做?我是新手!:
第一个jsp的代码:
<body>
<table width="100%"> <tr>
<td align="right" width="90">
<font color="red">*</font>&nbsp;priority
</td> <td>
<html:form action="priorityOption.do">
<html:select property="priority">
<html:options collection="priorityOptionList"
labelProperty="displayname" property="id" />
</html:select>
<font color="red"><span id="typeError"></span> </font>
</html:form>
</td>
</tr>
</table>
</body>
第二个jsp是:
<body>
<table width="100%"> <tr>
<td align="right" width="90">
<font color="red">*</font>&nbsp;Location
</td> <td>
<html:form action="locationOption.do">
<html:select property="location">
<html:options collection="locationOptionList"
labelProperty="displayname" property="id" />
</html:select>
<font color="red"><span id="typeError"></span> </font>
</html:form>
</td>
</tr>
</table>
</body>

解决方案 »

  1.   

    没什么难度。方法很多的。
    将两个Action 合并,两个处理分别调用Action里面的不同方法
      

  2.   

    把jsp合到一起就可以,action可以不动。
    一个jsp可以存在多个form(表单)
      

  3.   

    谢谢!能否举个例子吗?我是新手,实在不知道怎么做。我是不是在action中定义两个方法,例如listPriority与listLocation,那么在jsp中该怎么做呢?谢谢!
      

  4.   

    你这不是jsp中怎么做
    是xml中怎么做的问题