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 :

mettre une image en background d'une jsp


Sujet :

Struts 1 Java

  1. #1
    Membre régulier
    Inscrit en
    Juin 2008
    Messages
    394
    Détails du profil
    Informations forums :
    Inscription : Juin 2008
    Messages : 394
    Points : 73
    Points
    73
    Par défaut mettre une image en background d'une jsp
    salut

    je veux mettre une image qui se trouve dans le répertoire "images"dans WebContent" comme background de mes jsp

    pour cela j'ai modifié le fichier defaut.css comme suit:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
     
    BODY 	{
                background-color      : #ffffff;
    		color		  : #000000;
    		margin-left           : 0;
    		margin-right          :0;
    		margin-top            : 0;
     
     background-attachment:      fixed;
     background-image:           url("Background.TIF");
     background-repeat:          repeat-x;
     background-position:        center;
    }
    mais ça donne rien meme en mettant ça
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
     
     background-image:           url("images/Background.TIF");
    qlq'un un une idée ou peut etre le prob
    merci

  2. #2
    Expert éminent

    Femme Profil pro
    Inscrit en
    Juillet 2005
    Messages
    5 793
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Localisation : France

    Informations forums :
    Inscription : Juillet 2005
    Messages : 5 793
    Points : 7 778
    Points
    7 778
    Par défaut
    Ta jsp est-elle directement sous WebContent ou dans un répertoire sous WebContent ?

    Si elle est dans un répertoire sous WebContent, il faut coder l'url comme ceci :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    background-image:           url("../images/Background.TIF");
    Modératrice Java - Struts, Servlets/JSP, ...

  3. #3
    Membre régulier
    Inscrit en
    Juin 2008
    Messages
    394
    Détails du profil
    Informations forums :
    Inscription : Juin 2008
    Messages : 394
    Points : 73
    Points
    73
    Par défaut
    j'ai fait ça mais ça donne rien
    que doit etre le problème alors?
    voila un bout de code de 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
    33
    34
    35
    36
    37
    38
    39
    40
     
     
    <%@ page language="java" pageEncoding="ISO-8859-1"%>
     
    <%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
    <%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
    <%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>
    <%@ taglib uri="http://struts.apache.org/tags-tiles" prefix="tiles" %>
     <%@taglib uri="http://struts.application-servers.com/layout" prefix="layout" %>
    <%@ page import="java.util.ArrayList" %>
    <%@ page import="com.yourcompany.struts.UtilBean.Profil" %>
     
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html:html lang="true">
      <head>
        <html:base />
     
        <title>approbation</title>
     
    	 <layout:skin includeScript="true"/>
    	  <script>  
    </script>
     
    	<meta http-equiv="pragma" content="no-cache">
    	<meta http-equiv="cache-control" content="no-cache">
    	<meta http-equiv="expires" content="0">    
    	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
    	<meta http-equiv="description" content="This is my page">
     
     
      </head>
     
      <body onload="desactiverapprob();">
     
    <jsp:include page="menu.jsp"/>  
     <hr>
     
     
      </body>
    </html:html>
    merci

  4. #4
    Membre habitué Avatar de badoress
    Inscrit en
    Mars 2007
    Messages
    169
    Détails du profil
    Informations personnelles :
    Âge : 39

    Informations forums :
    Inscription : Mars 2007
    Messages : 169
    Points : 159
    Points
    159
    Par défaut
    le répertoire "images" se trouve où exactement dans l'arborescence de ton application ?

  5. #5
    Membre régulier
    Inscrit en
    Juin 2008
    Messages
    394
    Détails du profil
    Informations forums :
    Inscription : Juin 2008
    Messages : 394
    Points : 73
    Points
    73
    Par défaut
    dans le répertoire images sous WebContent comme a dit c_nvy

  6. #6
    Expert éminent

    Femme Profil pro
    Inscrit en
    Juillet 2005
    Messages
    5 793
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Localisation : France

    Informations forums :
    Inscription : Juillet 2005
    Messages : 5 793
    Points : 7 778
    Points
    7 778
    Par défaut
    Tu n'as pas répondu à ma question concernant les jsp.
    Où sont-elles ?

    Bon, sinon, tu peux toujours coder ceci :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    background-image:           url("/contexteDeTonAppli/images/Background.TIF");
    Modératrice Java - Struts, Servlets/JSP, ...

  7. #7
    Membre régulier
    Inscrit en
    Juin 2008
    Messages
    394
    Détails du profil
    Informations forums :
    Inscription : Juin 2008
    Messages : 394
    Points : 73
    Points
    73
    Par défaut
    désolée c_nvy
    mes jsp se trouve dans un répertoire "forms" sous WebContent
    Bon, sinon, tu peux toujours coder ceci :
    Code :
    background-image: url("/contexteDeTonAppli/images/Background.TIF");
    meme en essayant cette solution ça donne rien
    je ne comprend pas peut etre y'a une balise au niveau de ma jsp qui empèche
    l'affichage de cette image ?

    voila le code entièr de 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
    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
     
    <%@ page language="java" pageEncoding="ISO-8859-1"%>
     
    <%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
    <%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
    <%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>
    <%@ taglib uri="http://struts.apache.org/tags-tiles" prefix="tiles" %>
    <%@taglib uri="/WEB-INF/struts-layout.tld" prefix="layout" %>
    <%@ page import="java.util.ArrayList" %>
    <%@ page import="com.yourcompany.struts.UtilBean.Profil" %>
     
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html:html lang="true">
      <head>
        <html:base />
     
        <title>réception</title>
     
    	 <layout:skin includeScript="true"/>
     
        <script>
     
    	function setHidden(value){document.recepForm.hidden.value=value;}
     
     
    	</script>
     
     
     
     
    	<meta http-equiv="pragma" content="no-cache">
    	<meta http-equiv="cache-control" content="no-cache">
    	<meta http-equiv="expires" content="0">    
    	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
    	<meta http-equiv="description" content="This is my page">
     
     
      </head>
     
    <body>                
     
    <jsp:include page="menu.jsp"/>  
     <hr>
     <layout:form action="/recep3.do">
     
       <layout:text property="hidden" mode="H,H,H" value="default">   </layout:text>
     
       <layout:row>
        <layout:column width="400"></layout:column>
       <layout:column> 
          <center>
          <h3>
          RECEPTION 
          </h3>
           </center>
          </layout:column>
       </layout:row>
     
               <layout:row width="700">
           <layout:column width="400"></layout:column>
           <layout:column width="300">
     
          <layout:panel align="center" key="choisir un magasin de réception" styleClass="FORM">
     
             <center>
     
               <layout:select property="magas" key="choisir un magasin:" onchange="setHidden('preparRecep');document.recepForm.submit();">
           <layout:option value=""></layout:option>
           <layout:options property="listmagasin"></layout:options>
           </layout:select> 
              </center>
             </layout:panel>
     
             </layout:column>
             </layout:row>
     
        </layout:form>
      </body>
    </html:html>

    et voila un bout de code de mon ficher defaut.css
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
     
    BODY 	{
                background-color      : #ffffff;
    		color		  : #000000;
    		margin-left           : 0;
    		margin-right          :0;
    		margin-top            : 0;
     
     background-attachment:      fixed;
     background-image:           url( "../images/Background.TIF");
     background-repeat:          repeat-x;
     background-position:        center;
    }

    merci

  8. #8
    Nouveau membre du Club
    Inscrit en
    Avril 2007
    Messages
    23
    Détails du profil
    Informations forums :
    Inscription : Avril 2007
    Messages : 23
    Points : 28
    Points
    28
    Par défaut
    voila ton prolm: ""

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
     
     background-image:           url( "../images/Background.TIF");
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
     
     background-image:           url( ../images/Background.TIF);

Discussions similaires

  1. Insérer une image en background dans une table
    Par akab48 dans le forum Mise en page CSS
    Réponses: 1
    Dernier message: 27/01/2015, 14h19
  2. [Python 3.X] Créer une image png à partir d'une image de format quelconque avec Python
    Par bguy4 dans le forum Général Python
    Réponses: 3
    Dernier message: 30/10/2014, 10h49
  3. Afficher une image par défaut lorsque une image ne s'affiche pas
    Par ne2sbeal dans le forum Général Conception Web
    Réponses: 4
    Dernier message: 10/10/2011, 10h42
  4. [FTP] Code pour mettre une image en background
    Par Link14 dans le forum Langage
    Réponses: 2
    Dernier message: 24/02/2006, 21h10
  5. code HTML pour mettre une image en background dans un menu
    Par Link14 dans le forum Balisage (X)HTML et validation W3C
    Réponses: 2
    Dernier message: 16/10/2005, 12h11

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