Return-Path: Delivered-To: apmail-tomcat-users-archive@www.apache.org Received: (qmail 91611 invoked from network); 20 Feb 2006 22:24:12 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 20 Feb 2006 22:24:12 -0000 Received: (qmail 505 invoked by uid 500); 20 Feb 2006 22:23:59 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 490 invoked by uid 500); 20 Feb 2006 22:23:58 -0000 Mailing-List: contact users-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Users List" Delivered-To: mailing list users@tomcat.apache.org Received: (qmail 478 invoked by uid 99); 20 Feb 2006 22:23:58 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 20 Feb 2006 14:23:58 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: neutral (asf.osuosl.org: local policy) Received: from [206.123.111.90] (HELO mail.loukasmgmt.com) (206.123.111.90) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 20 Feb 2006 14:23:57 -0800 Received: (qmail 28569 invoked by uid 510); 20 Feb 2006 16:23:26 -0600 Received: from unknown (HELO ?10.220.0.85?) (fhanik@halosg.com@198.212.148.254) by mail.loukasmgmt.com with SMTP; 20 Feb 2006 16:23:26 -0600 Message-ID: <43FA4163.3040000@hanik.com> Date: Mon, 20 Feb 2006 16:23:31 -0600 From: Filip Hanik - Dev Lists User-Agent: Thunderbird 1.5 (Windows/20051201) MIME-Version: 1.0 To: Tomcat Users List Subject: Re: Fw: Servlet problem References: <018101c6366b$aef8f670$0602a8c0@MarksLaptop> In-Reply-To: <018101c6366b$aef8f670$0602a8c0@MarksLaptop> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N per your web.xml http://localhost:8080/WEB-INF/classes/SearchServlet?itemvalue=type+search+criteria+here should be http://localhost:8080/searchmatch.jsp?itemvalue=type+search+criteria+here Filip Mark Whitby wrote: > EDIT: I've sent this twice because the first one contained an error in what I wrote. Ignore the first one. > > Hi all, > > Apologies for the stupidity of this email but I'm having a few servlet problems. I've created the following SearchServlet.java file, compiled it into a class file using Netbeans then copied the class file into my WEB-XML/classes file. > > Now for testing the servlet is very limited but when I try to run the jsp page the page is redirected to http://localhost:8080/WEB-INF/classes/SearchServlet?itemvalue=type+search+criteria+here and not /searchnone.jsp as specified. When it's redirected to the first page though all I get is my error.jsp page which is set up to catch 404 error pages as defined in my web.xml page. So it isn't finding something, what I don't know though. > > Can anyone tell me where I'm going wrong? > > Mark > > searchitem.jsp: > > > > > >
>

Item Search Page

>

> Use this page to search through the different items that we stock. All searches are done by > > key words. If using multiple words please use a comma after every different word.. >

>

>

>
> >
>

>

> Return to the main search page >

>
> > SearchServlet.java > > import java.io.*; > import java.net.*; > > import javax.servlet.*; > import javax.servlet.http.*; > > public class SearchServlet extends HttpServlet { > > public void processRequest(HttpServletRequest request, HttpServletResponse response) > throws ServletException, IOException { > > String address = "/searchnone.jsp"; > > RequestDispatcher dispatcher = request.getRequestDispatcher(address); > dispatcher.forward(request, response); > } > > protected void doGet(HttpServletRequest request, HttpServletResponse response) > throws ServletException, IOException { > processRequest(request, response); > } > > void doPost(HttpServletRequest request, HttpServletResponse response) > throws ServletException, IOException { > processRequest(request, response); > } > > > public String getServletInfo() { > return "Short description"; > } > } > > web.xml > > > > "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN" > "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd"> > > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee > http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" > version="2.4"> > > > > /index.jsp > > > > > > 404 > /error.jsp > > > > > > DB Connection > jdbc/TestDB > javax.sql.DataSource > Container > > > > > SearchServlet > SearchServlet > > > SearchServlet > /searchmatch.jsp > > > SearchServlet > /searchmatch.jsp > > > > > > > > Secure Area > /secure/* > GET > POST > > > CONFIDENTIAL > > > > > > > --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org For additional commands, e-mail: users-help@tomcat.apache.org