页面报错
No result defined for action com.HMIS.Action.RegistrationWorkStation.RegistrationWorkStationAction and result input开始以为是在Action的返回值没有定义路径。。后来检查发现连我指定的函数都没有调用~~但是一直没有发现哪里写的有问题。求解答~~~java函数:
public String excuteAddPatient() throws Exception //增加患者
{
String identity = this.registrationWorkStationService.checkPatientByIdentity(this.identity); //检查患者身份证是否已经注册过
if(identity == null)
{
Patient patientInfo = new Patient();
patientInfo.setName(this.name);
patientInfo.setSex(this.sex);
patientInfo.setBirth(this.birth);
patientInfo.setAddress(this.address);
patientInfo.setPhone(this.phone);
patientInfo.setIdentity(this.identity);
patientInfo.setInsurance("sdfsafsa");
patientInfo.setFurConsultation(this.furConsultation); if(this.registrationWorkStationService.addPatient(patientInfo) == null)
{
return "false";
}
else
{
return "successAddPatient";
}
}
return "false";
}
struts配置内容:
<package name="RegMng" namespace="/RegMng" extends="struts-default">
<action name="addPatient" class="com.HMIS.Action.RegistrationWorkStation.RegistrationWorkStationAction">
<result name="successAddPatient">/RegistrationStation/AddReg.jsp</result>
<result name="success_checkBespoken">/RegistrationStation/PreRegList.jsp</result>
<result name="success_deleteBespoken">/RegistrationStation/PreRegList.jsp</result>
<result name="success_AddRegistlist">/RegistrationStation/AddReg.jsp</result>
<result name="success_getin">/RegistrationStation/AddReg.jsp</result>
</action>
</package>
JSP内容:
<s:form action="RegMng/addPatient!excuteAddPatient.action" theme="simple"> 
    姓名:<s:textfield name="name"></s:textfield><br/><br/>
    性别:<select name="sex">
     <option value="男">男</option>
<option value="女">女</option>
    </select>
    <br/><br/>
身份证号:<s:textfield name="identity"/><br/><br/>
出生年月:<s:textfield name="birth" ></s:textfield><br/><br/>
住址:<s:textfield name="address"></s:textfield><br/><br/>
联系方式:<s:textfield name="phone"></s:textfield><br/><br/>
<s:submit type="button" value="注册" ></s:submit>
</s:form>
首先说明,action名字没有映射错误。。其他的几个result能够正常执行。。就这个不行。。
excuteAddPatient函数都没有调用。。求解答~~急!

解决方案 »

  1.   

    找不到视图啊!
    加上这句<result name="false">/XXX.jsp</result>
      

  2.   

    对没有配置相应的视图
     <result name="successAddPatient">/RegistrationStation/AddReg.jsp</result>
                <result name="success_checkBespoken">/RegistrationStation/PreRegList.jsp</result>
                <result name="success_deleteBespoken">/RegistrationStation/PreRegList.jsp</result>
                <result name="success_AddRegistlist">/RegistrationStation/AddReg.jsp</result>
                <result name="success_getin">/RegistrationStation/AddReg.jsp</result><result name="false">/XXX.jsp</result>
      

  3.   

    找到真正的问题所在了
    页面给Action传值的时候数据类型传递有问题