有一个学生表,有学号、课程号、成绩3个字段、页面有两个select标签,一个用来取得学号、一个用来取得课程号、还有一个文本域显示对应的成绩
<table border="1" cellspacing="1" cellpadding="8" width="400">
<tr>
<td width="100">
请选择学生:
</td>
<td>
<select name="score.xh">
<s:iterator id="xs" value="#request.studentList">
<option value="<s:property value="#xs.xh"/>">
<s:property value="#xs.xm" />
</option>
</s:iterator>
</select>
</td>
</tr>
<tr>
<td width="100">
请选择课程:
</td>
<td>
<select name="score.kch">
<s:iterator id="kc" value="#request.courseList">
<option value="<s:property value="#kc.kch"/>">
<s:property value="#kc.kcm" />
</option>
</s:iterator>
</select>
</td>
</tr>
<tr>
<s:textfield label="成绩" name="score.cj"  readonly="true" value="" size="14"></s:textfield>
</tr>
</table>
下面是查询成绩代码public Score chaxunscore(Score score) {
ResultSet rs = null;
String xh=score.getXh();
String kch=score.getKch();
String sql = "select * from CJB where xh=" + xh +"and kch =" +kch;
Score score1 = new Score();
try {
psmt = this.getConn().prepareStatement(sql);
rs = psmt.executeQuery();
while (rs.next()) {
score1.setCj(Integer.parseInt(rs.getString("cj")));

}
} catch (Exception e) {
System.out.print("异常1");
} finally {
try {
psmt.close();
} catch (SQLException e) {
System.out.print("异常2");
}
try {
conn.close();
} catch (SQLException e) {
System.out.print("异常3");
}
}
return score1;
}其中运行提示这句有错误,是没传过来吗?
这是Action的
public String chaxunscore() throws Exception{
Score score1 = new Score();
ScoreJdbc scoreJ = new ScoreJdbc();
score1 = scoreJ.chaxunscore(score);
Map request = (Map) ActionContext.getContext().get("request");
request.put("score1", score1);
return SUCCESS;
}selectJava