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

Struts 1 Java Discussion :

No action instance for path /action could be created


Sujet :

Struts 1 Java

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Membre confirmé
    Profil pro
    Inscrit en
    Juin 2003
    Messages
    172
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Juin 2003
    Messages : 172
    Par défaut No action instance for path /action could be created
    Bonjour tout le monde,

    Lorsque je compile ma jsp, j'ai cette erreur qui s'affiche:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    No action instance for path /action could be created
    Je ne comprend pas bien pourquoi car j'ai bien configuré mon fichier struts-config, le voici:
    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"?>
    <!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.1//EN"
                                   "http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd">
    <struts-config>
     <data-sources/>
     
     <form-beans type="org.apache.struts.action.ActionFormBean">
     <form-bean name="formulaire" type="bean.Form"/>
     </form-beans>
     
     <global-exceptions/>
     <global-forwards/>
     
     <action-mappings type="org.apache.struts.action.ActionMapping">
        <action path="/action" input="/index.jsp" scope="request" name="formulaire" type="bean.Formaction"/>
      </action-mappings>
     
     <controller/>
     
     <message-resources null="false" parameter="controle_fr"/>
    </struts-config>
    Je vous remercie de votre aide

  2. #2
    Expert confirmé
    Avatar de djo.mos
    Profil pro
    Inscrit en
    Octobre 2004
    Messages
    4 666
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Octobre 2004
    Messages : 4 666
    Par défaut
    Dans ta page JSP, t'as probablement essayé d'appeler l'action avec le chemin "/action".
    Essaies avec "action" (enlèves le / au début)

  3. #3
    Membre confirmé
    Profil pro
    Inscrit en
    Juin 2003
    Messages
    172
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Juin 2003
    Messages : 172
    Par défaut
    Je te remercie de ton aide mais ca n'à pas l'air de fonctionner.

    Je te donne ma jsp la voici:
    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
    <%@ taglib uri="/WEB-INF/struts-html" prefix="html" %>
    <%@ taglib uri="/WEB-INF/struts-bean" prefix="bean" %>
    <%@ taglib uri="/WEB-INF/struts-logic" prefix="logic" %>
    <%@ taglib uri="/WEB-INF/c" prefix="c" %>
    <html:html>
     
    <head>
    	<title></title>
    </head>
    <body>
     <html:form action="action">
      <table>
      	<tr>
      		<td><bean:message key="index.nom"/></td>
      		<td><html:text property="nom"/></td>
      	</tr>
      	<tr>
      		<td><bean:message key="index.prenom"/></td>
      		<td><html:text property="prenom"/></td>
      </tr>
      <tr>
      		<td><bean:message key="index.age"/></td>
      		<td><html:text property="age"/></td>
      </tr>
      <tr>
      		<td><html:submit property="envoyer" value="envoyer"/></td>
      		<td><html:reset property="annuler" value="annuler"/></td>
      </tr>
      </table>
     </html:form>
    </body>
    </html:html>
    Voici mon fichier struts-confi car je l'ai modifier aussi:
    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"?>
    <!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.1//EN"
                                   "http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd">
    <struts-config>
     <data-sources/>
     
     <form-beans type="org.apache.struts.action.ActionFormBean">
     <form-bean name="formulaire" type="bean.Form"/>
     </form-beans>
     
     <global-exceptions/>
     <global-forwards/>
     
     <action-mappings type="org.apache.struts.action.ActionMapping">
        <action path="action" input="/index.jsp" scope="request" name="formulaire" type="bean.Formaction"/>
      </action-mappings>
     
     <controller/>
     
     <message-resources null="false" parameter="controle_fr"/>
    </struts-config>
    Je vous remercie de votre aide

  4. #4
    Expert confirmé
    Avatar de djo.mos
    Profil pro
    Inscrit en
    Octobre 2004
    Messages
    4 666
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Octobre 2004
    Messages : 4 666
    Par défaut
    Dans struts-config.xml, corriges le path de l'action
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
     
        <action path="/action" input="/index.jsp" scope="request" name="formulaire" type="bean.Formaction"/>
    j'ai ajouté un / .

  5. #5
    Membre confirmé
    Profil pro
    Inscrit en
    Juin 2003
    Messages
    172
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Juin 2003
    Messages : 172
    Par défaut
    Je te remercie de ton aide.

    Je viens de tester mais ca fonctionne pas peut-être que j'ai fait une erreur,

    Voici ma 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
    <%@ taglib uri="/WEB-INF/struts-html" prefix="html" %>
    <%@ taglib uri="/WEB-INF/struts-bean" prefix="bean" %>
    <%@ taglib uri="/WEB-INF/struts-logic" prefix="logic" %>
    <%@ taglib uri="/WEB-INF/c" prefix="c" %>
    <html:html>
     
    <head>
    	<title></title>
    </head>
    <body>
     <html:form action="action">
      <table>
      	<tr>
      		<td><bean:message key="index.nom"/></td>
      		<td><html:text property="nom"/></td>
      	</tr>
      	<tr>
      		<td><bean:message key="index.prenom"/></td>
      		<td><html:text property="prenom"/></td>
      </tr>
      <tr>
      		<td><bean:message key="index.age"/></td>
      		<td><html:text property="age"/></td>
      </tr>
      <tr>
      		<td><html:submit property="envoyer" value="envoyer"/></td>
      		<td><html:reset property="annuler" value="annuler"/></td>
      </tr>
      </table>
     </html:form>
    </body>
    </html:html>
    Voici mon fichier struts-config:
    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"?>
    <!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.1//EN"
                                   "http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd">
    <struts-config>
     <data-sources/>
     
     <form-beans type="org.apache.struts.action.ActionFormBean">
     <form-bean name="formulaire" type="bean.Form"/>
     </form-beans>
     
     <global-exceptions/>
     <global-forwards/>
     
     <action-mappings type="org.apache.struts.action.ActionMapping">
        <action path="/.action" input="/index.jsp" scope="request" name="formulaire" type="bean.Formaction"/>
      </action-mappings>
     
     <controller/>
     
     <message-resources null="false" parameter="controle_fr"/>
    </struts-config>
    Je vous remercie de votre aide

  6. #6
    Expert confirmé
    Avatar de djo.mos
    Profil pro
    Inscrit en
    Octobre 2004
    Messages
    4 666
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Octobre 2004
    Messages : 4 666
    Par défaut
    Ah mince alors ! T'as considéré le . terminal comme fiasant partie du path !
    Mais t'aurais du suivre plutôt le code que je t'ai fourni !

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
     
    <action path="/action" input="/index.jsp" scope="request" name="formulaire" type="bean.Formaction"/>
    /action et non pas /.action !

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. Could not access VBScript runtime for custom action
    Par splinternabs dans le forum EDI/Outils
    Réponses: 0
    Dernier message: 26/04/2014, 21h07
  2. Réponses: 6
    Dernier message: 11/01/2011, 18h29
  3. No action instance for path could be created
    Par yayamo dans le forum Struts 1
    Réponses: 15
    Dernier message: 11/05/2007, 12h17
  4. Problème avec boucle for() et action POST
    Par Oli_Ifre dans le forum Langage
    Réponses: 4
    Dernier message: 26/04/2007, 09h52
  5. Execution action .do - Invalid path
    Par devAd dans le forum Struts 1
    Réponses: 3
    Dernier message: 20/03/2007, 09h40

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