Cannot find the servlet--can anyone pls help
Hi,
I am trying to run an example servlet the code is as follows:
Example.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<Title>Example</Title>
</HEAD>
<BODY>
<form action="\example\classes.ShowParameters" method="post">
Name: <input type="textbox" size="10">
Number:<input type="textbox" size="10">
<input type="submit" value="submit">
</form>
</BODY>
</HTML>
ShowParameters.java
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
import java.util.*;
public class ShowParameters extends HttpServlet {
public void doGet(HttpServletRequest request,
HttpServletResponse response)
throws ServletException, IOException {
response.setContentType("text/html");
PrintWriter out = response.getWriter();
out.println( "<BODY BGCOLOR=\"#FDF5E6\">\n" +
"<H1 ALIGN=CENTER>" + "</H1>\n" +
"<TABLE BORDER=1 ALIGN=CENTER>\n" +
"<TR BGCOLOR=\"#FFAD00\">\n" +
"<TH>Parameter Name<TH>Parameter Value(s)");
Enumeration paramNames = request.getParameterNames();
while(paramNames.hasMoreElements()) {
String paramName = (String)paramNames.nextElement();
out.println("<TR><TD>" + paramName + "\n<TD>");
String[] paramValues = request.getParameterValues(paramName);
if (paramValues.length == 1) {
String paramValue = paramValues[0];
if (paramValue.length() == 0)
out.print("<I>No Value</I>");
else
out.print(paramValue);
} else {
out.println("<UL>");
for(int i=0; i<paramValues.length; i++) {
out.println("><LI>" + paramValues);
out.println("</UL>");
out.println("</TABLE>\n</BODY></HTML>");
public void doPost(HttpServletRequest request,
HttpServletResponse response)
throws ServletException, IOException {
doGet(request, response);
example.xml
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<display-name>Welcome </display-name>
<description>
Welcome to Pc Tune Up
</description>
<servlet>
<servlet-name>example.ShowParameters</servlet-name>
<servlet-class>example.ShowParameters</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>example.ShowParameters</servlet-name>
<url-pattern>/Example.html</url-pattern>
</servlet-mapping>
</web-app>
and the servlet is sucessfully compiled..
and i put the classes in the ROOT directory..
The structure is as follows:
C:\Program Files\Apache Software Foundation\Tomcat 5.0\webapps\ROOT\WEB-INF\classes\example\ShowParameters.class
and also the java files in the same folder
and i created the jar file and placed it in the lib folder of ROOT.
but when i am trying to run the html file and submit the form it says HTTP:404 FILE NOT FOUND ERROR..
Can anyone please help me where i am going wrong....
Thanks & Regards
Lavanya
[<form action="\example\classes.ShowParameters" method="post">[
this is wrong
change it to
<form action="/Example.html" method="post">
beacause you have specified
<url-pattern>/Example.html</url-pattern>
this is how you map a request to a servlet
its better if you chage it like this
<form action="/Example." method="post">
In web.xml
<url-pattern>/Example</url-pattern>
Similar Messages
-
i can't get the scanner samsung SCK-4521F in spite of installing driver, can anyone pls help?
also see
https://igppwiki.ucsd.edu/groups/publichelpwiki/wiki/a96db/Scanning_Within_Mac_O SX.html
seems an awful long time for samsung not to have prodeced scanner software . -
Hi.Since I upgraded to Maverick my scanner which is Fuji Xerox Docuprint CM205 fw could not be used for scanning as mac wouldn't find the scanner.Can anyone help please?
There's an alternative ...
Using Image Capture as a scanner:
Connect the scanner to your Mac whether Wi-Fi or USB.
Launch Image Capture.
Click the very small black box bottom right side of the Image Capture window.
You'll see this pop up menu: Connecting this (device) opens:
You can select a default app to scan (Image Capture) and select a folder from the Imort To pop up menu on the right to save scanned files to. -
How do I update my iPad 2 to iOS 5, I tried going to settings,general ,software update but I can't seem to find the software update button pls help :)
Go to Settings > General > About and see what iOS version you are running. If it is lower than 5, you won't find the software update button. It was added when iOS 5 came out. The current iOS is 5.1.1. To update to the current OS, you'll need to connect to the computer you sync with (this is important - do not connect to a computer you do not sync with as you will lose you apps) and update the software in iTunes. Once you have updated to the 5.1.1, the software update button will be in Settings going forward. Make sure you have a lot of time. Updating from below 5 to 5 or higher is a somewhat lengthy process.
This link will provide the guidance you need:
http://www.macworld.com/article/1162925/how_to_upgrade_your_ios_device_to_ios_5. html -
i purchased an iPod touch few months back. And i am very upset with the volume output it produces. iPod being an music player, has poor volume quality then my iPhone 3gs. Can anyone pls help. How do i rectify it?
Problem with both the speaker and earphones?
Have you tried another pair of headphones?
Yu can try the standard fixes to rule out a software problem:
- Reset. nothing is lost.
Reset iPod touch: Hold down the On/Off button and the Home button at the same time for at
least ten seconds, until the Apple logo appears.
- Restore from backup
- Restore to factory defaults/new iPod. -
So whenever I try to download the newest itunes file it won't let me finish the install process because I'm missing the "Itunes.msi" file whatever that is and I've done some searches but I cannot find the file. Anyone know what to do?
you can try this thread maybe? https://discussions.apple.com/message/16217061#16217061
-
I update my iPad mini retina with iOS 7.1 resulting in not being to down load NOR OPEN PPT, WORD files using iWork, page, can anyone pls help?
You want to just use Dropbox until the dust settles. To use it from iWork for iOS (assuming you have the Dropbox app installed on your device), open the document in Keynote (for example), tap the share icon (box with upward pointing arrow), choose Open in Another App, choose Keynote as your format, then choose Open in Dropbox and you will get an option to save it to your Dropbox account. To open it from Dropbox in iWork for iOS, open the document in the Dropbox app, tap the share icon, tap Open in Keynote (for example). It's a bit clunky, but works.
-
My Imac is ejecting every disk inserted in it, I cannot access the disks, can any body help me troubleshoot the problem. I am using snow leopard.
Try resetting the SMC Intel-based Macs: Resetting the System Management Controller (SMC) - Apple Support
and PRAM How to Reset NVRAM on your Mac - Apple Support
If those don't help you can try a cleaning disc or a quick shot of compressed air. Chances are that your drive has failed, join the club it's not all that uncommon. You can either have it replaced or purchase an inexpensive external drive. Don't buy the cute little Apple USB Superdrive, it won't work on macs with internal drives working or not. -
My Imac is ejecting every disk inserted in it, I cannot access the disks, can any body help me troubleshoot the problem
The frist thing to try is a drive-n disk. They are cheap (US$5-15) and easy to use. Many unresponsive drives, even ones declared "dead" by an Apple tech, have returned to service after a cleaning.
Check with home entertainment specialty shops, electronic superstores and office supply outlets that sell computer accessories. -
After I have been talking on my iPhone 6 for awhile and then want to go to speaker phone, I cannot find the speaker icon. Any help?
Here's the situation. I received a text while I was talking on the phone. Went right to text, then could not get back to the screen. After trial and error, I discovered a little green message at the top of the phone that said "Touch to return to call". Problem solved.
-
Can anyone pls. help me : facing problem while fetching the data from BAPI
Hi all,
we have installed xMII in a new server. In this new server I am trying to fetch data from a BAPI & write it into a file thru a transaction, but i cant see the data in the tracer, & neither is the file created. But with the same configuration & connection am able to get the data in the old server. Can anyone pls. tell me wat could be the problem?? or is there anything else that we might have forgotten while installing xMII in the new server.
ur help would be greatly appreciated.
Thanks,
Sushma.Hi Ravi,
no am not able to see the table structure also. This is what it is showing in the tracer :
[INFO ]: Execution Started At: 17:24:17
[DEBUG]: 00000.03100 Begin Transaction 'TMP99A51958-5BAE-CDE0-0DB5-A3A8C72BC297'
[DEBUG]: 00000.03100 Begin Sequence Sequence : ()
[DEBUG]: 00000.03100 Begin Action SAPJCOInterface_0 : (SAP JCO Interface)
[DEBUG]: 00006.43700 Connection Took 6406 mS
[DEBUG]: 00009.82800 Function Creation Took 3391 mS
[DEBUG]: 00010.25000 Execution Took 422 mS
[DEBUG]: 00010.25000 End Action SAPJCOInterface_0 : (SAP JCO Interface)
[DEBUG]: 00010.25000 Begin Sequence Sequence_0 : ()
[DEBUG]: 00010.25000 Begin Action Repeater_0 : (Repeater)
[DEBUG]: 00010.26600 End Action Repeater_0 : (Repeater)
[DEBUG]: 00010.26600 End Sequence Sequence_0 : ()
[DEBUG]: 00010.26600 End Sequence Sequence : ()
[DEBUG]: 00010.26600 End Transaction 'TMP99A51958-5BAE-CDE0-0DB5-A3A8C72BC297'
[INFO ]: Execution Completed At: 17:24:28 Elapsed Time was 10235 mS
I doubt the repeater is not working, becoz i checked the JCO connection & thats fine..
Thanks,
Sushma. -
Can anyone please help guide me in the right direction to finish reactivating my phone?
Connect it to your computer via the supplied sync cable and restore.
-
For the last month or so my icloud won't back up, it keeps telling me that there is too much storage and I need to delete some data. But I have deleted between 3-400 photos and it is still saying the same, can anyone please help
If they were deleted from your camera roll that should have resulted in a corresponding decrease in the estimated size of your next backup.
If it's still saying that you don't have enough storage to back up, read through this article: http://support.apple.com/kb/ht4847. It provides some suggestions for reducing your iCloud storage, such as deleting unneeded email.
The other area to look at is your text messages. These are included in the backup. If you have lots of photos and videos attached to your messages, that can significantly increase the size of your backup. If that's the case, deleting these may make a big difference. -
Hello
Can anyone assist me with installing ios7 on my ipad2 please ?laleh08 wrote:
Hello
Error message is "unable to install update " "an error occurred during installing IOS7 "'
Can you assst ?
Ooof... I hate those super-generic messages. If I were in your shoes, I'd start all over again with a new download. My WAG is that your first download was corrupted. -
"Undo" button appears on iPad 3 screen's keyboard by tapping "?123" button. But I can't find the ""undo" on the iPod Touch keyboard. The Delete button is such an over eager little thing, I've lost the chart I was working on. Fiendish!
(Shaking it does not work. I read in another forum that this is the answer. Am I shaking it wrong?)
Maybe you are looking for
-
ATG Endeca CRS Integration baseline_update.bat fails
Hi, I have deployed the CRS through cim.bat and after that I am trying to run the following scripts and fails with the below errors. I am able to deploy the dicsover application that comes with the Endeca. Here are the steps I am trying to do after d
-
How to delete the Initialization records in 2LIS_03_BX
BW3.5 - R/3 4.6c - LO-Cockpit - SCM Implementation - Inventory Management 0IC_C04 InfoCube. I wanted to use 2LIS_03_BX and RSA3 was showing zero records. I ran MCNB to collect records for this extract and it collected 815000 stock records. When I che
-
I dusted off the old Blueberry clamshell, put some more memory in it, and got ready to install 10.3.5 from a gray&white installation disk, which I used on my Pismo. But - the disk is a DVD, and my old iBook has a CD drive ! I don't suppose I can Carb
-
Itunes needs to be updated to sync but ipad is disabled
My son tried the passcode too many times & disabled my daughters IPad. I plug it in to sync with ITunes it tells me iPad can not be used because it requires iTunes 11.1 or greater. Is there other way to get iTunes to recognize it so we dont have to r
-
I have couple of oracle tables and want to take data from these tables and build a flatfile and put it on filesystem . Is there a way to build a flatfile using DataBase Adapter in BPEL. Any help is appreciated. Thanks.