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 ?

有帮助吗?

解决方案

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.

其他提示

you can include your css file like this.

<head>
    <link rel="stylesheet" type="text/css" href="/Webcontent/css/abc.css">
</head>
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top