Question

My struts2 project structure as follows

Webcontent
  css
    abc.css
  jsp
    login.jsp
  META-INF
  WEB-INF

indeed to include the functions of abc.css in login page.How can i do that ? How can i give the path of css file in jsp page ?

Était-ce utile?

La solution

Include your css with the following statement.

<head>
<link rel="stylesheet" type="text/css" href="../css/abc.css">
</head>

"../css/abc.css" is a relative path.

"../" represents one directory up. i.e., Login.jsp is in "jsp" directory "../" will make the directory as "Webcontent"

"../css" will traverse you upto "css" directory in the "Webcontent".

"../css/abc.css" will give the abc.css file.

Autres conseils

you can include your css file like this.

<head>
    <link rel="stylesheet" type="text/css" href="/Webcontent/css/abc.css">
</head>
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top