Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8404667
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T22:39:25+00:00 2026-06-09T22:39:25+00:00

Following my previous post here , I’ve removed all my source files into a

  • 0

Following my previous post here, I’ve removed all my source files into a package called model , and now the project refuses to load while executing http://localhost:8080/MyFirstServlet.

I suspect the culprit is web.xml , here’s the file :

web.xml:

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">
  <display-name>MyFirstServlet</display-name>
  <welcome-file-list>
    <welcome-file>index.html</welcome-file>
    <welcome-file>index.htm</welcome-file>
    <welcome-file>index.jsp</welcome-file>
    <welcome-file>default.html</welcome-file>
    <welcome-file>default.htm</welcome-file>
    <welcome-file>default.jsp</welcome-file>
  </welcome-file-list>

  <servlet>
   <description></description>
   <display-name>LoginServlet</display-name>
   <servlet-name>LoginServlet</servlet-name>
   <servlet-class>model.LoginServlet</servlet-class>
 </servlet>


  <servlet-mapping>
    <servlet-name>LoginServlet</servlet-name>
    <url-pattern>/model/LoginServlet</url-pattern>
  </servlet-mapping>
</web-app>

  [1]: https://stackoverflow.com/questions/11282231/jsp-page-wont-move-the-another-page-after-user-enters-the-input/11283006#11283006

this is index.jsp:

<%@ page language="java" contentType="text/html; charset=windows-1255"
    pageEncoding="windows-1255"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1255">
<title>Insert title here</title>
</head>
<body>
<form action="model/LoginServlet" method="POST">
        First Name: <input type="text" name="firstName" size="20"><br>
        Last Name: <input type="text" name="lastName" size="20">
        <br><br>
        <input type="submit" value="Submit">
</form> 

</body>
</html>

This is the hierarchy of the project :

hierarchy

When I execute http://localhost:8080/MyFirstServlet and reach here :

enter image description here

I enter first and second into the text fields and then get this :

enter image description here

I’ve tried to fix it but nothing did , so I’d appreciate any advice , thanks 🙂

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T22:39:27+00:00Added an answer on June 9, 2026 at 10:39 pm

    You form action should be

    <form action="model/LoginServlet" />
    

    and your Login servlet should define the package correctly.

    package model;
    

    Also your web.xml must declare this servlet class through fully qualified name

    model.LoginServlet
    

    Your servlet must extend HttpServlet.

    If you make sure that all of the above are in place correctly and it still doesn’t work. Then, You may need to check your build path settings in eclipse for this project.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Following up on my previous post Link here , the other challenge we are
Related to my previous post here , I have the following SELECT : SELECT
in my previous post I was asking how to generate numbers following a normal
This question is in continuation to my previous post located here . Since there
In a previous post ( Don't show this if the url contains the following
Following on from a previous post , I'm trying to update a database field
Based on my previous post, I came up with the following code. I'm sure
Following on from a previous question, ( previous question here ), the problem I'm
Since my previous post was closed, but the problem remains, I'll rephrase it here.
Related to my previous post but its not a duplicate of that.Now I have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.