• Post Reply Bookmark Topic Watch Topic
  • New Topic

Simple Question.... Please Help

 
Angelo Watson
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Im using: Tomcat4, JDBC 3.0, Cloudview
I created a simple technical support form, that asks the common informations(firstName, lastName...) this is in my c:\Tomcat\webapps\test
directory.
The source code for this is:
<html>
<head>
<title>IT Department</title>
</head>
<body>
<h1>Technical Support Request</h1>
<hr><br>
<center>
<form action="/servlet/techSupport" method="post">
<table align=center width=100% cellspacing=2 cellpadding=2>
<tr>
<td align=right>First Name: </td>
<td><input type="text" name="firstName" align=left size=15></td>
<td align=right>Last Name: </td>
<td><input type="text" name="lastName" align=left size=15></td>
</tr>
<tr>
<td align=right>Email:</td>
<td><input type="text" name="email" align=left size=25></td>
<td align=right>Phone:</td>
<td><input type="text" name="phone" align=left size=15></td>
</tr>
<tr>
<td align=right>Software:</td>
<td>
<select name="software" size=1>
<option value="Word">Microsoft Word</option>
<option value="Excel">Microsoft Excel</option>
<option value="Access">Microsoft Access</option>
</select>
</td>
<td align=right>Operating Systems:</td>
<td>
<select name="os" size="1">
<option value="95">Windows 95</option>
<option value="98">Windows 98</option>
<option value="NT">Windows NT</option>
</select>
</td>
</tr>
</table>
<br>Problem Description
<br>
<textarea name="problem" cols=50 rows=4></textarea>
<hr><br>
<input type="submit" name="submit" value="Submit Request">
</form>
</center>
</body>
</html>
This my DD and its under c:\tomcat\webapps\test\WEB-INF directory.
The sourcecode is:
<?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>

<servlet>
<servlet-name>techSupport</servlet-name>
<servlet-class>TechSupportServlet</servlet-class>
<init-param>
<param-name>driver</param-name>
<param-value>com.ibm.db2j.jdbc.DB2jDriver</param-value>
</init-param>
<init-param>
<param-name>protocol</param-name>
<param-value>jdbc b2j</param-value>
</init-param>

</servlet>
</web-app>
Two of my classes are on c:\tomcat\webapps\test\WEB-INF\classes directory.
PROBLEM: When I access my html page, and hit submit, its saying that it cannot find the class file techSupport.
 
Simon Harvey
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I'm no master of this as I';m just getting started on servlets myself, but I dont think you necessarily servlet/servletname as the action to your forms.
I usually just have the name of the servlet (as long as they are at the same level in the directory tree.
I'm sure someone else will step in and help, but one thing you could try is just simplifying things as much as possible - scraping off all the bells and whistles and maybe just have a button that submits to the servlet. That way once you get it working, you can build upon that until you see the problem.
Hope that helps. Sorry if any of that was patronising. I'm not sure if you're just beginning like me
Good luck
 
Rene Larsen
Ranch Hand
Posts: 1179
Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try this post: http://www.coderanch.com/t/82144/Tomcat/Running-Simple-Servlets
Rene
 
Angelo Watson
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I created a table in cloudscape using JDBC3.0, created a servlet, html form, and the DD.
servlet - C:\tomcat\webapps\test\WEB-INF\classes
html - C:\tomcat\webapps\test
DD - C:\tomcat\webapps\test\WEB-INF
In the DD I named the servlet to Support and specified the right path and also gave its mapping and the url-pattern.
When I hit submit on the html form it gives an status error code 503
What should I do?
 
Rene Larsen
Ranch Hand
Posts: 1179
Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How do you call your servlet?
I think it should be like this: http://<HOST>:<PORT>/test/<SERVLET_NAME>
Show os your web.xml ;-)
Rene
[ November 24, 2002: Message edited by: Rene Larsen ]
 
Asher Tarnopolski
Ranch Hand
Posts: 260
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hey,
give us more info:
1. where do you place your servlets and your html file with the form?
2. where do you place you web.xml file.
the code looks ok, i guess there is some kind of
deployment mess.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!