blue-sky
blue-sky

Reputation: 53806

Error - Can not find the tag library descriptor for "/struts-tags"

I'm receiving this error on my jsp file - 'Can not find the tag library descriptor for "/struts-tags"'

Strange thing is my app still seems to work.

I'm following the tutorials at - http://struts.apache.org/2.x/docs/using-struts-2-tags.html

Here is the code.

<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> 
<%@ taglib prefix="s" uri="/struts-tags" %> 
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> 
<html> 
  <head> 
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> 
      <title>Hello World!</title> 
  </head> 
  <body>  
      <h2><s:property value="messageStore.message" /></h2>  
      <p>I've said hello <s:property value="helloCount" /> times!</p>  
      <p><s:property value="messageStore" /></p> 
  </body>
</html>  

Thanks

Upvotes: 14

Views: 66064

Answers (9)

Khaja Nizamuddin
Khaja Nizamuddin

Reputation: 177

go to Project tab > Clean.. Even if cleaning the project doesn't clear the error, right-click on the project and click refresh

Then right-click on the project, go to properties, Java Build Path >> 'Order and Export' tab >> make sure JRE library and Maven dependencies are checked.

that would probably solve it as it did for me

Upvotes: 0

atom217
atom217

Reputation: 987

add struts2-core-.jar to the project

download it here

http://struts.apache.org/development/2.x/index.html

Upvotes: 0

lory105
lory105

Reputation: 6302

I had this problem because I copied the libraries manually and directly into the folder WEB-INF/lib of the project and eclipse doesn't see them (I suggest you copy any necessary libraries into WEB-INF/lib only through eclipse!). So only a refresh of the project solved the problem for me because all the other solutions didn't work!!

(I'm using Eclipse Kepler unber Ubuntu)

Upvotes: 1

Nirmal Mangal
Nirmal Mangal

Reputation: 812

I faced similar problem. This is what I did to resolve the issue.

1.Select Project and right click. 2.Click on properties. 3.Click on libraries tab. 4.Click on 'Add Jars'. 5.Add relavent jar for your error.

hope this helps. Thanks.

Upvotes: 1

Tanvir
Tanvir

Reputation: 1522

The same thing happened to me. I am using Maven to compile. So, I disabled and re-enabled Maven in my project and that solved it.

Upvotes: 1

htobon
htobon

Reputation: 153

In ECLIPSE: Right click on the project and select the option "Validate". That's all.

Upvotes: 7

Steven Benitez
Steven Benitez

Reputation: 11055

As William mentioned, this sounds like your IDE may not know where the TLD for the tag library is in your project, but once packaged and running, it is working fine.

Upvotes: 0

Javi
Javi

Reputation: 19769

Have you added the struts2-core-.jar to the libraries of the project? If you have try to clean the project.

Upvotes: 20

William
William

Reputation: 13632

This is probably Eclipse getting a bit 'confused' rather than a genuine error.

I had the same thing yesterday when working through a Struts 2 tutorial, but it disappeared after opening/closing the JSPs.

Upvotes: 1

Related Questions