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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T00:58:25+00:00 2026-06-13T00:58:25+00:00

I have the following problem when trying to use the login.jsp I have the

  • 0

I have the following problem when trying to use the login.jsp
I have the following code in the login

<%@ include file="/jsp/include.jsp"%>

<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<script>
    function sendForm() {
        document.formLogin.submit();
    }
</script>

<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Example :: Spring Application</title>
</head>
<body>

    <div class="container">
        <form class="bs-docs-example form-horizontal"
            action="ServletValidation" name="formLogin" id="formLogin"
            method="post">

            <legend>Login</legend>
            <div class="control-group">
                <label for="inputUsername" class="control-label">Email</label>

                <div class="controls">
                    <input type="text" id="inputUsername">
                </div>
            </div>
            <div class="control-group">
                <label for="inputPassword" class="control-label">Password</label>
                <div class="controls">
                    <input type="password" id="inputPassword">
                </div>
            </div>
            <div class="control-group">
                <div class="controls">
                    <label class="checkbox"> <input type="checkbox">
                        Remember me
                    </label>
                    <button class="btn" type="submit" action="sendForm();">Sign
                        in</button>
                </div>
            </div>
        </form>
    </div>

</body>
</html>

And the following text in the web.xml

  <servlet>
    <description></description>
    <display-name>ValidationServlet</display-name>
    <servlet-name>ValidationServlet</servlet-name>
    <servlet-class>bt.servlet.ValidationServlet</servlet-class>
  </servlet>
  <servlet-mapping>
    <servlet-name>ValidationServlet</servlet-name>
    <url-pattern>/ValidationServlet</url-pattern>
  </servlet-mapping>

But once I click the button for submit it returns:

State HTTP 404 – /bt/jsp/ServletValidation

Description The resource required (/bt/jsp/ServletValidation) is not
available.

The folder structure is the following:

+bt
    -src
    -WebContent
         -jsp
         -resources
         -WEB-INF
            -classes
            *web.xml
         *index.jsp

The problem I’m finding is why is it sending to that URL

  • 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-13T00:58:26+00:00Added an answer on June 13, 2026 at 12:58 am

    There are two problems:

    • Your servlet maps to the URL /ValidationServlet and your form has the action set to ServletValidation.

    • Maybe your login.jsp isn’t at the same level of your servlet mapping.

    The best solution would be setting the action of your form to map the full URL that maps to your servlet. This can be achieved using Request#getContextPath():

    <form action="${request.contextPath}/ValidationServlet" ...>
        <!-- content... -->
    </form>
    

    If you don’t use JSTL in your project, then do it. You should avoid scriptlets in your jsp (those <% ... %> tags that hold nasty Java code inside the JSP). But if you don’t, then you should try the following:

    <form action="<%=request.getContextPath()%>/ValidationServlet" ...>
        <!-- content... -->
    </form>
    

    Still, the first way is the best to go.

    More info:

    • How to avoid Java Code in JSP-Files?
    • Our JSTL wiki page
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Trying to use JSTL but have the following problem: Index.xhtml page: <?xml version=1.0 encoding=UTF-8?>
I have the following code, The problem is when I'm trying to assign the
I have the following problem, I'm trying to use FluentValidation in Windows Phone to
I'm a newbie in bash scripts and have the following problem : I'm trying
I am trying to solve the following problem with Puppet: I have multiple nodes.
I'm trying to solve the following problem in Redis. I have a list that
I am trying to solve the following problem. Lets say you have the the
I have a bit of a problem. I am trying to do the following
I have this problem with my code, iam trying to upload an image to
all, I have some problem installing my apk file in code. Wondering if anyone

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.