Solved

How to call servlet from jsp?

Posted on 2008-10-14
2
836 Views
Last Modified: 2013-11-24
Hi

I have a jsp page with a form

<form name="form" method="POST" action="Registration" onsubmit="return Validation();">

In web.xml
  <servlet>
    <servlet-name>Registratoin</servlet-name>
    <servlet-class>com.me.Registratoin</servlet-class>
  </servlet>

In servlet, I use public void doPost(HttpServletRequest request, HttpServletResponse response) to get the form data

However, when I click the submit button in jsp

it shows HTTP Status 404 error. The requested resource (/eshop/Registration) is not available.

How should I do it?


0
Comment
Question by:techques
  • 2
2 Comments
 
LVL 20

Expert Comment

by:chaitu chaitu
ID: 22717656
u need to do servlet mapping in web.xml
0
 
LVL 20

Accepted Solution

by:
chaitu chaitu earned 50 total points
ID: 22717663
<servlet>
    <servlet-name>Registratoin</servlet-name>
    <servlet-class>com.me.Registratoin</servlet-class>
  </servlet>
      
<servlet-mapping>
            <servlet-name>Registratoin</servlet-name>
            <url-pattern>/Registratoin</url-pattern>
      </servlet-mapping>
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
withoutTen challenge 14 100
changeXy challenge 13 67
base64 decode encode 12 122
why cannot we forward request once the response is committed 2 33
I had a project requirement for a displaying a user workbench .This workbench would consist multiple data grids .In each grid the user will be able to see a large number of data. These data grids should allow the user to 1. Sort 2. Export the …
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
The viewer will learn how to implement Singleton Design Pattern in Java.
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now