2

In struts-config.xml:

<action path="/PackageUpdateFilesSubmit"
    type="com.biscom.fds.action.PackageAction" scope="request"
    name="packageForm" validate="true" 
    input="/packages/packageUpdateFiles.jsp" parameter="method"
    roles="SENDER">

    <forward name="success" path="/PackageView.do?method=view" />
    <forward name="warning" path=".fdsApp.message" />
    <forward name="failure" path=".fdsApp.message" />
</action>

In PackageForm.java (Which extends ActionForm class)

@Override
    public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) {
        // TODO Auto-generated method stub

        ActionErrors errors = super.validate(mapping, request); 
        // Only need crossfield validations here 
        if (filename3 == null) { 
            errors.add(ActionMessages.GLOBAL_MESSAGE, new  
                  ActionMessage("page.externalAuthSource.list.error.empty"));//add("error",        
                  new ActionError("error.custform")); 
        } 
        return errors;
    } 

What do I expect:

When error occurs redirection to "/packages/pUF.jsp" page.

What is happening:

HTTP Error 500 is occurring.

Note: In my controller setting value for property "inputForward" is true.

FARSiM
  • 71
  • 1
  • 7
  • can you show us what you have in your `com.biscom.fds.action.PackageAction` class? – DDK Nov 27 '12 at 12:03
  • I don't think ...PackageAction class has any role here, As when an error occurred it never go to the Action class. And I debugged: Error is occurring and ActionErrors is not empty. – FARSiM Nov 27 '12 at 16:29
  • If the errors object is not empty then the errors will be displayed in the same page inside `` tag if you have specified one in your jsp. – DDK Nov 28 '12 at 10:54
  • DDK thank you for your reply, but yet it's not helping. – FARSiM Dec 02 '12 at 07:20

1 Answers1

0

You are right, up to form validation control never goes to Action class. So this issue is no way related to Action class. What I can suggest is just check your resource bundle file/properties file to make sure that you put the related error message value there, and you are extending your ActionForm class to ValidatorActionForm/DynaValidatorActionForm class or not.

Shailesh Saxena
  • 3,472
  • 2
  • 18
  • 28