我在用struts2和jquery结合使用的时候出的错?哪位大虾帮小弟看看! (详细信息在附件中)

suisediao 2009-04-11 03:08:04

我要的效果:
随着 下拉框选择的变动,这内容列表也随着变动

这是页面的源码:

<s:form action="" method="post" theme="simple">
<table align="center" border="1" width="378" >
<tr>
<td align="center">
<s:select list="organList" listKey="organId" listValue="organName" name="roleSelect" id="roleSelect" cssStyle="width:170px" onchange="changeSelect()"></s:select>
</td>
<td colspan="2" align="center">
<s:radio list="{'部门','角色'}" name="grRadio" id="Radio" value="'部门'"></s:radio>
</td>
</tr>
<tr>
<td rowspan="3" align="center">
<s:select list="userList" listKey="userId" listValue="userName" name="userSelect" id="userSelect" size="10" cssStyle="width:170px"></s:select>
</td>
<td align="center" align="center">
<input type="button" name="goButton" id="goButton" value=">>"></input>
</td>
<td rowspan="3" align="center">
<s:select list="{'1','2','2'}" name="targeSelect" id="targeSelect" size="10" cssStyle="width:170px"></s:select>
</td>
</tr>
<tr>
<td align="center">
<!--<s:submit type="button" name="backButton" id="backButton" value="<<"></s:submit> -->
<input type="button" name="backButton" id="backButton" value="<<"></input>
</td>
</tr>
<tr>
<td></td>
</tr>
<tr>
<td colspan="3">
<s:textarea name="infoTestarea" id="infoTestarea" cssStyle="width:100%;height:110px"></s:textarea>
</td>
</tr>
<tr>
<td colspan="2">
<s:submit name="send" id="send" value="发送"></s:submit>
</td>
<td align="right">
<s:label>信息发送条数</s:label>
</td>
</tr>
<tr>
<td colspan="2" align="right" style="width:60%">
<s:label value="模板:"></s:label>
</td>
<td align="left" style="width:40%">
<s:select list="{}" name="modeSelect" id="modeSelect" cssStyle="width:100%"></s:select>
</td>
</tr>
</table>
</s:form>



"changeSelect()"是我写的一个script

function changeSelect(){
var url = 'changeSelect!userListOfOrgan.action';
var params = {
roleSelect:$('#roleSelect').attr('value')
};
alert(params);
jQuery.post(url,params,callback);
}

function callback(data) {
alert(data.userList);我想看看所要数据是否取得
}

changeSelect!userListOfOrgan.action'
对应的action类为

public String userListOfOrgan() throws Exception {
System.out.println(roleSelect + "``````````````````````````````````````````````````");
userList = userService.getUserListByOragn(roleSelect);
//userList是可以成功取得的
System.out.println("1111111111111111111111111111111111");
return Action.SUCCESS;
}

我想要将查出来的值userList,插入内容列表中。
这是我struts.xml
<package name="ajax" extends="json-default">
<action name="changeSelect" class="SendMessageAction">
<result type="json"></result>
</action>
</package>中的配置

现在报错
2009-4-11 12:53:42 org.apache.catalina.core.StandardWrapperValve invoke
严重: Servlet.service() for servlet default threw exception
java.lang.AbstractMethodError: org.apache.commons.dbcp.PoolingDataSource$PoolGuardConnectionWrapper.getClientInfo()Ljava/util/Properties;
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.springframework.jdbc.datasource.TransactionAwareDataSourceProxy$TransactionAwareInvocationHandler.invoke(TransactionAwareDataSourceProxy.java:225)
at $Proxy4.getClientInfo(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
.......
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:619)

十万火急!
...全文
383 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
街头小贩 2009-04-13
  • 打赏
  • 举报
回复
看看jsp生成的servlet有没有错误

52,782

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 Ajax
社区管理员
  • Ajax
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