jose
jose

Reputation: 144

struts 2 external stylesheet link

Hi how can i include an external style sheet link in to my Struts2 jsp page.

here is my code.

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

Upvotes: 1

Views: 6176

Answers (5)

Ravi Thapa
Ravi Thapa

Reputation: 87

Try this

<link href="<%=request.getContextPath()%>/css/alert-messages.css" rel="stylesheet" type="text/css">

Upvotes: 0

Kainattu
Kainattu

Reputation: 81

i was facing the same issue now i got fixed, see my code

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

Upvotes: 0

Aleksandr M
Aleksandr M

Reputation: 24396

Using <s:url> tag

<link rel="stylesheet" type="text/css" href="<s:url value="/css/style.css"/>">

Upvotes: 3

Jaiwo99
Jaiwo99

Reputation: 10017

try:

<link href="${pageContext.request.contextPath}/css/style_inner.css" rel="stylesheet" type="text/css"/>

${pageContext.request.contextPath} points to your application root.

Upvotes: 8

mmalmeida
mmalmeida

Reputation: 1057

Like you did. And with your code you need to find the .css file under your webapp directory, on a directory named "css".

Upvotes: 0

Related Questions