servlet example on the eclipse juno with jboss 6.1

Hi,

I am trying below servlet example on the eclipse juno with jboss 6.1 on my local vista 32 bit laptop.
http://sanjaal.com/java/tag/jboss-servlet-tutorial-for-eclipse/

I followed all the steps.

When i ran the servlet nothing is happening. I checked the console, server log at C:\software\jboss-as-distribution-6.1.0.Final\jboss-6.1.0.Final\server\default\log


but no useful information there as well.

Do i really need to create EAR for this simple servlet example. I wonder why the servlet is not running.

My code looks as below


package com.myproj;

import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * Servlet implementation class MyTestServlet
 */
@WebServlet("/MyTestServlet")
public class MyTestServlet extends HttpServlet {
      private static final long serialVersionUID = 1L;
       
    /**
     * @see HttpServlet#HttpServlet()
     */
    public MyTestServlet() {
        super();
        // TODO Auto-generated constructor stub
    }

      /**
       * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
       */
      protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
            // TODO Auto-generated method stub
      }

      /**
       * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
       */
      protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
            // TODO Auto-generated method stub
      }

}





web.xml is

<?xml version="1.0" encoding="ISO-8859-1"?>
<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
    version="2.4">

    <servlet>
        <servlet-name>MyTestServlet</servlet-name>
        <servlet-class>com.myproj.MyTestServlet</servlet-class>
    </servlet>

    <servlet-mapping>
        <servlet-name>MyTestServlet</servlet-name>
        <url-pattern>/MyTestServlet</url-pattern>
    </servlet-mapping>


</web-app>



Do i need the web.xml file.

samething happening when i tried few other examples from internet.
Please advise. Any ideas, sample code, resources highly appreciated. Thanks in advance.
ServEx.jpg
LVL 7
gudii9Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

girionisCommented:
Do i need the web.xml file.

Yes.

How do you deploy your servlet?
0
gudii9Author Commented:
dynamic web application 3.0 (ie servlet 3) onwards we can do with annotation as well right?. I think i choose dynamic web application 3.0 instead should i try with dynamic web application 2.5. please advise
0
girionisCommented:
dynamic web application 3.0 (ie servlet 3) onwards we can do with annotation as well right?

Yes, this is right. If you use 3.0 you can use annotations, it will work the same.
0
JavaScript Best Practices

Save hours in development time and avoid common mistakes by learning the best practices to use for JavaScript.

gudii9Author Commented:
On tomcat you do not have this kind of separate XML file similar to jboss righ. any simple example end to end or video on this. Please advise
0
girionisCommented:
No, because Tomcat is considered to be the reference implementation of the servlets/JSP specification. Any application on Tomcat will work without changes on any other server as well (the opposite is not true). I do not have any specific links but if you do a search on google you will find tons of information.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
gudii9Author Commented:
vista 32 bit laptop has some issue with jboss installation. It is working perfect on other windows7 with 64 bit laptop
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Java EE

From novice to tech pro — start learning today.