Forum |  HardWare.fr | News | Articles | PC | S'identifier | S'inscrire | Shop Recherche
1828 connectés 

  FORUM HardWare.fr
  Programmation
  Java

  [Résolu] [Java/Jsp] La ressource demandée n'est pas disponible

 


 Mot :   Pseudo :  
 
Bas de page
Auteur Sujet :

[Résolu] [Java/Jsp] La ressource demandée n'est pas disponible

n°1733908
Sbartacus
Posté le 19-05-2008 à 17:31:48  profilanswer
 

Bonjour,
 
Je code un formulaire.  
Voici sa courte description :
 

Code :
  1. <form name='formClient' action="Client/Dispatch1.java" method='POST'>


 
Lorsque je clique donc sur Valider, ça doit faire appel au doGet de ma classe Dispatch1.java.
Ce doGet fait un executeUpdate sur une BD SQL Server et y ajoute donc des données.
 
Or, lorsque je clique actuellement sur Valider, une erreur 404 s'affiche :
 
type Rapport d'état
 
message /SosPt_V0.1/Dispatch1.java
 
description La ressource demandée (/SosPt_V0.1/Dispatch1.java) n'est pas disponible.

 
 
D'où cela vient-il ? J'ai pourtant bien ajouté Dispatch1.java dans le web.xml en tant que Servlet.  
Merci de votre aide.


Message édité par Sbartacus le 20-05-2008 à 15:58:02
mood
Publicité
Posté le 19-05-2008 à 17:31:48  profilanswer
 

n°1734516
Sbartacus
Posté le 20-05-2008 à 14:24:55  profilanswer
 

Voici si ça peut aider à identifier le problème, des compléments :
 
Voici donc un screen du répertoire de mon projet ainsi que le message d'erreur :
 
http://www.noelshack.com/uploads/ErreurNetbeans030018.jpg
 
Enfin voici mon fichier Web.xml
 

Code :
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/ [...] &#034;&gt;
  3.     <servlet>
  4.         <description>Ajoute des données à la BD</description>
  5.         <servlet-name>DispatchClient</servlet-name>
  6.         <servlet-class>Client.DispatchClient</servlet-class>
  7.     </servlet>
  8.     <servlet-mapping>
  9.  <servlet-name>DispatchClient</servlet-name>
  10.  <url-pattern>/DispatchClient</url-pattern>
  11. </servlet-mapping>
  12.     <session-config>
  13.         <session-timeout>
  14.             30
  15.         </session-timeout>
  16.     </session-config>
  17.     <welcome-file-list>
  18.         <welcome-file>formuClient.jsp</welcome-file>
  19.         <welcome-file>index.jsp</welcome-file>
  20.         </welcome-file-list>
  21.     </web-app>


 
J'avoue que je suis un peu perdu. :-(
Donc pour résumer, formuClient.jsp est la page d'accueil, et contient un formulaire qui, lors de la validation doit dispatcher vers DispatchClient.java.
Merci de votre aide.

n°1734624
Bidem
Posté le 20-05-2008 à 15:57:51  profilanswer
 

Code :
  1. <servlet-mapping>
  2.   <servlet-name>DispatchClient</servlet-name>
  3.   <url-pattern>/DispatchClient</url-pattern>
  4. </servlet-mapping>
 

Donc l'action de ton formulaire doit être comme l'url-pattern :

Code :
  1. <form action="/DispatchClient">


Message édité par Bidem le 20-05-2008 à 15:58:06
n°1734626
Sbartacus
Posté le 20-05-2008 à 15:59:23  profilanswer
 

Merci beaucoup pour ta réponse bidem.
J'regrette juste de ne pas avoir posté ce topic plus tôt : j'venais de trouver la réponse 20 minutes avant ton post, après maintes et maintes galères, pensant que ça venait du web.xml. ^^
En tout cas merci. :)

n°2169609
jarule86
Posté le 02-01-2013 à 15:42:55  profilanswer
 

