IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Spring Web Java Discussion :

[Spring Web Flow 2.0] The requestPathInfo is null


Sujet :

Spring Web Java

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Membre averti
    Profil pro
    Inscrit en
    Mai 2002
    Messages
    42
    Détails du profil
    Informations personnelles :
    Localisation : Belgique

    Informations forums :
    Inscription : Mai 2002
    Messages : 42
    Par défaut [Spring Web Flow 2.0] The requestPathInfo is null
    bonjour

    Celà fait quelques jours que j'essaie de faire tourner cette petite appli pour tester SWF

    J'utilise Eclipse 3.3 Europa, Tomcat 5.5 , JSTL 1.2, Spring 2.0 et Web Flow 2.0

    J'ai cette exception:

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    java.lang.IllegalArgumentException: The requestPathInfo is null: unable to extract flow definition id or flow execution key
    toute mon application:
    web.xml:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    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
    <?xml version="1.0" encoding="UTF-8"?>
    <web-app id="WebApp_ID" version="2.4"
    	xmlns="http://java.sun.com/xml/ns/j2ee"
    	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    	xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
    	<display-name>Z9: Test</display-name>
     
    	<servlet>
        <servlet-name>z9</servlet-name>
        <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
           <init-param>
               <param-name>contextConfigLocation</param-name>
               <param-value>
                     /WEB-INF/z9-servlet.xml
                     /WEB-INF/z9-webflow.xml
                </param-value>
           </init-param>
        </servlet>
     
    	<servlet-mapping>
    		<servlet-name>z9</servlet-name>
    		<url-pattern>*.htm</url-pattern>
    	</servlet-mapping>
     
    	<listener>
     
    	<welcome-file-list>
    		<welcome-file>index.jsp</welcome-file>
    	</welcome-file-list>
     
    </web-app>
    z9-servlet:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://www.springframework.org/schema/beans"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xmlns:web="http://www.springframework.org/schema/webflow-config"
           xsi:schemaLocation="http://www.springframework.org/schema/beans
               http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
     
     	<bean
    		class="org.springframework.web.servlet.view.InternalResourceViewResolver">
    		<property name="viewClass">
    			<value>org.springframework.web.servlet.view.JstlView</value>
    		</property>
    		<property name="prefix">
    			<value>view/</value>
    		</property>
    		<property name="suffix">
    			<value>.jsp</value>
    		</property>
    	</bean>
     
    </beans>
    z9-webflow:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://www.springframework.org/schema/beans"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xmlns:web="http://www.springframework.org/schema/webflow-config"
           xsi:schemaLocation="
               http://www.springframework.org/schema/beans
               http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
               http://www.springframework.org/schema/webflow-config
               http://www.springframework.org/schema/webflow-config/spring-webflow-config-2.0.xsd">
     
     
    	<bean name="/main.htm" id="flowController" class="org.springframework.webflow.mvc.FlowController">
    		<property name="flowExecutor" ref="flowExecutor" />
    	</bean>
     
    	<web:flow-executor id="flowExecutor" flow-registry="flowRegistry"/>	
     
       	<web:flow-registry id="flowRegistry" >
    		<web:flow-location path="/WEB-INF/flows/main-flow.xml" />
    	</web:flow-registry>
     
    </beans>
    main-flow.xml:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    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
    <?xml version="1.0" encoding="UTF-8"?>
    <flow xmlns="http://www.springframework.org/schema/webflow"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://www.springframework.org/schema/webflow
                              http://www.springframework.org/schema/webflow/spring-webflow-2.0.xsd">
     
     
    	<var name="operation" class="model.OperationsCommand" scope="flow" />
     
    	<start-state idref="displayMain"/>
     
    	<view-state id="displayMain" view="main">
    	   <render-actions>
    	     <action bean="formAction" method="setupForm"/>
    	  </render-actions>              
          <transition on="submit" to="finish">
             <action bean="formAction" method="bindAndValidate">
                <attribute name="validatorMethod" value="validate"/>
            </action> 
          </transition>
        </view-state>
     
        <end-state id="finish" view="success">
        </end-state>
     
        <import resource="main-beans.xml"/>
     
    </flow>
    main-beans.xml:

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://www.springframework.org/schema/beans"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xmlns:web="http://www.springframework.org/schema/webflow-config"
           xsi:schemaLocation="
               http://www.springframework.org/schema/beans
               http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
     
       <bean id="formAction" class="org.springframework.webflow.action.FormAction">
           <property name="formObjectName" value="operation"/>
            <property name="validator">
                <bean class="model.OperationsCommandValidator"/>
           </property> 
        </bean>
     
    </beans>
    main.jsp:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    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
    <%@ include file="/view/include.jsp"%>
    <%@ page language="java" contentType="text/html; charset=utf-8"%>
     
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
     
    <html> 
    <head>
    </head>
    <body>
     
    <form:form commandName="operation">
    <div>
     
               <div id="TypeOperationChoose" class="ColumsCommon" > 
    			     <div>Afficher:&nbsp;<form:radiobutton path="choiceOperations" value="afficher"/></div>
    			     <div>  Ajouter: &nbsp;<form:radiobutton path="choiceOperations" value="ajouter"/></div>
    			     <div>  Modifier: <form:radiobutton path="choiceOperations" value="modifier"/></div>
    			     <div>   Effacer:&nbsp;&nbsp;&nbsp;<form:radiobutton path="choiceOperations" value="effacer"/></div>
    			     <div>   <form:errors path="choiceOperations" cssClass="error" /></div>
               </div>
     
     
                <div class="Submit" class="ColumsCommon" align="center" >
                 <input class="SubmitButton" type="submit" name="_eventId_submit"  value="Submit" />
                </div>
     
    </div>
    </form:form>
     
     
    </body>
    </html>

    if I understood correctly, with WebFlow 2.0, no more need to have the hidden input for the flowExecutionKey
    but anyway, I tried also with this:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
      <input type="hidden" name="_flowExecutionKey" value="<c:out value='${flowExecutionKey}'>"/>
    and it dont work too

    OperationsCommand:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    package model;
     
    public class OperationsCommand {
     
    	private String choiceOperations;
     
     
    	public String getChoiceOperations() {
    		return choiceOperations;
    	}
     
    	public void setChoiceOperations(String choiceOperations) {
    		this.choiceOperations = choiceOperations;
    	}
     
     
    }
    OperationsCommandValidator:

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    package model;
     
    import org.springframework.validation.Errors;
    import org.springframework.validation.ValidationUtils;
    import org.springframework.validation.Validator;
     
     
    public class OperationsCommandValidator implements Validator {
     
    	 public void validate(Object obj, Errors errors) {
     
    		 ValidationUtils.rejectIfEmpty(errors, "choiceOperations", "required","required.");
     
    	 }
     
    	public boolean supports(Class clazz) {
     
    		 return clazz.equals(OperationsCommand.class);
    	}
     
     
     
    }

    merci d'avance

  2. #2
    Membre averti
    Profil pro
    Inscrit en
    Avril 2008
    Messages
    24
    Détails du profil
    Informations personnelles :
    Localisation : Belgique

    Informations forums :
    Inscription : Avril 2008
    Messages : 24
    Par défaut
    Le nom de ton fichier xml de définition doit être le même que le nom de ton workflow.

    Moi, j'ai un autre problème. J'ai cette erreur :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    org.springframework.web.util.NestedServletException: Handler processing failed; nested exception is java.lang.NoSuchMethodError: org.springframework.util.xml.DomUtils.getChildElementsByTagName(Lorg/w3c/dom/Element;[Ljava/lang/String;)Ljava/util/List;
    	org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:919)
    	org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:808)
    	org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:476)
    	org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:431)
    	javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
    	javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    	org.acegisecurity.util.FilterChainProxy.doFilter(FilterChainProxy.java:131)
    	org.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java:98)
    Alors que dans mon fichier de def de workflow xml j'ai ceci :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    <?xml version="1.0" encoding="UTF-8"?>
    <flow xmlns="http://www.springframework.org/schema/webflow"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://www.springframework.org/schema/webflow
        http://www.springframework.org/schema/webflow/spring-webflow-2.0.xsd">
     
        <view-state id="createGeneralInformation" view="notification/createGeneralInformation">
            <transition on="createSampling" to="createSampling"/>
            <transition on="cancelCreationNotification" to="cancelCreationNotification"/>
        </view-state>
     
        <end-state id="createSampling" view="/welcome.htm" />
        <end-state id="cancelCreationNotification" view="/welcome.htm" />
    </flow>
    Et que je met le <start-state>, j'ai une autre erreur.

    Bref 4 heures je me casse la tête dessus.

    Si tu pouvais m'aider, ce serait gentil.
    Merci

Discussions similaires

  1. SWF (Spring Web Flow) + InternalResourceViewResolver
    Par superviny dans le forum Spring
    Réponses: 0
    Dernier message: 16/01/2012, 15h04
  2. [WebFlow] Pour débuter avec Spring Web Flow
    Par adrian07 dans le forum Spring Web
    Réponses: 1
    Dernier message: 23/05/2011, 14h09
  3. [Web Services] Spring Web Services
    Par Ho(c)ine. dans le forum Spring
    Réponses: 7
    Dernier message: 03/11/2010, 10h53
  4. Spring Web Flow, Tiles ou Struts Layout ?
    Par Shuret dans le forum Spring Web
    Réponses: 2
    Dernier message: 17/02/2009, 17h47

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo