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

JSF Java Discussion :

Java-JSF sous eclipse


Sujet :

JSF Java

  1. #1
    Membre confirmé
    Inscrit en
    Avril 2010
    Messages
    72
    Détails du profil
    Informations forums :
    Inscription : Avril 2010
    Messages : 72
    Par défaut Java-JSF sous eclipse
    Bonjour à tous,

    je suis débutante en jsf, j'ai developpe une application web utilisant des composants jsf, j'utilise java 1.6, JSF 1.2, avec tomcat v6.0.

    Quand j'exécute ma page index.jsp sa marche correctement, la redirection est faite vers ma page d'accueil jsf, mais lorsque je fais clique droit sur mon projet->run as-> run on server j'ai l'erreur suivante:
    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
    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
    description Le serveur a rencontré une erreur interne () qui l'a empêché de satisfaire la requête.
     
    exception 
     
    org.apache.jasper.JasperException: An exception occurred processing JSP page /index.jsp at line 10
     
    7: <title>Insert title here</title>
    8: </head>
    9: <body>
    10: <jsp:forward page="Test_temperaturConvertor.jsp" />
    11: </body>
    12: </html>
     
     
    Stacktrace:
    	org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:510)
    	org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:401)
    	org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
    	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
    	javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
     
     
    cause mère 
     
    org.apache.jasper.JasperException: An exception occurred processing JSP page /Test_temperaturConvertor.jsp at line 11
     
    8: <title>Celsius to Fahrenheit Convertor</title>
    9: </head>
    10: <body>
    11: <f:view>
    12: 	<h:form>
    13: 		<h:panelGrid columns="2">
    14: 			<h:outputLabel value="Celsius"></h:outputLabel>
     
     
    Stacktrace:
    	org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:510)
    	org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:419)
    	org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
    	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
    	javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    	org.apache.jasper.runtime.PageContextImpl.doForward(PageContextImpl.java:706)
    	org.apache.jasper.runtime.PageContextImpl.forward(PageContextImpl.java:677)
    	org.apache.jsp.index_jsp._jspService(index_jsp.java:62)
    	org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
    	javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    	org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377)
    	org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
    	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
    	javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
     
     
    cause mère 
     
    java.lang.RuntimeException: FacesContext not found
    	javax.faces.webapp.UIComponentClassicTagBase.getFacesContext(UIComponentClassicTagBase.java:321)
    	javax.faces.webapp.UIComponentClassicTagBase.setJspId(UIComponentClassicTagBase.java:228)
    	org.apache.jsp.Test_005ftemperaturConvertor_jsp._jspx_meth_f_005fview_005f0(Test_005ftemperaturConvertor_jsp.java:114)
    	org.apache.jsp.Test_005ftemperaturConvertor_jsp._jspService(Test_005ftemperaturConvertor_jsp.java:88)
    	org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
    	javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    	org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377)
    	org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
    	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
    	javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    	org.apache.jasper.runtime.PageContextImpl.doForward(PageContextImpl.java:706)
    	org.apache.jasper.runtime.PageContextImpl.forward(PageContextImpl.java:677)
    	org.apache.jsp.index_jsp._jspService(index_jsp.java:62)
    	org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
    	javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    	org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377)
    	org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
    	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
    	javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
     
     
    note La trace complète de la cause mère de cette erreur est disponible dans les fichiers journaux de Apache Tomcat/6.0.29.
    je ne comprends pas pourquoi il ne trouve pas le FacesContext, pourtant j'utilise bien les librairie du JSF 1.2, jstl-api-1.2.jar et jstl-impl-1.2.jar.

    Quelqu'un pourrait-il m'aider? je galère depuis hier soir, je vous remercie d'avance

  2. #2
    Membre actif
    Inscrit en
    Juillet 2006
    Messages
    28
    Détails du profil
    Informations forums :
    Inscription : Juillet 2006
    Messages : 28
    Par défaut
    montre nous ta page Test_temperaturConvertor complete

  3. #3
    Membre confirmé
    Inscrit en
    Avril 2010
    Messages
    72
    Détails du profil
    Informations forums :
    Inscription : Avril 2010
    Messages : 72
    Par défaut
    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
    <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
    <%@ taglib prefix="f"  uri="http://java.sun.com/jsf/core"%>
    <%@ taglib prefix="h"  uri="http://java.sun.com/jsf/html"%>
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
    <title>Celsius to Fahrenheit Convertor</title>
    </head>
    <body>
    <f:view>
    	<h:form>
    		<h:panelGrid columns="2">
    			<h:outputLabel value="Celsius"></h:outputLabel>
    			<h:inputText  value="#{temparaturConvertor.celsius}"></h:inputText>
    		</h:panelGrid>
    		<h:commandButton action="#{temparaturConvertor.celsiusToFahrenheit}" value="Calculate"></h:commandButton>
    		<h:commandButton action="#{temparaturConvertor.reset}" value="Reset"></h:commandButton>
    		<h:messages layout="table"></h:messages>
    	</h:form>
     
     
    	<h:panelGroup rendered="#{temparaturConvertor.initial!=true}">
    	<h3> Result </h3>
    	<h:outputLabel value="Fahrenheit "></h:outputLabel>
    	<h:outputLabel value="#{temparaturConvertor.fahrenheit}"></h:outputLabel>
    	</h:panelGroup>
    </f:view>
    </body>
    </html>

  4. #4
    Membre actif
    Inscrit en
    Juillet 2006
    Messages
    28
    Détails du profil
    Informations forums :
    Inscription : Juillet 2006
    Messages : 28
    Par défaut
    c'est aps évidant
    je ne vois aucune erreur dans ta page jsp
    alors montre moi tes 2 fichiers
    web.xml
    faces-config.xml

  5. #5
    Membre confirmé
    Inscrit en
    Avril 2010
    Messages
    72
    Détails du profil
    Informations forums :
    Inscription : Avril 2010
    Messages : 72
    Par défaut
    le 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
    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
    <?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/web-app_2_5.xsd" id="WebApp_ID" version="2.5">
      <display-name>Projet_Concessions_Voitures</display-name>
      <welcome-file-list>
        <welcome-file>index.html</welcome-file>
        <welcome-file>index.htm</welcome-file>
        <welcome-file>index.jsp</welcome-file>
        <welcome-file>default.html</welcome-file>
        <welcome-file>default.htm</welcome-file>
        <welcome-file>default.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>
        <param-name>javax.servlet.jsp.jstl.fmt.localizationContext</param-name>
        <param-value>resources.application</param-value>
      </context-param>
      <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>
        <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>
    le face-config.xml
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    <?xml version="1.0" encoding="UTF-8"?>
     
    <faces-config
        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/web-facesconfig_1_2.xsd"
        version="1.2">
    	<managed-bean>
    		<managed-bean-name>temperaturConvertor</managed-bean-name>
    		<managed-bean-class>test.TemperaturConvertor</managed-bean-class>
    		<managed-bean-scope>session</managed-bean-scope>
    	</managed-bean>
    </faces-config>

  6. #6
    Membre actif
    Inscrit en
    Juillet 2006
    Messages
    28
    Détails du profil
    Informations forums :
    Inscription : Juillet 2006
    Messages : 28
    Par défaut
    vraiment désole je peux pas t'aider
    car je travaille avec jsf mojarra et pas myfaces
    bien que il y a des différences entre les deux configuration

  7. #7
    Membre actif
    Profil pro
    Inscrit en
    Novembre 2010
    Messages
    55
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Novembre 2010
    Messages : 55
    Par défaut
    regarde plutôt si tomcat embarque bien les lib, je pense que ton problème vient de ce coté là.

  8. #8
    Membre confirmé
    Inscrit en
    Avril 2010
    Messages
    72
    Détails du profil
    Informations forums :
    Inscription : Avril 2010
    Messages : 72
    Par défaut
    voici les différentes librairies dans le dossier lib de tomcat, est-ce-que je dois rajouter les librairies de jsf dedans?
    Images attachées Images attachées  

  9. #9
    Membre confirmé
    Inscrit en
    Avril 2010
    Messages
    72
    Détails du profil
    Informations forums :
    Inscription : Avril 2010
    Messages : 72
    Par défaut
    voilà j'ai résolu le problème, en fait il suffisait de remplacer dans le web.xml
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    <url-pattern>/faces/*</url-pattern>
    par
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    <url-pattern>*.jsf</url-pattern>
    au niveau de servlet-mapping et faire le forwarding vers ma "paged'accueil.jsf" au lieu de "paged'accueil.jsp" et le tour est joué.
    Je remercie ceux qui ont bien voulu m'aider.

  10. #10
    Membre averti
    Homme Profil pro
    Étudiant
    Inscrit en
    Février 2012
    Messages
    16
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Tunisie

    Informations professionnelles :
    Activité : Étudiant
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Février 2012
    Messages : 16
    Par défaut
    Bonjour, j'ai exactement le même problème et j'ai modifié l'url pattern à *.jsf.
    Ensuite, j'ai modifié mon index.jsp ainsi <jsp:forward page="main.jsf" />

    mais, j'ai eu cette erreur

    La ressource demandée (/Test/faces/main.jsp;jsessionid=9E3189E4FB9E90720D7D5DF949F63E96) n'est pas disponible.


    De l'aide svp

  11. #11
    Membre chevronné
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Novembre 2011
    Messages
    239
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Somme (Picardie)

    Informations professionnelles :
    Activité : Ingénieur développement logiciels

    Informations forums :
    Inscription : Novembre 2011
    Messages : 239
    Par défaut
    Citation Envoyé par Dabdoubi Voir le message
    La ressource demandée (/Test/faces/main.jsp;jsessionid=9E3189E4FB9E90720D7D5DF949F63E96) n'est pas disponible.
    Je serais tenté de dire que ta page main.jsp n'est pas au bon endroit, il va la chercher suivant ce chemin "/Test/faces/main.jsp" c'est correct ?

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

Discussions similaires

  1. Réponses: 1
    Dernier message: 26/05/2011, 16h51
  2. [Portlet] Développer une portlet en java/j2ee sous eclipse et tomcat?
    Par kelkan dans le forum Portails
    Réponses: 6
    Dernier message: 30/07/2008, 10h22
  3. Intégrer richfaces à un projet JSF sous eclipse
    Par jsebfranck dans le forum JSF
    Réponses: 13
    Dernier message: 29/04/2008, 11h37
  4. Réponses: 3
    Dernier message: 27/03/2008, 13h55
  5. [Plugin]Quel plugin pour JSF sous Eclipse ?
    Par Gabbe_pro dans le forum Eclipse Java
    Réponses: 2
    Dernier message: 03/06/2005, 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