Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 3 of 3

Thread: HTTP Status 404-The requested resource is not available.

  1. #1
    Junior Member
    Join Date
    Mar 2011
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default HTTP Status 404-The requested resource is not available.

    HTTP Status 404 - /s/

    type Status report

    message /s/

    description The requested resource (/s/) is not available.


    HTTP Status 404 - /host-manager/

    type Status report

    message /host-manager/

    description The requested resource (/host-manager/) is not available.

    This is where i got stuck..


  2. #2
    mmm.. coffee JavaPF's Avatar
    Join Date
    May 2008
    Location
    United Kingdom
    Posts
    3,336
    My Mood
    Mellow
    Thanks
    258
    Thanked 294 Times in 227 Posts
    Blog Entries
    4

    Default Re: HTTP Status 404-The requested resource is not available.

    ??!?! Is there a question associated with this?

    We need as much background information as possible in order to help you.
    Please use [highlight=Java] code [/highlight] tags when posting your code.
    Forum Tip: Add to peoples reputation by clicking the button on their useful posts.

  3. #3
    Junior Member
    Join Date
    Mar 2011
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: HTTP Status 404-The requested resource is not available.

    Quote Originally Posted by Petr View Post
    I think If you won't explain about your task, nobody can't help you. Do you have any code?
    Thnx for replying..



    heres code::


    AddEmpServlet::


    package com.servlets;

    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.*;

    public class AddEmpServlet extends HttpServlet
    {

    public void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException
    {

    res.setContentType("text/html");
    PrintWriter out=res.getWriter();

    String uname=req.getParameter("uname");
    String pass=req.getParameter("pass");

    out.println("<html><body>");
    out.println("<center> Mysite </center>");
    out.println("<a href='addEmp?uname="+uname+"'>AddEmp</a><br/>");
    out.println("Welcome: "+uname);
    out.println("<center><forn action='addEmp'>");
    out.println("Emp No:<input type=text name=emp no/>");
    out.println("<input type=submit value=AddEmp/>");
    out.println("</form></body></html>");
    }
    };



    LoginServlet::



    package com.servlets;

    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.*;

    public class LoginServlet extends HttpServlet
    {
    public void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException{
    String uname=req.getParameter("uname");
    String pass=req.getParameter("pass");

    System.out.println("uname" +uname);
    res.setContentType("text/html");

    PrintWriter out=res.getWriter();

    out.println("<html><body>");
    out.println("<center> Mysite </center>");
    out.println("<a href='addEmp?uname="+uname+"'>AddEmp</a><br/>");
    out.println("<a href='ViewEmp?uname="+uname+"'>ViewEmp</a>");
    out.println("Welcome: "+uname);
    out.println("</body></html>");
    }
    };


    xml::

    <web-app>
    <servlet>
    <servlet-name>LS</servlet-name>
    <servlet-class>com.servlets.LoginServlet</servlet-class>
    </servlet>

    <servlet>
    <servlet-name>AS</servlet-name>
    <servlet-class>com.servlets.AddEmpServlet</servlet-class>
    </servlet>

    <servlet-mapping>
    <servlet-name>LS</servlet-name>
    <url-pattern>/LoginServlet</url-pattern>
    </servlet-mapping>

    <servlet-mapping>
    <servlet-name>AS</servlet-name>
    <url-pattern>/AddEmpServlet</url-pattern>
    </servlet-mapping>
    </web-app>


    One login.html File::

    Dir Structure::




    │ AddEmpServlet.java
    │ Login.html
    │ LoginServlet.java

    └───WEB-INF
    │ web.xml

    └───Classes
    └───com
    └───servlets
    AddEmpServlet.class
    LoginServlet.class


    Got error when tried to access "http://localhost:8080/B/login.html"
    Last edited by DeViLhUnTeR; March 7th, 2011 at 01:32 PM.

Similar Threads

  1. HTTP Status 404
    By Star_pro in forum Java Servlet
    Replies: 0
    Last Post: February 28th, 2011, 02:17 PM
  2. Checking the Status of a checkbox
    By michaelz in forum Object Oriented Programming
    Replies: 16
    Last Post: August 9th, 2010, 06:44 AM
  3. HTTP Status 500 -
    By mqt in forum What's Wrong With My Code?
    Replies: 3
    Last Post: April 6th, 2010, 01:09 AM
  4. Replies: 2
    Last Post: August 4th, 2009, 11:25 PM
  5. Java Learning Resource for Beginners
    By Freaky Chris in forum The Cafe
    Replies: 1
    Last Post: April 29th, 2009, 04:57 AM