假设我有一个验证表单的操作。如果此方法返回成功,则会将其重定向到包含其所有参数的新操作。我的一个参数是类型:
的java.io.File
这会导致重定向的操作返回INPUT而不是SUCCESS。
这是我的代码:
public String validateMemberForm() {
int fails = 0;
if (service.findMemberByCompany(company) != null) {
addFieldError("company", "This company is already registered!");
fails++;
}
if (service.findMemberByEmail(email) != null) {
addFieldError("email", "This email is already registered!");
fails++;
}
if (fails != 0) {
return INPUT;
}
return SUCCESS;
}
我在struts.xml中的重定向:
<action name="validate_member" class="managementAction" method="validateMemberForm">
<result name="success" type="redirectAction">
<param name="actionName">create_member</param>
<param name="company">${company}</param>
<param name="upload">${upload}</param> <!-- THIS PARAM IS OF TYPE FILE -->
<param name="uploadContentType">${uploadContentType}</param>
<param name="uploadFileName">${uploadFileName}</param>
<param name="email">${email}</param>
</result>
<result name="input">/pages/authenticated/memberSave.jsp</result>
</action>
我的&#39; create_member&#39;动作返回INPUT。