File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Servlet in JBoss 7

 
Jim Pouwels
Ranch Hand
Posts: 61
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Guys,

I'm trying to get a simple servlet working in JBoss 7.

First, i got my servlet:



The CDI bean is just a simple POJO with one method (getGreeting()).

The problem is the web.xml in my war file. When I include one, the servlet is not available.

web.xml:



When I remove the web.xml from the WAR file, then the servlet becomes available.

Anyone encountered this issue?

Grtz,
Jim
 
Jaikiran Pai
Marshal
Pie
Posts: 10444
227
IntelliJ IDE Ubuntu
  • 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">


The presence of that dtd version for your web application indicates that you will be using 2.3 version of web-app which doesn't support annotation based servlets (or other web components). So you'll have to change that web.xml to instead use the latest version:

 
Jim Pouwels
Ranch Hand
Posts: 61
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That fixed the problem. Tnx!
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic