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

Servlets/JSP Java Discussion :

authentification dans jsp


Sujet :

Servlets/JSP Java

  1. #1
    Membre averti
    Homme Profil pro
    Inscrit en
    Mai 2010
    Messages
    42
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations forums :
    Inscription : Mai 2010
    Messages : 42
    Par défaut authentification dans jsp
    Bonjour,

    je n'ai pas su comment faire l'authentification dans jsp
    est-ce que vous n'avez pas une idée sur ça

    merci

  2. #2
    Membre Expert
    Avatar de slim_java
    Homme Profil pro
    Enseignant
    Inscrit en
    Septembre 2008
    Messages
    2 272
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 40
    Localisation : Tunisie

    Informations professionnelles :
    Activité : Enseignant
    Secteur : Enseignement

    Informations forums :
    Inscription : Septembre 2008
    Messages : 2 272
    Par défaut
    Salut,
    je te propose cet article sur l'authentification sous Tomcat

  3. #3
    Membre averti
    Homme Profil pro
    Inscrit en
    Mai 2010
    Messages
    42
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations forums :
    Inscription : Mai 2010
    Messages : 42
    Par défaut réponse
    je suis arrivé à la fin de III. Création de la DataSource du tutoriel
    j'ai eu cette erreur
    DataSource cannot be resolved to a type
    est-ce que vous avez une idée sur ça

    j'ai un autre problème: je ne peux pas accéder à la section "Tomcat Manager" de tomcat (je n'ai pas de mot de passe)

    merci

  4. #4
    Membre Expert
    Avatar de slim_java
    Homme Profil pro
    Enseignant
    Inscrit en
    Septembre 2008
    Messages
    2 272
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 40
    Localisation : Tunisie

    Informations professionnelles :
    Activité : Enseignant
    Secteur : Enseignement

    Informations forums :
    Inscription : Septembre 2008
    Messages : 2 272
    Par défaut
    Salut,

    Citation Envoyé par ktaria Voir le message
    je suis arrivé à la fin de III. Création de la DataSource du tutoriel
    j'ai eu cette erreur
    DataSource cannot be resolved to a type
    est-ce que vous avez une idée sur ça
    Non

    Citation Envoyé par ktaria Voir le message
    j'ai un autre problème: je ne peux pas accéder à la section "Tomcat Manager" de tomcat (je n'ai pas de mot de passe)

    Tu dois ajouter un utilisateur dans le fichier tomcat-users.xml

  5. #5
    Membre averti
    Homme Profil pro
    Inscrit en
    Mai 2010
    Messages
    42
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations forums :
    Inscription : Mai 2010
    Messages : 42
    Par défaut réponse
    Citation Envoyé par slim_java Voir le message
    Tu dois ajouter un utilisateur dans le fichier tomcat-users.xml
    j'ai ajouté mais ça ne marche pas !

  6. #6
    Membre Expert
    Avatar de slim_java
    Homme Profil pro
    Enseignant
    Inscrit en
    Septembre 2008
    Messages
    2 272
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 40
    Localisation : Tunisie

    Informations professionnelles :
    Activité : Enseignant
    Secteur : Enseignement

    Informations forums :
    Inscription : Septembre 2008
    Messages : 2 272
    Par défaut
    Salut,
    montre nous le contenu de ton fichier tomcat-users.xml

  7. #7
    Membre averti
    Homme Profil pro
    Inscrit en
    Mai 2010
    Messages
    42
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations forums :
    Inscription : Mai 2010
    Messages : 42
    Par défaut contenu de tomcat-users.xml
    <?xml version='1.0' encoding='utf-8'?>
    <!--
    Licensed to the Apache Software Foundation (ASF) under one or more
    contributor license agreements. See the NOTICE file distributed with
    this work for additional information regarding copyright ownership.
    The ASF licenses this file to You under the Apache License, Version 2.0
    (the "License"); you may not use this file except in compliance with
    the License. You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
    -->
    <tomcat-users>
    <!--
    NOTE: By default, no user is included in the "manager-gui" role required
    to operate the "/manager/html" web application. If you wish to use this app,
    you must define such a user - the username and password are arbitrary.
    -->
    <!--
    NOTE: The sample user and role entries below are wrapped in a comment
    and thus are ignored when reading this file. Do not forget to remove
    <!.. ..> that surrounds them.
    -->
    <!--
    <role rolename="tomcat"/>
    <role rolename="role1"/>
    <role rolename="manager"/>
    <role rolename="admin"/>
    <user username="tomcat" password="tomcat" roles="tomcat"/>
    <user username="both" password="tomcat" roles="tomcat,role1"/>
    <user username="role1" password="tomcat" roles="role1"/>
    <user username="admin" password="admin" roles="admin,manager"/>
    <user username="ax" password="ax" roles="admin,manager"/>
    -->
    </tomcat-users>

    je te remercies Slim

  8. #8
    Membre Expert
    Avatar de slim_java
    Homme Profil pro
    Enseignant
    Inscrit en
    Septembre 2008
    Messages
    2 272
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 40
    Localisation : Tunisie

    Informations professionnelles :
    Activité : Enseignant
    Secteur : Enseignement

    Informations forums :
    Inscription : Septembre 2008
    Messages : 2 272
    Par défaut
    Salut,
    dans le fichier web.xml tu dois ajouter

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    <security-role>
        <role-name>nom_role</role-name>
    </security-role>
    <security-constraint>
            ...
        <auth-constraint>
            <role-name>nom_role</role-name>
        </auth-constraint>
    </security-constraint>
    avec nom_role, un rôle figurant dans le fichier conf/tomcat-users.xml

    tu peux utiliser l'assistant de ton IDE pour faire ce manip

Discussions similaires

  1. Problème d'authentification dans une JSP
    Par sihamnet dans le forum Servlets/JSP
    Réponses: 1
    Dernier message: 08/05/2012, 01h13
  2. Réponses: 3
    Dernier message: 15/09/2004, 15h01
  3. [EJB] [JSP] Méthode EJB non reconnue dans jsp
    Par stago dans le forum Servlets/JSP
    Réponses: 2
    Dernier message: 06/07/2004, 09h52
  4. probleme d'afichage dans JSP
    Par Zorgz dans le forum Servlets/JSP
    Réponses: 4
    Dernier message: 16/06/2004, 15h20
  5. [Debutant][Struts] Pb de forward dans jsp
    Par muim dans le forum Servlets/JSP
    Réponses: 2
    Dernier message: 19/02/2004, 11h02

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