si le meme problem en JSF
 
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/ [...] .xsd&#034; id="WebApp_ID" version="2.5">
  <display-name>AchatWeb</display-name>
  <welcome-file-list>
    <welcome-file>index.jsp</welcome-file>
  </welcome-file-list>
  <servlet>
    <servlet-name>Faces Servlet</servlet-name>
    <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
  </servlet>
  <servlet-mapping>
    <servlet-name>Faces Servlet</servlet-name>
    <url-pattern>/faces/*</url-pattern>
  </servlet-mapping>
  <context-param>
    <description>State saving method: 'client' or 'server' (=default). See JSF Specification 2.5.2</description>
    <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
    <param-value>client</param-value>
  </context-param>
  <context-param>
    <param-name>javax.servlet.jsp.jstl.fmt.localizationContext</param-name>
    <param-value>resources.application</param-value>
  </context-param>
  <context-param>
    <param-name>org.richfaces.SKIN</param-name>
    <param-value>DEFAULT</param-value>
  </context-param>
  <context-param>
    <param-name>org.richfaces.CONTROL_SKINNING</param-name>
    <param-value>enable</param-value>
  </context-param>
  <filter>
    <display-name>RichFaces Filter</display-name>
    <filter-name>richfaces</filter-name>
    <filter-class>org.ajax4jsf.Filter</filter-class>
  </filter>
  <filter-mapping>
    <filter-name>richfaces</filter-name>
    <servlet-name>Faces Servlet</servlet-name>
    <dispatcher>INCLUDE</dispatcher>
    <dispatcher>REQUEST</dispatcher>
    <dispatcher>FORWARD</dispatcher>
  </filter-mapping>
  <listener>
    <listener-class>com.sun.faces.config.ConfigureListener</listener-class>
  </listener>
  <login-config>
    <auth-method>BASIC</auth-method>
  </login-config>
  <servlet-mapping>
    <servlet-name>Faces Servlet</servlet-name>
    <url-pattern>*.jsf</url-pattern>
  </servlet-mapping>
  <servlet-mapping>
    <servlet-name>Faces Servlet</servlet-name>
    <url-pattern>*.faces</url-pattern>
  </servlet-mapping>
  <context-param>
    <description>
 This parameter tells MyFaces if javascript code should be allowed in
 the rendered HTML output.
 If javascript is allowed, command_link anchors will have javascript code
 that submits the corresponding form.
 If javascript is not allowed, the state saving info and nested parameters
 will be added as url parameters.
 Default is 'true'</description>
    <param-name>org.apache.myfaces.ALLOW_JAVASCRIPT</param-name>
    <param-value>true</param-value>
  </context-param>
  <context-param>
    <description>
 If true, rendered HTML code will be formatted, so that it is 'human-readable'
 i.e. additional line separators and whitespace will be written, that do not
 influence the HTML code.
 Default is 'true'</description>
    <param-name>org.apache.myfaces.PRETTY_HTML</param-name>
    <param-value>true</param-value>
  </context-param>
  <context-param>
    <param-name>org.apache.myfaces.DETECT_JAVASCRIPT</param-name>
    <param-value>false</param-value>
  </context-param>
  <context-param>
    <description>
 If true, a javascript function will be rendered that is able to restore the
 former vertical scroll on every request. Convenient feature if you have pages
 with long lists and you do not want the browser page to always jump to the top
 if you trigger a link or button action that stays on the same page.
 Default is 'false'
</description>
    <param-name>org.apache.myfaces.AUTO_SCROLL</param-name>
    <param-value>true</param-value>
  </context-param>
  <listener>
    <listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class>
  </listener>
</web-app>
 
 
 
racin : webcontnent/web/index.jsp
          webcontnent/web-inf/web.xml


Aller à :
Ajouter une réponse
  FORUM HardWare.fr
  Programmation
  Java

  [Résolu] [Java/Jsp] La ressource demandée n'est pas disponible

 

Sujets relatifs
pour que @Before devine le test en cours [resolu][Résolu] [Java] Requête BD : "Le jeu de résultats est fermé"
Questions sur les servlet et netbean[Résolu][Oracle] Problème requete
[Résolu]Récupérer l'id courant ?java
[C] probleme avec librairie mysql.h [résolu]sup des caracteres et rajouter un prefix dans nom de fichier [RESOLU]
[VC] Ressource version 
Plus de sujets relatifs à : [Résolu] [Java/Jsp] La ressource demandée n'est pas disponible


Copyright © 1997-2022 Hardware.fr SARL (Signaler un contenu illicite / Données personnelles) / Groupe LDLC / Shop HFR