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

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

    Informations forums :
    Inscription : Juin 2003
    Messages : 172
    Points : 60
    Points
    60
    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 éminent
    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
    Points : 7 679
    Points
    7 679
    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 du Club
    Profil pro
    Inscrit en
    Juin 2003
    Messages
    172
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Juin 2003
    Messages : 172
    Points : 60
    Points
    60
    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 éminent
    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
    Points : 7 679
    Points
    7 679
    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 du Club
    Profil pro
    Inscrit en
    Juin 2003
    Messages
    172
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Juin 2003
    Messages : 172
    Points : 60
    Points
    60
    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 éminent
    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
    Points : 7 679
    Points
    7 679
    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 !

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

    Informations forums :
    Inscription : Juin 2003
    Messages : 172
    Points : 60
    Points
    60
    Par défaut
    Je te remercie mais ca fonctionne toujours pas.


    Je ne sais plus trop comment faire voici mon dernier code de la 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 dernier 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

  8. #8
    Expert éminent
    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
    Points : 7 679
    Points
    7 679
    Par défaut
    mais t'es méchant toi pour gentil !

    En relisant mes posts, tu remarqueras que je t'ai proposé de:
    - mettre "action" sans le / dans la JSP
    - mettre "/action" avec le slash dans struts-config.xml !

    Pourtant, ta dernière JSP contient :
    <html:form action="/action">
    corrige ça en :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    <html:form action="action">
    Et autre chose : Utilises un IDE comme eclipse + Exadel studio pour travailler avec struts, sinon, tu risques de couler sous un flot d'erreurs (bêtes) de syntaxe ou de frappe ! Ton cas en est la preuve vivante !

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

    Informations forums :
    Inscription : Juin 2003
    Messages : 172
    Points : 60
    Points
    60
    Par défaut
    Je te remercie modjo.

    J'ai codé ma jsp et mon fichier struts-config correctement, il me semble mais ca fonctionne pas je du mal à comprendre pourquoi.

    Je vous donne 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="doaction">
      <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="/doaction" 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

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

    Informations forums :
    Inscription : Juin 2003
    Messages : 172
    Points : 60
    Points
    60
    Par défaut
    S'il vous plaît les gars aider moi, ca fat plusieurs jours que je suis bloqué sur cette erreur.

    Je vous remercie de votre aide

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

    Informations forums :
    Inscription : Juin 2003
    Messages : 172
    Points : 60
    Points
    60
    Par défaut
    S'il vous plait une personne n'a pas une idée pourquoi j'ai cette erreur?

  12. #12
    Modérateur
    Avatar de OButterlin
    Homme Profil pro
    Inscrit en
    Novembre 2006
    Messages
    7 310
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations forums :
    Inscription : Novembre 2006
    Messages : 7 310
    Points : 9 522
    Points
    9 522
    Billets dans le blog
    1
    Par défaut
    Dans la page JSP, code le formulaire comme ceci :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
     
    ...
    <html:form action="<%=request.getContextPath()%>/doaction">
    ...
    A+
    N'oubliez pas de consulter les FAQ Java et les cours et tutoriels Java

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

    Informations forums :
    Inscription : Juin 2003
    Messages : 172
    Points : 60
    Points
    60
    Par défaut
    Je te remercie de ton aide orbertulain, mais il une erreur de syntaxe lorsque je compile, le serveur me génère cette erreur:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    org.apache.jasper.JasperException: /index.jsp(10,23) L'attribut pour %>" n'est pas correctement terminé
    	org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:510)
    	org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:375)
    	org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
    	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
    	javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    Je vous remercie de votre aide

  14. #14
    Modérateur
    Avatar de OButterlin
    Homme Profil pro
    Inscrit en
    Novembre 2006
    Messages
    7 310
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations forums :
    Inscription : Novembre 2006
    Messages : 7 310
    Points : 9 522
    Points
    9 522
    Billets dans le blog
    1
    Par défaut
    Tu peux montrer le code de la page ?
    N'oubliez pas de consulter les FAQ Java et les cours et tutoriels Java

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

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

    Je te montre le code de ma jsp, 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
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    <%@ 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="<%=request.getContextPath()%>/doaction">
      <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:errors/>
     </html:form>
     
    </body>
    </html:html>
    En même temps, je te donne le code de 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
    22
     
    <?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="/doaction" 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

  16. #16
    Modérateur
    Avatar de OButterlin
    Homme Profil pro
    Inscrit en
    Novembre 2006
    Messages
    7 310
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations forums :
    Inscription : Novembre 2006
    Messages : 7 310
    Points : 9 522
    Points
    9 522
    Billets dans le blog
    1
    Par défaut
    Mince, j'suis pas réveillé

    Avec Struts et le taglib <html:form>, tu n'as pas besoin du <%=request.getContextPath()%>.
    La forme <html:form action="/doaction"> génèrera la même chose...
    (ou action="/doaction.do", c'est pareil)

    D'après ton struts.config.xml, ça doit fonctionner comme ça.
    Si ce n'est pas le cas, peux-tu montrer l'erreur, le controleur et la page ?
    N'oubliez pas de consulter les FAQ Java et les cours et tutoriels Java

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

    Informations forums :
    Inscription : Juin 2003
    Messages : 172
    Points : 60
    Points
    60
    Par défaut
    Je te remercie encore mais je viens de tester avec:
    <html:form action="/doaction.do"> et avec <html:form action="/doaction"> et ca fonctionne pas.

    Je te donne ma jsp car je l'ai changé
    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
    33
    <%@ 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="/doaction.do">
      <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:errors/>
     </html:form>
     
    </body>
    </html:html>
    Je te donne égallement mon beanaction
    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
    package bean;
     
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
     
    import org.apache.struts.action.ActionErrors;
    import org.apache.struts.action.ActionForm;
    import org.apache.struts.action.ActionForward;
    import org.apache.struts.action.ActionMapping;
     
    public class Formaction extends ActionForm {
     
    	public ActionForward execute (ActionMapping mapping,ActionForm form, HttpServletRequest Request, HttpServletResponse response)
    	{
     
    		return mapping.getInputForward();
    	}
     
    }
    Je vous remercie de votre aide

  18. #18
    Modérateur
    Avatar de OButterlin
    Homme Profil pro
    Inscrit en
    Novembre 2006
    Messages
    7 310
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations forums :
    Inscription : Novembre 2006
    Messages : 7 310
    Points : 9 522
    Points
    9 522
    Billets dans le blog
    1
    Par défaut
    Dans ton fichier struts-config.xml, peux-tu modifier ceci :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
     
    <action-mappings type="org.apache.struts.action.ActionMapping">
       <action path="/doaction" input="/index.jsp" scope="request" name="formulaire" type="bean.Formaction"/>
    </action-mappings>
    
    par :
    
    <action-mappings>
       <action path="/doaction" input="/index.jsp" ... />
    </action-mappings>
    Pareil pour <form-beans>

    Sinon, tu as quelle version de struts ?
    N'oubliez pas de consulter les FAQ Java et les cours et tutoriels Java

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

    Informations forums :
    Inscription : Juin 2003
    Messages : 172
    Points : 60
    Points
    60
    Par défaut
    Je te remercie mais j'ai toujours la même erreur:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    type Rapport d'état
     
    message No action instance for path /doaction could be created
     
    description Le serveur a rencontré une erreur interne (No action instance for path /doaction could be created) qui l'a empêché de satisfaire la requête.
    J'ai la version de struts 1.2.7.

    voici mon dernier 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>
     <form-bean name="formulaire" type="bean.Form"/>
     </form-beans>
     
     <global-exceptions/>
     <global-forwards/>
     
     <action-mappings>
    	<action path="/doaction" 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

  20. #20
    Modérateur
    Avatar de OButterlin
    Homme Profil pro
    Inscrit en
    Novembre 2006
    Messages
    7 310
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations forums :
    Inscription : Novembre 2006
    Messages : 7 310
    Points : 9 522
    Points
    9 522
    Billets dans le blog
    1
    Par défaut
    Décidément, c'est pas mon jour...

    Regarde ton (soit disant) contrôleur, il étend ActionForm, ça ne peut pas marché. Le contrôleur étend Action ou DispatchAction ou LookupDispatchAction...
    Si tu mets Action, ça doit passer...

    A+
    N'oubliez pas de consulter les FAQ Java et les cours et tutoriels Java

+ Répondre à la discussion
Cette discussion est résolue.
Page 1 sur 2 12 DernièreDernière

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