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

Tomcat et TomEE Java Discussion :

arborescence tomcat 6


Sujet :

Tomcat et TomEE Java

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Membre éclairé
    Profil pro
    Inscrit en
    Avril 2006
    Messages
    296
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Avril 2006
    Messages : 296
    Par défaut arborescence tomcat 6
    Bonjour je fait un petit programme
    qui se connecte à un base de donnée
    voici 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
     
    <%@ page import="classe.*"%>
     
    <%
     
     
     
     
    Connexion con = new Connexion();
    out.println(con.Select("Select * from test"));
     
     
    %>
    J'importe le paquetage classe ou il y a ma classe connexion
    et tomcat me met une erreur par rapport à cette fameuse classe connexion
    Je voudrais savoir si ma jsp et mon paquetage classe devait bien être dans le répertoire webapps\ROOT ou si l'erreur viendrait d'ailleurs ?

    Merci d'avance

  2. #2
    Membre éclairé
    Profil pro
    Inscrit en
    Avril 2006
    Messages
    296
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Avril 2006
    Messages : 296
    Par défaut
    voici ma classe connexion du paquetage classe

    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
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
     
    package classe;
     
    import java.sql.*;
     
    import javax.swing.JOptionPane;
     
     
    public class Connexion {
    	Connection connection=null;
    	boolean connect;
     
    	public Connexion() {
    		try {
    			Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    		} catch (ClassNotFoundException e) {
    			// TODO Auto-generated catch block
    			e.printStackTrace();
    		}
     
    		try {
    			connection = DriverManager.getConnection("jdbc:odbc:ODBCProjet","root","azerty");
    		} catch (SQLException e) {
    			// TODO Auto-generated catch block
    			JOptionPane.showMessageDialog(null, "La connexion à la base locale a échoué.");
    			e.printStackTrace();
    		}
    		//JOptionPane.showMessageDialog(null, "La connexion est effectuée.");
    		connect=true;
    	}	
     
    	public ResultSet Select(String Requete){
    		Statement statement = null;
    		try {
    			statement = connection.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_READ_ONLY);
    		} catch (SQLException e) {
    			// TODO Auto-generated catch block
    			e.printStackTrace();
    		}
    		ResultSet Result = null;
    		try {
    			Result = statement.executeQuery(Requete);
    		} catch (SQLException e) {
    			// TODO Auto-generated catch block
    			e.printStackTrace();
    		}
    		return Result;	
    	}
     
    	public int Nbcolumn(ResultSet Result){
     
    		try {
    			Result.last();
    		} catch (SQLException e) {
    			// TODO Auto-generated catch block
    			e.printStackTrace();
    		}
    		int nbcol=0;
    		try {
    			nbcol = Result.getRow();
    		} catch (SQLException e) {
    			// TODO Auto-generated catch block
    			e.printStackTrace();
    		}
    		try {
    			Result.beforeFirst();
    		} catch (SQLException e) {
    			// TODO Auto-generated catch block
    			e.printStackTrace();
    		}
    		return nbcol;
    	}
     
    	public int Update(String Requete){
    		Statement statement = null;
    		try {
    			statement = connection.createStatement();
    		} catch (SQLException e1) {
    			// TODO Auto-generated catch block
    			e1.printStackTrace();
    		}
    	    int Reussite = 0;
    		try {
    			Reussite = statement.executeUpdate(Requete);
     
    		} catch (SQLException e) {
    			// TODO Auto-generated catch block
    			JOptionPane.showMessageDialog(null, "Requête Invalide");
    			e.printStackTrace();
    		}
    		return Reussite;
    	}
     
     
    	public void Deconnexion() {
    		// TODO Auto-generated method stub
    		try {
    	    	connection.close();
    		} catch (SQLException e) {
    			// TODO Auto-generated catch block
    			e.printStackTrace();
    		}	
    		//JOptionPane.showMessageDialog(null, "Vous êtes déconnecté.");
    		connect=false;
    	}
    	public boolean Connecter() {
    		return connect;
    	}
    }
    Si quelqu'un pourrait m'aider merci

  3. #3
    Membre éclairé
    Profil pro
    Inscrit en
    Avril 2006
    Messages
    296
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Avril 2006
    Messages : 296
    Par défaut
    Voilà l'erreur qu'il me met:

    19 déc. 2006 08:51:05 org.apache.catalina.core.StandardWrapperValve invoke
    GRAVE: "Servlet.service()" pour la servlet jsp a généré une exception
    org.apache.jasper.JasperException: Impossible de compiler la classe pour la JSP

    Une erreur s'est produite à la ligne: 16 dans le fichier jsp: /insertion.jsp
    Erreur de servlet générée:
    Connexion cannot be resolved to a type

    Une erreur s'est produite à la ligne: 16 dans le fichier jsp: /insertion.jsp
    Erreur de servlet générée:
    Connexion cannot be resolved to a type


    at org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:85)
    at org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:329)
    at org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:415)
    at org.apache.jasper.compiler.Compiler.compile(Compiler.java:308)
    at org.apache.jasper.compiler.Compiler.compile(Compiler.java:286)
    at org.apache.jasper.compiler.Compiler.compile(Compiler.java:273)
    at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:566)
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:314)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:228)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:212)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:818)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:624)
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:445)
    at java.lang.Thread.run(Unknown Source)

  4. #4
    Membre expérimenté Avatar de Pikwik
    Profil pro
    Développeur Web
    Inscrit en
    Mai 2006
    Messages
    237
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations professionnelles :
    Activité : Développeur Web

    Informations forums :
    Inscription : Mai 2006
    Messages : 237
    Par défaut
    Les classes vont dans /WEB-INF/classes

    RTFM !

    /WEB-INF/classes/ - This directory contains any Java class files (and associated resources) required for your application, including both servlet and non-servlet classes, that are not combined into JAR files. If your classes are organized into Java packages, you must reflect this in the directory hierarchy under /WEB-INF/classes/. For example, a Java class named com.mycompany.mypackage.MyServlet would need to be stored in a file named /WEB-INF/classes/com/mycompany/mypackage/MyServlet.class.
    Application Developer's Guide

  5. #5
    Membre éclairé
    Profil pro
    Inscrit en
    Avril 2006
    Messages
    296
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Avril 2006
    Messages : 296
    Par défaut
    j'ai mis mon formulaire.html et ma jsp insertion.jsp dans
    C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\ROOT

    et ma classe connection dans

    C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\ROOT\WEB-INF\classes\classe

    classe étant mon paquetage donc ca peu pas venir de là

  6. #6
    Membre éclairé
    Profil pro
    Inscrit en
    Avril 2006
    Messages
    296
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Avril 2006
    Messages : 296
    Par défaut
    AU secours

Discussions similaires

  1. Arborescence d'un projet avec tomcat
    Par ahmedpa dans le forum Tomcat et TomEE
    Réponses: 3
    Dernier message: 04/05/2013, 23h16
  2. Arborescence projet Web et Tomcat
    Par ginkas31 dans le forum Tomcat et TomEE
    Réponses: 1
    Dernier message: 26/05/2008, 19h06
  3. Où placer un fichier xml dans arborescence tomcat
    Par jpastier dans le forum Tomcat et TomEE
    Réponses: 3
    Dernier message: 11/02/2008, 20h35
  4. arborescence d'une application web avec Tomcat
    Par faten85 dans le forum Tomcat et TomEE
    Réponses: 2
    Dernier message: 10/04/2007, 15h20
  5. [TOMCAT] affichage arborescence au lieu d'éxécuter la servle
    Par lombra dans le forum Tomcat et TomEE
    Réponses: 4
    Dernier message: 13/08/2003, 13h30

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