Reputation: 23352
I downloaded latest version of Jboss from JBOSS website.
I created a Dynamic Web Project and create a servlet in it. Servlet class has build path errors as shown in image below. I explored server directories and it did not include any servlet jar. How can I get JBOSS server which include servlet and web jars in it?
Upvotes: 3
Views: 1689
Reputation: 68715
The servlet jar in JBOSS server should be present under:
JBOSS_HOME/common/lib/
most likely with name servlet-api.jar
It should also be included in your class-path.
Upvotes: 4
Reputation: 53553
JBoss has those files, but what it doesn't have is a common classpath folder (common/lib). Everything is divided into separate modules.
This is partly the reason for why if you want to work with Eclipse without Maven (or similar build management tool), you should use JBoss Tools extension. There are full instructions here: https://docs.jboss.org/author/display/AS7/Starting+JBoss+AS+from+Eclipse+with+JBoss+Tools
JBoss Tools will configure you
Upvotes: 2
Reputation: 2745
You should add the following dependency to your pom.xml file:
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>CHOOSE YOUR CORRECT VERSION HERE</version>
<scope>provided</scope>
</dependency>
Upvotes: 1