tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mark Whitby" <ug82...@cs.bham.ac.uk>
Subject Re: Fw: Servlet problem
Date Mon, 20 Feb 2006 23:04:24 GMT
There is a problem with this though.  I start off with searchitem.jsp OR 
searchmatch.jsp.  I want to end up at itemlist.jsp, matchlist.jsp or 
searchnone.jsp depending on what's said below.

When I click the button (which appears on both searchitem.jsp AND 
searchmatch.jsp albeit with slightly different parameters) the servlet will 
eventually (when I've coded it fully) do a search of the database to find 
items based on the search parameters.  If nothing is found then it redirects 
the user to searchnone.jsp.  If an item or more than one item is found then 
the page will redirect to itemlist.jsp or matchlist.jsp depending on whether 
the command has come from searchitem.jsp or searchmatch.jsp.  How is best to 
do this then based on what I've said?

I have the mapping twice yes, once for searchitem.jsp and once for 
searchmatch.jsp, which both use the same servlet - SearchServlet.  Is there 
any wy map both pages in one go?

Mark

----- Original Message ----- 
From: "Caldarale, Charles R" <Chuck.Caldarale@unisys.com>
To: "Tomcat Users List" <users@tomcat.apache.org>
Sent: Monday, February 20, 2006 10:36 PM
Subject: RE: Fw: Servlet problem


> From: Mark Whitby [mailto:ug82msw@cs.bham.ac.uk]
> Subject: Re: Fw: Servlet problem
>
> Yeah but that's not what I want to happen.  I want the
> servlet to redirect the user to searchnone.jsp as per
> the servlet code and not to the servlet itself, if that
> makes sense?

The ACTION parameter in a form specifies a URL, not a file system path.
Try replacing "WEB-INF/classes/SearchServlet" with "/searchmatch.jsp"
(not sure about the leading slash).

By the way, you have your servlet mapping specified twice.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message