像这个样子,其中error.export.service.sub在资源文件中配置。另外要在struts-config.xml中的action中要配置input的路径,这样就可以了。
ActionErrors errors = new ActionErrors();        
try{
                    }catch(Exception e){
            
            errors.add(ActionErrors.GLOBAL_ERROR, new ActionError("error.export.service.sub"));
        }        if (!errors.isEmpty()) {
            saveErrors(request, errors);
            return (mapping.getInputForward());
        }