日期:2014-05-19  浏览次数:20659 次

这是神马情况?求SSh大神···(空指针
<form class="form-horizontal" method="get" action="updataStudent">
<s:set name="id" value="parameters.id[0]"></s:set>
<!-- <s:set name="person" value="id"/> -->
<fieldset>
<legend>个人信息</legend>
<div class="control-group"> 
<label class="control-label" for="account">用户名:</label>
<div class="controls">
<s:textfield readonly="true" name="person.account"></s:textfield>
</div>
</div>
<div class="control-group">
<label class="control-label" for="name">真实姓名:</label>
<div class="controls">
<s:textfield readonly="true" name="person.name"></s:textfield>
</div>
</div> 

<div class="control-group">
<label class="control-label" for="email">电子邮箱:</label><div class="controls">
<input type="text" class="span2" id="email" name="person.email" value="<s:property value="person.email"/>">
</div>
</div>
<div class="control-group">
<label class="control-label" for="tel">联系电话:</label>
<div class="controls">
<input type="text" class="span2" id="tel" name="person.telephone" value="<s:property value="person.telephone"/>">
</div>
</div>
<div class="form-actions">
<button type="submit" class="btn btn-primary">修改信息</button>
<a href="#" class="btn">返回</a> 
</div>
</fieldset>
</form>
点保存的时候:地址栏如下
http://localhost:8080/scnupm/student/updataStudent?person.password=&person.id=&person.type=&person.account=fuhuasishui&person.name=%E5%BC%A0%E6%98%8E%E5%8D%8E&person.email=15521267125%40163.com&person.telephone=13560134432
×××××××××××××××××××××××××××××××××××××××××××××××××××××××
  Structs配置如下:
<action name="showStudent"
class="cn.edu.scnu.cs.scnupm.action.person.ShowStudentAction">
<result name="success">/student/personalmanage.jsp</result>
</action>
<action name="updataStudent"
class="cn.edu.scnu.cs.scnupm.action.person.UpdataStudentAction">
<interceptor-ref name="studentStack" />
<result name="success">/student/personalmanage.jsp</result>
</action>
×××××××××××××××××××××××××××××××××××××××××××××××××××××××Action的函数如下:
public String execute() throws Exception {
  try{
  System.out.println(person.getId()+":test0");
studentService.updataStudent(person);