[fpc-pascal] THttpServlet servlet mappings strange behaviour

Leonardo Cecchi leonardoce at interfree.it
Thu Jul 6 23:31:55 CEST 2006


Hi,

I'm coding a small http application using che THttpServer class from the 
FCL.
My application has only two servlet:

HttpServer.AddServlet(PrimoServlet, ´/primo´);
HttpServer.AddServlet(SecondoServlet, ´/secondo´);

It's all ok but I have some strange mappings between URI and servlets:

http://localhost:8080/blabla  -> Runs the second servlet 
(SecondoServlet). Why?
http://localhost:8080        -> Runs the second servlet 
(SecondoServlet). Why?
http://localhost:8080/primo  -> Runs the first servlet (OK)
http://localhost:8080/secondo -> Runs the second servlet (OK)

So an URI who is not present in the servlet mappings is mapped to the 
last servlet instead of throwing an "Invalid URL".
It's a bug or a well-known behaviour?
Thanks,

Leonardo Cecchi




More information about the fpc-pascal mailing list