Comments below...
>From: Mark Galbreath <[EMAIL PROTECTED]>
>To: [EMAIL PROTECTED]
>Subject: Re: Servlet Reflection
>Date: Fri, 6 Jul 2001 22:08:44 -0400
>
>Alright, alright, already. I f*cked up! I went to my boss's house this
>afternoon for BBQ and beers and came home and never should have gone
>online.
>:-)
>
>Anyway, I think your analysis bears merit, though I have never heard of
>iterative mapping as "Servlet Reflection." And I think you mean something
>like
>
>http://myrealserver/servlets/aServlet?operation=realParameters
>
>don't you?
Not really, that's the main point of servlet reflection. Instead of using
operation as a parameter key, you can map
http://myrealserver/servlets/aServlet/ to accept any URL that starts with
it.
Then, you parse the actual URL sent to you and use reflection to call the
appropriate operation, i.e.:
http://myrealserver/servlets/aServlet/anOperation/?realPar1=something&realPar2=anotherThing
would invoke anOperation on aServlet and, as anOperation is not part of the
param list, any of the methods has to parse the URL.
>But it's Friday night...how about we debate the implications of:
>
>if( req.getMethod().equals( "HEAD")) return;
>
>Now, who's requesting head, and what should you return? ;-)
I think I'm feeling asleep, could you rephrase your question? :-)
>Cheers!
>Mark
>
>(also a Java2 Certified Programmer ;-))
Ok, peer! :-)
----------------------------------------------------
Michael Nascimento Santos
Sun Certified Programmer for the Java 2 Platform
Analista/Consultor
Moderador SouJava - www.soujava.org.br
CPM Sistemas - www.cpm.com.br
>----- Original Message -----
>From: "Michael Santos" <[EMAIL PROTECTED]>
>Sent: Friday, July 06, 2001 9:06 PM
>
>
> > Servlet Reflection, explained in an old article in JavaWorld, is a
>technique
> > that combines servlet mapping with reflection to avoid the use of
> > "if-cascades", like:
> >
> > String operation = request.getParameter("operation");
> >
> > if (operation.equals("details")) {
> > details(request, response);
> > } else if (operation.equals("anotherOperation")) {
> > anotherOperation(request, response);
> > } else if ...
> >
> > It has something to do with using the URL to identify the operation,
>like:
> >
> > http://myrealserver/servlets/aServlet/operation/?realParameters
> >
> > and using reflection to call the appropriate method - in this case,
> > operation.
> > ----------------------------------------------------
> > P.S.: B4 someone starts flaming me 'bout my English, I KNOW I MAKE
>MISTAKES
> > :-)
> >
> > >From: Mark Galbreath <[EMAIL PROTECTED]>
> > >Date: Fri, 6 Jul 2001 20:01:33 -0400
> > >
> > >Reflection is a technique whereby a Java class can inspect and
>manipulate
> > >itself at runtime, learning what methods are available and is used in
> > >JavaBeans, EJB and serialization. I never heard of "Servlet
>Reflection."
> > >
> > >----- Original Message -----
> > >From: "Sam Newman" <[EMAIL PROTECTED]>
> > >Sent: Friday, July 06, 2001 4:15 AM
> > >
> > > > Given the standard meaning of Reflection in java, I assume you mean
>the
> > > > ability to find out at runtime what servlets are avaliable?
> > > >
> > > > ----- Original Message -----
> > > > From: "Mike" <[EMAIL PROTECTED]>
> > > > Sent: Friday, July 06, 2001 12:56 AM
> > > > >
> > > > > I heard about Servlet Reflection, could someone please explain me
>what
> > >is
> > > > that mean? It would be nice that I can see samples on this.
_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html