RE: Can one map a servlet to a specific connctor?
Try ServletRequest.getLocalPort() rather than getServerPort(). Yes exactly, thanks - that is an addition to the api after the book I read :) eclipse auto-complete and the sun website is your friend :) * Part of all these questions is I am looking to implement a servlet subclass which will "auto register" itself with an upstream front end (maybe AJP does this?) so ideally I would want to be able to query what URI "host,port,path" would access the proper connector and servlet when it's "init()" is called so I can pass it to upstream to the front-end router. Of course at this time no request has been recieved. I guess I could do it by parsing the server.xml or putting in rendundant per servlet initParameters but that makes me queasy, I like the thing itself to propagate it's own state changes :) PK At 11:58 3/13/2007, you wrote: > From: Caldarale, Charles R [mailto:[EMAIL PROTECTED] > Subject: RE: Can one map a servlet to a specific connctor? Try ServletRequest.getLocalPort() rather than getServerPort(). - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Can one map a servlet to a specific connctor?
This could be the ticket! At 11:53 3/13/2007, you wrote: You could configure proxyPort in your to some value that you could use as a flag for your particular environment. This will override the header value returned by getServerPort(). Don't know if there would be any undesirable side effects. - Chuck - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Can one map a servlet to a specific connctor?
> From: Caldarale, Charles R [mailto:[EMAIL PROTECTED] > Subject: RE: Can one map a servlet to a specific connctor? Try ServletRequest.getLocalPort() rather than getServerPort(). - 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 start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Can one map a servlet to a specific connctor?
> From: Peter Kennard [mailto:[EMAIL PROTECTED] > Subject: RE: Can one map a servlet to a specific connctor? > > I Verified this returns the port indicated by the client in > the header. You could configure proxyPort in your to some value that you could use as a flag for your particular environment. This will override the header value returned by getServerPort(). Don't know if there would be any undesirable side effects. - 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 start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Can one map a servlet to a specific connctor?
I Verified this returns the port indicated by the client in the header. Not the port the request was recieved by at the tomcat instance. Appropriate for a client to send and passed through by proxys, remappers, front ends etc. but not to determine where it ends up. PK At 07:23 3/13/2007, you wrote: Damn! I missed that :) Thanks. I assume this is taking it from where the hit arrives in at the server and not the HTTP headers passed in (which could be anything) At 01:32 3/13/2007, you wrote: > From: Peter Kennard [mailto:[EMAIL PROTECTED] > Subject: Re: Can one map a servlet to a specific connctor? > > Can I determine the connector port connected to for a request from > service() I don't see it in the servlet API but am willing to access > somthing tomcat specific. ServletRequest.getServerPort() is inherited by HTTPServletRequest. - Chuck - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Can one map a servlet to a specific connctor?
Damn! I missed that :) Thanks. I assume this is taking it from where the hit arrives in at the server and not the HTTP headers passed in (which could be anything) At 01:32 3/13/2007, you wrote: > From: Peter Kennard [mailto:[EMAIL PROTECTED] > Subject: Re: Can one map a servlet to a specific connctor? > > Can I determine the connector port connected to for a request from > service() I don't see it in the servlet API but am willing to access > somthing tomcat specific. ServletRequest.getServerPort() is inherited by HTTPServletRequest. - 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 start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Can one map a servlet to a specific connctor?
Thanks - I assume "any way you want" would include the port? I'll have to dive more into Filters. At 01:15 3/13/2007, you wrote: > From: Peter Kennard [mailto:[EMAIL PROTECTED] > Subject: Can one map a servlet to a specific connctor? > > On a stand alone tomcat with more than one connector (port) > Is it possible to map a servlet to only one or a subset of connectors? No, but you can use a filter or valve to restrict access any way you want. - Chuck - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Can one map a servlet to a specific connctor?
> From: Peter Kennard [mailto:[EMAIL PROTECTED] > Subject: Re: Can one map a servlet to a specific connctor? > > Can I determine the connector port connected to for a request from > service() I don't see it in the servlet API but am willing to access > somthing tomcat specific. ServletRequest.getServerPort() is inherited by HTTPServletRequest. - 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 start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Can one map a servlet to a specific connctor?
I guess a corrollary question to this would be. Can I determine the connector port connected to for a request from service() I don't see it in the servlet API but am willing to access somthing tomcat specific. PK At 21:57 3/12/2007, you wrote: On a stand alone tomcat with more than one connector (port) Is it possible to map a servlet to only one or a subset of connectors? Thanks PK - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Can one map a servlet to a specific connctor?
> From: Peter Kennard [mailto:[EMAIL PROTECTED] > Subject: Can one map a servlet to a specific connctor? > > On a stand alone tomcat with more than one connector (port) > Is it possible to map a servlet to only one or a subset of connectors? No, but you can use a filter or valve to restrict access any way you want. - 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 start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]