Bonjour,
Dans mon application Struts2 j'ai un écran qui me permet d'importer des données via un fichier Excel. Dans cette fonctionnalité d'import il y a un certains nombre de contrôle de surface qui sont réalisés afin de valider le contenue. Si tout est ok on passe à l'écran suivant avec les données initialisé à partir du fichier. Si une erreur intervient on reste sur l'écran et on affiche les messages d'erreurs. Lorsque j'essai de rester sur l'ecran j'ai une erreur qui me dit qu'il n'y a pas de resultat de navigation définit ce qui est faut.
message d'erreur :
error.technical.message No result defined for action com.omb.controller.collect.CollectAction$$EnhancerByCGLIB$$e1df9320 and result displayImport at com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:369) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:271) at com.accor.hrdata.controller.interceptor.UserAwareInterceptor.intercept(UserAwareInterceptor.java:42) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:242) at com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:176) at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:242) at com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept
struts.xml :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107
| <?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
<constant name="struts.devMode" value="false" />
<constant name="struts.action.extension" value="do" />
<constant name="struts.custom.i18n.resources"
value="com.omb.i18n.StrutsResourceBundle" />
<constant name="struts.objectFactory" value="spring" />
<constant name="struts.objectFactory.spring.autoWire" value="name" />
<constant name="struts.i18n.encoding" value="ISO-8859-1" />
<constant name="struts.i18n.reload" value="false" />
<constant name="struts.configuration.xml.reload" value="false" />
<constant name="struts.locale" value="fr" />
<constant name="struts.multipart.maxSize" value="100000000000" />
<constant name="struts.enable.SlashesInActionNames" value="true" />
<constant name="struts.mapper.alwaysSelectFullNamespace" value="false"/>
<constant name="struts.codebehind.classSuffix" value="Controller"/>
<constant name="struts.codebehind.action.checkImplementsAction" value="false"/>
<constant name="struts.codebehind.action.checkAnnotation" value="false"/>
<constant name="struts.codebehind.action.defaultMethodName" value="index"/>
<constant name="struts.configuration.classpath.defaultParentPackage" value="rest-default" />
<package name="default" extends="tiles-default" namespace="/">
<interceptors>
<interceptor name="userAware"
class="com.omb.controller.interceptor.UserAwareInterceptor" />
<interceptor name="params-filter"
class="com.opensymphony.xwork2.interceptor.ParameterFilterInterceptor" />
<interceptor-stack name="defaultStack">
<interceptor-ref name="exception" />
<interceptor-ref name="alias" />
<interceptor-ref name="servletConfig" />
<interceptor-ref name="i18n" />
<interceptor-ref name="chain" />
<interceptor-ref name="modelDriven" />
<interceptor-ref name="fileUpload">
<param name="maximumSize">11204928</param>
</interceptor-ref>
<interceptor-ref name="staticParams" />
<interceptor-ref name="conversionError" />
<interceptor-ref name="params" />
<interceptor-ref name="prepare" />
<interceptor-ref name="validation" />
<interceptor-ref name="workflow" />
<interceptor-ref name="userAware" />
</interceptor-stack>
</interceptors>
<default-interceptor-ref name="defaultStack" />
<global-results>
<result name="technicalError" type="chain">
errorAction
</result>
<result name="sessionInvalidError" type="tiles">
sessionInvalid
</result>
<result name="blank" type="tiles">blank</result>
</global-results>
<global-exception-mappings>
<exception-mapping exception="java.lang.Exception"
result="technicalError" />
<exception-mapping
exception="com.omb.service.exception.UserSessionInvalidException"
result="sessionInvalidError" />
</global-exception-mappings>
<action name="errorAction"
class="com.omb.controller.ErrorAction">
<result name="success" type="tiles">errorTile</result>
</action>
<action name="*Cache"
class="com.omb.controller.CacheAction" method="{1}">
<result name="success" type="tiles">resultCache</result>
<result name="input" type="tiles">inputCache</result>
</action>
<action name="*Login"
class="com.omb.controller.LoginAction" method="{1}">
<result name="success" type="tiles">login</result>
<result name="password" type="tiles">changePassword</result>
</action>
</package>
<package name="collect" extends="default" namespace="/collect">
<action name="*Action"
class="com.omb.controller.collect.CollectAction"
method="{1}">
<result name="displayImport" type="tiles">importTile</result>
<result name="displaySaisie" type="tiles">saisieTile</result>
</action>
</package>
</struts> |
CollectAction.java
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71
| package com.omb.controller.collect;
import java.io.File;
import java.io.IOException;
import com.omb.exception.ExcelProcessingException;
import com.opensymphony.xwork2.ActionSupport;
import com.omb.services.IImportService;
public class CollectAction extends ActionSupport {
private File uploadFile;
private String uploadFileFileName;
private String uploadFileContentType;
private IImportService importService;
public String doImport() {
try {
importService.importExcel(uploadFile);
} catch (ExcelProcessingException epe) {
addActionError(getText("error.proces.key"));
return "displayImport";
} catch (IOException ex) {
addActionError(getText("error.io.key"));
return "displayImport";
}
return "displaySaisie";
}
public IImportService getImportService() {
return this.importService;
}
public void setImportService(IImportService importService) {
this.importService = importService;
}
public File getUploadFile() {
return uploadFile;
}
public void setUploadFile(File uploadFile) {
this.uploadFile = uploadFile;
}
public String getUploadFileFileName() {
return this.uploadFileFileName;
}
public void setUploadFileFileName(String uploadFileFileName) {
this.uploadFileFileName = uploadFileFileName;
}
public String getUploadFileContentType() {
return this.uploadFileContentType;
}
public void setUploadFileContentType(String uploadFileContentType) {
this.uploadFileContentType = uploadFileContentType;
}
} |
Partager