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 9171181
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T16:07:41+00:00 2026-06-17T16:07:41+00:00

when I try I submit my form to be handled by the servlet the

  • 0

when I try I submit my form to be handled by the servlet the browser indicates that the requested resource is not available with a HTTP 404 error. The URL looks like:

http://localhost:8080/Website/DateSearchServlet

My XML file:

<?xml version="1.0" encoding="UTF-8"?>
<web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
<servlet>
    <servlet-name>DateSearchServlet</servlet-name>
    <servlet-class>DB.DateSearchServlet</servlet-class>
</servlet>
<servlet-mapping>
    <servlet-name>DateSearchServlet</servlet-name>
    <url-pattern>/Search/*</url-pattern>
</servlet-mapping>
<session-config>
    <session-timeout>
        30
    </session-timeout>
</session-config>

To call the servlet i am using this simple form:

<form name="dateSearch" action="DateSearchServlet" method="post">
    <label for="from">Date From</label>
    <input type="text" id="from" name="from" />
    <label for="to">Date To</label>
    <input type="text" id="to" name="to" />
    <input type="submit" id="submit" value="Submit">
</form>

And finally this is the servlet:

@WebServlet(name = "DateSearchServlet", urlPatterns = {"/Search"})
public class DateSearchServlet extends HttpServlet {

DatabaseConnector dataManager;
boolean dbOK = false;
HomeList homes = new HomeList();

@Override
public void init() {
    dataManager = new DatabaseConnector();
}

@Override
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

    String dateFrom = request.getParameter("from");
    String dateTo = request.getParameter("to");

    if (dateFrom == null || dateTo == null) {
        dbOK = false;
    } else {
        dbOK = true;
    }//end if

    request.setAttribute("homeList", null);

    if (dbOK) {
        homes = dataManager.getPropertiesSearch(dateFrom, dateTo);
        request.setAttribute("homeList", homes);
        request.getRequestDispatcher("bookings.jsp").forward(request, response);
    } else {
        System.out.println("DBNOTOK");
        //error...
    }
}
}

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-17T16:07:42+00:00Added an answer on June 17, 2026 at 4:07 pm

    The URL pattern in the web.xml is not configured properly for the servlet you are calling.

    So, change the action in the form to the URL Search/DateSearchServlet

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

Sidebar

Related Questions

How can I submit jQuery form object (not ajax)? I try form.submit() and it
I am getting a conversion error every time I try to submit a date
try: html = urlopen('http://glbse.com/api/asset/' + asset.name) except: print 'error while updating the price of
I have a form and I try to submit it but nothing happens. I
I'm trying to fill out and submit a form using Python, but I'm not
The error is at location http://127.0.0.1:8000/fileupload/form.py I have version 1.3 of django. I have
In the form below, I change the action attribute and submit the form. That
I'm trying to use jquery to submit my form like so but it's not
When I try to submit my app on the App Store through Xcode I
I would like to display an ajax loader icon when user try to submit

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.