我正在使用struts和hibernate,当我在struts.xml文件中添加多个动作时,它只读取一个动作而不是其他动作,也没有错误。 这是我的struts配置文件....表单jsp页面的动作名称是一样的,如果你知道的话,请帮助我任何人......
<struts>
<package name="addController" extends="struts-default">
<action name="see" method="user" class="addController.Addaction">
<result name="input">/read.jsp</result>
<result name="success">/successview.jsp</result>
</action>
<action name="adduser" method="addEmployee" class="addController.Addaction">
<interceptor-ref name="fileUpload">
<param name="maximumSize">97097152</param>
<param name="allowedTypes">
image/png,image/gif,image/jpeg,image/jpg</param>
</interceptor-ref>
<interceptor-ref name="defaultStack"></interceptor-ref>
<result name="input">/addemp.jsp</result>
<result name="success">/success.jsp</result>
</action>
</package>
</struts>
动作类
private HttpServletRequest request;
private long mobile;
private int id;
private String imageContentType, imageFileName, documentContentType, documentFileName;
private String name;
private String comname, department, designation, email, address, city, empid, maritalstatus;
private Date dob,anniversary;
private File image,document;
//getters && setters
public String addEmployee() throws Exception {
System.out.println("addEmployee");
return "success";
}
public String user() {
System.out.println("user");
return "success";
}