Results 1 to 4 of 4

Thread: Calling Servlet from HTML

  1. #1
    Join Date
    Jul 2009
    Posts
    127

    Calling Servlet from HTML

    Hello
    I am a newbie to java. I am trying to call servlet from html. It's not quite getting it right. Each time I run the program, error message saying servlet not available is displayed (The request resource not available). I use netbeans IDE to run java programs. Can any one help to solve the problem.

  2. #2
    Join Date
    May 2008
    Posts
    2,297

    Re: Calling Servlet from HTML

    You are using netbeans, netbeans automatically register your servlet with web.xml. Go to your project in netbeans project>web>web-inf>web.xml and check in the web.xml that servlet is registered or not. Check weather the deployement descriptor for servlet is mapped correctly or not. Without registering you servlet in web.xml you can't call servlets from HTML. If you have any more problems do post back.

  3. #3
    Join Date
    Jul 2009
    Posts
    127

    Re: Calling Servlet from HTML

    Thanks for your advice.
    I have checked my project in netbeans, the servlet is successfully registered in the web.xml file. The problem continues, still I can't call servlet from html. Do you have any more suggestions to solve the problem. I can't move further still solving this problem. Plz help

  4. #4
    Join Date
    May 2008
    Posts
    2,297

    Re: Calling Servlet from HTML

    If you have an older version of netbeans, plz upgrade to the newer one. Please check the deployment descriptor file web.xml
    Code:
    <servlet>
    <servlet-name>ABC</servlet-name>
    <servlet-class>urServletClassTypehere</servlet-class>
    </servlet>
    
    <servlet-mapping>
    <servlet-name>ABC</servlet-name>
    <url-pattern>/hurl</url-pattern>
    </servlet-mapping>
    Hopefully this may help you.

Similar Threads

  1. Declaring interface in a Servlet
    By Kratos G in forum Software Development
    Replies: 3
    Last Post: 05-02-2011, 09:06 AM
  2. JSP and Servlet problem
    By Devabrata in forum Software Development
    Replies: 5
    Last Post: 21-07-2010, 12:12 AM
  3. Logging a Message in a Servlet
    By D_chapple in forum Software Development
    Replies: 5
    Last Post: 20-02-2010, 09:21 PM
  4. Difference between Servlet & ASP
    By Owen Fernandes in forum Software Development
    Replies: 5
    Last Post: 05-02-2010, 10:53 AM
  5. What is Servlet container?
    By Sonam Goenka in forum Software Development
    Replies: 5
    Last Post: 05-02-2010, 08:13 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,936,268.22143 seconds with 16 queries