RE: Servlet testing tools

2003-09-15 Thread Hookom, Jacob
Cactus project from Jakarta, and then there's HTML Unit that might appeal to
you more.

-Original Message-
From: Darryl L. Pierce [mailto:[EMAIL PROTECTED] 
Sent: Monday, September 15, 2003 8:29 AM
To: Tomcat Users List
Subject: Servlet testing tools

I'm looking for a tool to use for stress testing a servlet. It should 
let me:

1. define the URL for connecting to my servlet
2. specify the content and type for an HTTP POST to the servlet
3. collect success/failure metrics for the connections
4. spit out a report for 3 above

Any suggestions?

-- 
Darryl L. Pierce [EMAIL PROTECTED]
Visit the Infobahn Offramp - http://bellsouthpwp.net/m/c/mcpierce
What do you care what other people think, Mr. Feynman?



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



META-INF - JNDI Datasource resolution

2003-09-10 Thread Hookom, Jacob
Currently, we are having some issues with hot deploying wars from ant tasks
and relying on our context being specified in the META-INF folder.

We are getting a connection = 'null' when a war is used, but if we expand
the war, using the same context, into a folder, then it works fine.

From what we can tell, Tomcat is using DBCP (as specified) in instantiating
a DataSource, but all of the ResourceParams are being set possibly?

As to the reason why the context doesn't load the connection from a war, but
does do it from an expanded directory from a war?

Thanks!
Jacob



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Memory leaks?

2003-09-04 Thread Hookom, Jacob
But depending on the DB, it can cause problems from the DB with too many
open ResultSets... I had an issue with performance testing where everything
but ResultSets were being closed and the Oracle DB started throwing errors
after about 500 queries.  Better safe than sorry.

-Original Message-
From: Greg Ward [mailto:[EMAIL PROTECTED] 
Sent: Thursday, September 04, 2003 9:05 AM
To: Tomcat Users List; [EMAIL PROTECTED]
Subject: Re: Memory leaks?

On 03 September 2003, Jim Lynch said:
 OK, that's probably what's going on.  I know I should close Statements
 and Connections and do normally but I'm fairly certain I've some out
 there dangling.  I didn't know you had to close ResultSets, however. 
 Glad to know that.

You don't have to close ResultSets -- check the JDBC docs:

  http://java.sun.com/j2se/1.4.2/docs/api/java/sql/Statement.html#close()

(Closing a Statement also closes any open ResultSets associated with
that Statement.)

Greg

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Which is the best way to install an application with connecti on p ooling

2003-09-03 Thread Hookom, Jacob
I'm trying to accomplish a similar thing with an AS/400 db over JNDI.

I have my context setup in my meta-inf and from stack traces; I see that
DBCP is the one launching the error, so I know that the context binding is
loading successfully.

The problem is that DBCP is throwing and exception that the driver specified
is null, I have the jar located in the webapp's lib, the shared/lib and the
server/lib... which lib directory should contain the driver so that the
context can see it?

Note:  I'm deploying via Ant by pointing at a war file in my project.

Many Thanks!

Jacob Hookom
McKesson Medical-Surgical

-Original Message-
From: John Turner [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, September 03, 2003 10:32 AM
To: Tomcat Users List
Subject: Re: Which is the best way to install an application with connecti
on p ooling


If you are using a WAR file, put your entire Context block into a file 
called (your-webapp).xml and stick it in META-INF.  Whatever is legal in 
a Context block in server.xml is also legal there.  Then you can deploy 
the WAR file using the manager app froma  remote system.

The admin and manager apps themselves do the same thing, check out 
admin.xml etc in the default distribution.

John

Kevin Passey wrote:

 John,
 
 I can easily deploy a basic app using the manager. But when it comes to
 deploying something that needs additional Context information I come
 un-stuck.
 
 I basically have an app that I want to connect to an AS/400 database using
 connection pooling.
 
 The only way I can get it to work is to manually insert the entries in the
 server XML file and then re-start.
 
 Any other pointer greatly appreciated.
 
 Regards
 
 Kevin
 
 
 -Original Message-
 From: John Turner [mailto:[EMAIL PROTECTED]
 Sent: 02 September 2003 13:45
 To: Tomcat Users List
 Subject: Re: Which is the best way to install an application with
 connection p ooling
 
 
 
 There are a number of ways.
 
 If autoDeploy = true then you can just drop the WAR file in the Host's 
 appBase directory.
 
 You can also use the manager app's various tasks (install, deploy, etc):
 
 http://jakarta.apache.org/tomcat/tomcat-4.1-doc/manager-howto.html
 
 This is easily accomplished with ant.
 
 John
 
 Kevin Passey wrote:
 
 
I have normally stopped the server - edited the server XML file, put my
 
 war
 
file in the webapps folder and re-started tomcat.

Using the manager app - is there a way I can do this 1)from a remote
 
 system
 
and 2)without manually editing the server XML file.

I've have tried putting the jndi info using the admin console but I keep
getting NULL driver exceptions.

Thanks

Kevin

 
 
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



War Development w/ JNDI Datasources

2003-08-18 Thread Hookom, Jacob
Hi All,

We are currently developing an application and using CVS to manage our
source code.  Our goal is to be able to pull down the project off of CVS and
with a single Ant target, get the application up and running on a local
install of Tomcat.

The problem that has risen is that our DataSources are specified in JNDI
(the server.xml in the {CATALINA_HOME}/conf) and is not something that we
can feasibly park in CVS.

Is there a way to get the DataSources specified without modifying the
server.xml? Or, should we be making an ANT target that loads a second
instance of tomcat using a project specific server.xml, much like what
Cactus describes?

Many Thanks,
Jacob

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: I have a problem!!!

2003-08-18 Thread Hookom, Jacob
There are a couple of books out there from Macromedia on application
development with Flash MX.  Most of the integration that can occur with J2EE
is via RPC with SOAP/Web Services.  It's VERY new and so I would recommend
finding a book from Macromedia on it.

-Jacob

-Original Message-
From: Jean-Francois Arcand [mailto:[EMAIL PROTECTED] 
Sent: Monday, August 18, 2003 9:01 AM
To: Tomcat Users List
Subject: Re: I have a problem!!!

Send an email to [EMAIL PROTECTED]

-- Jeanfrancois

RobDel wrote:

Good morning,

I need know if can use tomcat to inegration between Java e Flash using
Flash Remoting MX with JavaBean.
Sorry by my english, but i am brazilian.

Bye
Robson Del Angelo

  



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: UserDatabase implementations

2003-08-18 Thread Hookom, Jacob
The documentation on Tomcat's web site describes how to do this:

http://jakarta.apache.org/tomcat/tomcat-4.1-doc/realm-howto.html

In my experience, the authentication provided here is very simple where the
only assumption is that there is a username (principal) and that username
has a list of roles defined as strings.

For application development, the user object has many more properties than
just a name and a set of roles.  Therefore, login operations are handled by
your own code.

-Jacob

-Original Message-
From: Bill Schneider [mailto:[EMAIL PROTECTED] 
Sent: Monday, August 18, 2003 9:30 AM
To: [EMAIL PROTECTED]
Subject: UserDatabase implementations

Are there plans to have JDBC or JDNI/LDAP implementations of 
org.apache.catalina.UserDatabase?

This would be very useful, as webapps often have to perform actions 
beyond what J2EE APIs provide (get all users in group, get all groups, 
add users/groups/membership).  The advantages would be twofold: you 
would only have to configure your user store once in server.xml; and if 
you change between XML, JDBC or LDAP user stores at the server level, 
you don't have to touch your application-level configuration.

Or am I misreading the whole purpose of J2EE container authentication? 
Should J2EE authentication be reserved for server administration-level 
applications like the manager, and should we use a different system for 
application-level access and authentication altogether?

-- 
Bill Schneider
Software Architect

Vecna Technologies, Inc.
5004 Lehigh Road, Suite B
College Park, MD 20740
[EMAIL PROTECTED]
t: 301-864-7594
f: 301-699-3180



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Unit Testing

2003-08-14 Thread Hookom, Jacob
We are looking to do unit testing of our DAO components that currently
leverage DataSource lookup via Java Naming.

Are there UnitTests already out there that would give me that JNDI
environment to test our code in?  I know Cactus provides testing of
Servlets, etc, but does that also provide me with duplicate JNDI lookup?

Many Thanks,
Jacob

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: MY ATTITUDE

2003-02-11 Thread Hookom, Jacob John
Don't wallow in the mud with pigs, you will get dirty and the pigs will like it
-Lorrie Ardion

-Original Message- 
From: Steve Burrus [mailto:[EMAIL PROTECTED]] 
Sent: Tue 2/11/2003 8:53 PM 
To: Tomcat Users List 
Cc: 
Subject: Re: MY ATTITUDE



Mike, (u don't mind if I call you Mike do you? :-) ) what did you mean by 
stating Don't feed the troll, eh? 



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


RE: Can someone tell me please.........

2003-02-07 Thread Hookom, Jacob John
get and set on what?
 
try getAttribute() setAttribute()

-Original Message- 
From: Steve Burrus [mailto:[EMAIL PROTECTED]] 
Sent: Fri 2/7/2003 2:38 PM 
To: [EMAIL PROTECTED] 
Cc: 
Subject: Can someone tell me please.



Can someone tell me please just what the current methods are supposed to be 
for the deprecated getValue() and setValue() and there's some other method dealing 
with Value that I momentarily forgot! A recent program that I was trying to run gave 
me about 3 separate deprecation warnings when I tried to compile it! Thanx in advance.



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


RE: Loading XML Files - Best Pracitices

2003-01-05 Thread Hookom, Jacob John
I've used it on a few projects-- XSLT Dom to Dom transformations are a little buggy 
yet. Dom4j's web site does offer some links to benchmarks:
 
http://www.dom4j.org/benchmarks/xpath/index.html  Dom4j vs. Xalan with XPath Queries
http://www-106.ibm.com/developerworks/library/x-injava2/  Dom4j vs. Everyone
 
Dom4j also has support for PullParsing or XPP.  This, when paired with the ability to 
prune on read allows very large documents to be executed upon in short order. One 
other issue is that Dom4j does not align with the w3c standard API.  There are 
partially finished classes for integration, but it needs some work yet as of the last 
release I looked at (1mo).
 
If we want to discuss XML-Bean-XML, then yes, Betwixt would be ideal.  I prefer 
Castor (www.castor.org) because it provides a little more customizability for how the 
documents are (un?)marshalled.
 
-Jacob

-Original Message- 
From: Jacob Kjome [mailto:[EMAIL PROTECTED]] 
Sent: Sun 1/5/2003 2:11 PM 
To: Tomcat Users List 
Cc: 
Subject: RE: Loading XML Files - Best Pracitices




Hi Jacob,

Did you actually test the performance of Dom4j?  I'm just curious.  I have
heard very good things about Dom4j.

Jake

At 08:08 PM 1/4/2003 -0600, you wrote:
I recommend Dom4j, it offers the best overall performance out of the XML
libs and it works really well for large files with the ability to prune on
read.

www.dom4j.org


 -Original Message-
 From: Jacob Kjome [mailto:[EMAIL PROTECTED]]
 Sent: Sat 1/4/2003 1:58 PM
 To: Tomcat Users List
 Cc:
 Subject: Re: Loading XML Files - Best Pracitices




 No, I don't really have any reservations about JDOM...except for
 the fact
 that there has been little to zero development on it of
 late.  Check out
 the amount of time that has passed since the last beta release (9
 - 10
 months!).  At this rate, they'll release a 1.0 version in a
 couple more
 years while Xerces development steams on ahead.  JDOM may be
 elegant, but I
 wish the main developers would put their nose to the grindstone
 and get, at
 least, another beta release out in short order!

 To tell you the truth, I would just use a SAX parser.  That will
 be faster
 than any of the other methods including JDOM.

 Jake

 At 12:01 PM 1/4/2003 -0600, you wrote:
 Howdy,
 
 Thanks for all the good suggestions. I'm going with JDOM, just
 because
 it's pretty darn elegant and simple. It also appears that it will be
 (if not already) an XML standard for Java.  So all signs
 indicate that
 I'm not marrying myself to an obscure API.
 
 Do any of you have reservations about JDOM?
 
 Thanks,
 -FB
 
 On Saturday, January 4, 2003, at 08:02  AM, Jacob Kjome wrote:
 
 
 Well,
 
 There are a number of parsers available.  You can use DOM, JDOM,
 DOM4J, SAX, or, actually, you might want to try out XPath using
 Jaxen.
 
 Here is an example of reading in a document using DOMand no
 specific external package so you don't marry yourself to a
 particular
 implementation...
 
 DocumentBuilderFactory dbfactory =
 DocumentBuilderFactory.newInstance();
 dbfactory.setNamespaceAware(true);
 Document doc = null;
 try {
  DocumentBuilder dbuilder = dbfactory.newDocumentBuilder();
  InputStream =
 context.getResourceAsStream(/WEB-INF/mydoc.xml);
  doc = dbuilder.parse(is);
 }
 catch (ParserConfigurationException pce) {}
 catch (SAXException se) {}
 catch (IOException ioe) {}
 
 
 You can then grab a NodeList of some part of the document and
 iterate
 through that or you can then use Jaxen to get to specific data with
 XPath queries
 
 
 try {
  XPath xpath = new
 DOMXPath(//MyElement[@myAttribute='someSpecificValue']/
  

RE: Loading XML Files - Best Pracitices

2003-01-04 Thread Hookom, Jacob John
I recommend Dom4j, it offers the best overall performance out of the XML libs and it 
works really well for large files with the ability to prune on read.
 
www.dom4j.org
 

-Original Message- 
From: Jacob Kjome [mailto:[EMAIL PROTECTED]] 
Sent: Sat 1/4/2003 1:58 PM 
To: Tomcat Users List 
Cc: 
Subject: Re: Loading XML Files - Best Pracitices




No, I don't really have any reservations about JDOM...except for the fact
that there has been little to zero development on it of late.  Check out
the amount of time that has passed since the last beta release (9 - 10
months!).  At this rate, they'll release a 1.0 version in a couple more
years while Xerces development steams on ahead.  JDOM may be elegant, but I
wish the main developers would put their nose to the grindstone and get, at
least, another beta release out in short order!

To tell you the truth, I would just use a SAX parser.  That will be faster
than any of the other methods including JDOM.

Jake

At 12:01 PM 1/4/2003 -0600, you wrote:
Howdy,

Thanks for all the good suggestions. I'm going with JDOM, just because
it's pretty darn elegant and simple. It also appears that it will be
(if not already) an XML standard for Java.  So all signs indicate that
I'm not marrying myself to an obscure API.

Do any of you have reservations about JDOM?

Thanks,
-FB

On Saturday, January 4, 2003, at 08:02  AM, Jacob Kjome wrote:


Well,

There are a number of parsers available.  You can use DOM, JDOM,
DOM4J, SAX, or, actually, you might want to try out XPath using Jaxen.

Here is an example of reading in a document using DOMand no
specific external package so you don't marry yourself to a particular
implementation...

DocumentBuilderFactory dbfactory =
DocumentBuilderFactory.newInstance();
dbfactory.setNamespaceAware(true);
Document doc = null;
try {
 DocumentBuilder dbuilder = dbfactory.newDocumentBuilder();
 InputStream = context.getResourceAsStream(/WEB-INF/mydoc.xml);
 doc = dbuilder.parse(is);
}
catch (ParserConfigurationException pce) {}
catch (SAXException se) {}
catch (IOException ioe) {}


You can then grab a NodeList of some part of the document and iterate
through that or you can then use Jaxen to get to specific data with
XPath queries


try {
 XPath xpath = new
DOMXPath(//MyElement[@myAttribute='someSpecificValue']/ AnotherElement);
 Node node = (Node)xpath.selectSingleNode(domainDoc);
 //now do something with the node
}
catch (XPathSyntaxException xse) {}
catch (JaxenException je) {}


If you know, in advance, all the elements you will need to read, then
you might want to write a SAX parser for your document.  It will be
the fastest methodor you could use XML data binding using Zeus or
JAXB which will allow you to read in a whole document and access all
the data using standard Java Bean getters and set the values using
standard Java bean setters.  In this case, you don't even need to
worry about XML since the fact that it is XML is totally hidden from
you.  You can then marshal your updated object (assuming you modified
it) back to an XML document.

There are lots of ways to do this.  Which way you choose depends on
your needs and what API's you feel most comfortable with.

Jake


At 07:29 PM 1/3/2003 -0600, you wrote:
I have a servlet and I want it to read it's data from an XML file.
There's more than one way of doing this task and I'm fishing for best
practices.
Can anyone provide me with some links to example code? I'm sure this
has been beaten to death and I don't want to reinvent the wheel.

Thanks!


--
To unsubscribe, e-mail:
mailto:[EMAIL PROTECTED]
For additional commands, e-mail:
mailto:[EMAIL PROTECTED]


--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]



winmail.dat--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]


Filters, MVC, ResultSets

2002-10-28 Thread Hookom, Jacob John
Hey All,
 
Everyone says for performance purposes, working directly with the resultset is 
optimal.  But, with MVC, we can't just push the RS to the JSP to display and ignore 
closing.
 
Is it possible with Filters to do a M-C1-V-C2 where C1 sets resultsets in the 
request, then pushes the response up to the JSP to render the content and then closes 
the resultset after rendering.  I know 'programatically' it would work, but, I'm 
wondering about exceptions and making sure that the resultsets get closed.  An example 
would be passing the request/response to the JSP, but then an exception occurs up the 
chain, does the exception trickle back down through the filters no matter what to 
catch and close my JDBC items?
 
Best Regards,
Jacob Hookom



RE: Filters, MVC, ResultSets

2002-10-28 Thread Hookom, Jacob John

I've been doing that with Strut's MVC, but I was hoping to set the filter up like

//do some processing
try
{
  request.setAttribute(PEOPLE,resultSet);
  //pass request response up the chain
}
catch (Exception e)
{
}
finally
{
resultSet.close();
pStmt.close();
connection.close();
}

This way, with the use of JSTL at the JSP, I can prevent newing multiple objects that 
are request scoped (ojb, persistence layers, dao's aside ;-).

Regards,
Jacob

-Original Message-
From:   German Augusto Niebles Alvarez [mailto:GERMNIAL;susalud.com.co]
Sent:   Mon 10/28/2002 5:01 PM
To: [EMAIL PROTECTED]
Cc: Hookom, Jacob John
Subject:Re: Filters, MVC, ResultSets
I suggest you use vectors and beans (collection of beans) to poblate rs
and then close de resultset, and use a class to connect to database
(jdbchelper class), i send you an example:



  // Obtiene la informacion acerca de la empresa
  public Vector obtenerInformacionOrganizacion()
  // throws SQLException,javax.naming.NamingException
  {

Vector contenedorRazonSocial = new Vector();

Connection connection = null;
String selectRazonSocialStr =
  SELECT * FROM tblRazonSocial;

PreparedStatement selectStatement = null;

try {

  // Obtiene una conexion a la base de datos, requiere Try
  connection = jdbcAccess.getConnection();

  // Prepara la sentencia de Busqueda
  selectStatement =
connection.prepareStatement(selectRazonSocialStr);

  // Obtiene el resultset
  ResultSet rs = selectStatement.executeQuery();

  // Si el rs tiene next es que tiene un registro con la informacion
acerca de la empresa

  FachadaRazonSocialBean facRazonSocialBean;

  if (rs.next()) {

facRazonSocialBean = new FachadaRazonSocialBean();

facRazonSocialBean.setNit(rs.getString(nit));
facRazonSocialBean.setNombre(rs.getString(nombre));
facRazonSocialBean.setDireccion(rs.getString(direccion));
facRazonSocialBean.setTelefono(rs.getString(telefono));
facRazonSocialBean.setEMail(rs.getString(email));
   
facRazonSocialBean.setDireccionWeb(rs.getString(direccionWeb));
facRazonSocialBean.setCodigoIAC(rs.getString(codigoIAC));

contenedorRazonSocial.add(facRazonSocialBean);

  }
  contenedorRazonSocial.trimToSize();

  // Cierra el Resultset
  rs.close();
  jdbcAccess.cleanup(connection, selectStatement,null);

}

// Area de obtencion de Excepciones
catch(NamingException ne) {
  System.out.println(NamingException in JDBCAccess : + ne);
}

catch (SQLException sqle) {
   System.out.println(SQLException in JDBCAccess: + sqle);
 }

 catch (Exception e)
 {
   System.out.println(Exception In JDBCAccess: + e);
 }
finally {
return contenedorRazonSocial;

}
  }



==

Atentamente,


Germán Niebles
Analista de Información
Tel 4-93-86-00 Ext 7053

 [EMAIL PROTECTED] 10/28 4:39 p.m. 
Hey All,

Everyone says for performance purposes, working directly with the
resultset is optimal.  But, with MVC, we can't just push the RS to the
JSP to display and ignore closing.

Is it possible with Filters to do a M-C1-V-C2 where C1 sets
resultsets in the request, then pushes the response up to the JSP to
render the content and then closes the resultset after rendering.  I
know 'programatically' it would work, but, I'm wondering about
exceptions and making sure that the resultsets get closed.  An example
would be passing the request/response to the JSP, but then an exception
occurs up the chain, does the exception trickle back down through the
filters no matter what to catch and close my JDBC items?

Best Regards,
Jacob Hookom




winmail.dat--
To unsubscribe, e-mail:   mailto:tomcat-user-unsubscribe;jakarta.apache.org
For additional commands, e-mail: mailto:tomcat-user-help;jakarta.apache.org


Realm Security Implementation Question [OT]

2002-08-21 Thread Hookom, Jacob John

We are trying to figure out a way to handle realm-based security in a 
multi-application environement where users and their roles are specified in a DB.  
Users are stored in one table with password and there is a table for each application 
definining permissions for the user.
 
I have been looking at the new JAASRealm the Craig put together, but I'm not sure if 
it's exactly what we need or if it's going overboard.  Otherwise we have to represent 
roles in this manner: [applicationName]:[applicationId]:[role] and have a specialized 
realm do string parsing to validate roles within an application.  Our applications are 
deployed under a single war to take advantage of a pseudo single sign-on.
 
Any suggestions would be apprechiated,
 
Jacob

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




RE: filtering -- 2 servlets

2002-07-21 Thread Hookom, Jacob John

you might want to look at implementing Filters to handle redirection that just checked 
the request and passes the user off.

-Original Message- 
From: Mark Beecroft [mailto:[EMAIL PROTECTED]] 
Sent: Sun 7/21/2002 7:30 PM 
To: Tomcat Users List; Jacob Kjome 
Cc: 
Subject: filtering -- 2 servlets



Good morning/afternoon/evening,

I am using Tomcat 4 and have 2 servlets between which I would like to split
processing. Servlet A needs to process all requests corresponding to the
patterns *.html, *.html and /. Servlet B needs to process all other
requests. The short question is how can I do this?

I am currently using filters but am finding it difficult to cater for the
pattern /. The only option seems to be the use of the url mapping /*
to invoke a filter class, but then how does processing get to Servlet B? If I
only invoke chain.doFilter() when the pathinfo satisfies the conditions of
Servlet A then I can get Servlet A working normally, but there seems no way
of ever invoking Servlet B with such a configuration. To demonstrate:

http://www.domainname.com/index.html -- Servlet A
http://www.domainname.com/whatever.htm -- Servlet A
http://www.domainname.com/ -- servlet A
http://www.domainname.com/image.jpeg -- no Servlet accessed

What I really would like is a more versatile url-pattern element, but does
anyone have a solution for my current situation... please...

Cheers,
Mark
P.S. If you help me out I'll by you a pint when you next come to England!

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




winmail.dat
--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]