Re: Basic question related to NIO connector and Async servlet processing

2017-10-12 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Saurav,

On 10/11/17 8:56 AM, Saurav Sarkar wrote:
> I have got a basic question related to usage of Async servlet with
> tomcat NIO connector.
> 
> I want to use Async servlet with Non Block I/O as per servlet spec 
> https://docs.oracle.com/javaee/7/tutorial/servlets013.htm?lipi=urn%3Al
i%3Apage%3Ad_flagship3_pulse_read%3BmL0Q5Y7ESTy4lpYPU%2Br77w%3D%3D
>
>  Such that the http worker threads are released and the container
> threads won't be sitting idle for I/O operations too.
> 
> I am on Tomcat 7. As i understand the default tomcat connector
> (BIO) is a blocking one and is on a thread per connection model. I
> am not clear on whether using async Non Blocking I/o in servlets
> won't suffice ? Won't the http worker threads be released here or
> will it be held for the lifetime of the connection ?

You can't effectively use BIO with async, at least not the way you
actually want to use it. You should switch to NIO if you want to use
servlet-async.

> NIO connector will use request per threads or allocate threads
> when processing is required .Will using NIO selector only release
> the http worker threads if it is used in conjunction with 
> Asynchronous Non blocking I/O servlets ?

That depends upon what you mean by "release" and, specifically, /when/
they are released.

With the BIO connector, HTTP keepalives can tie-up a connector up to
the keepAliveTimeout without accomplishing any useful work. This
happens ALL THE TIME -- clients make a keepalive request and then
never bother to close their connection cleanly. So the server wastes
thread-time waiting for another request which never comes.

The NIO connector (and APR connector) puts the connection into an I/O
selector and waits for an interrupt from the OS/JVM while the
request-processor thread goes back into the thread pool.

When doing servlet-async and Websocket, things get ... more complicated.

- -chris
-BEGIN PGP SIGNATURE-
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAlngMdMACgkQHPApP6U8
pFjwiw//UeN1W08AId+OcVUc2ZMnzZZZJLnu6RhY+yO50avZx3PhvzGxrHZTfBRD
FFRJRBOCo/1TFacQxUjFXr4Q9tkdcABcN6cVj6f7tJh4S55/jxEeHkg8UGNQe31V
9N6GpUIzRq/WuDFJQRfwJnpOQRVs+DXVIrWWD8RqQ6BooHkt2mUl0u7oYRxcLcQ1
SD8tEK1O1LiJ1gwNWs5Cx1d7s/6mE2tSxKvKH94yr1MvfdChj51vrc7JI3+gfdwa
V6FWItVoIuG4rNqFsthaKiXswvqyGC+gzPG9Jn7aEh0Xd2rzCAX+E9GMM7aKMHEL
QOu+gFm897eRhL4ueBDBxl3MY1R/xD5JEIDeuO82gbmM8xcm7sSqWs2TOazFC5xs
JOdo52xS38RHgRf+eSQ7+KMmZYznYbUscJMokTHYWU/twC7tSzmO4rYB2EEPNTEB
czNyxv4MbWCaQjOunYeFMp2byEFmLyLu2e+jBDPdmPsjMgpduQ35E4spfaYRaCc0
5J8HRaQ4s0amy6b9s/j95pFvYVRlaPRN7ebNMtT/BhoakKXk+ugpNsnCI21zChAJ
aKOdPzb5RU90Qm7mDXeRFqggfI5S1w507WlQZp6bZG6WZ2oz0ykF87WHHQP8C5F4
AvSvTe32zDpmCt0rS7+VgTGBNL/VGLv8r8S/0eLjldA0LDASkTA=
=vSrb
-END PGP SIGNATURE-

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



RE: Basic question about using modjk connector

2011-04-04 Thread Caldarale, Charles R
 From: JAIN, ABHAY K (ATTSI) [mailto:aj2...@att.com] 
 Subject: Basic question about using modjk connector

 Document for modjk installation refers to directories auto, jk,
 catalina under conf which I don't find.

What documentation is that?

The real doc is here:

http://tomcat.apache.org/connectors-doc/
http://tomcat.apache.org/connectors-doc/generic_howto/quick.html

 - 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-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Basic Question : Tomact Clustering

2010-10-30 Thread Pid
On 29/10/2010 11:49, alok kakani wrote:

 Hi All,

 I am working Business Objects 3.1(BOE) with tomcat being the application
 server. I am new to the web application part, hence i had some doubts

 We are trying to step up a BOE on 2 machines  we will have tomcat
 installed on both machines. We plan to use MS NLB for high availability. I
 am not sure how will i configure the web + web apps in such scenario with
 Tomcat.

Tomcat doesn't know what MS NLB is.  Depending on how your application
works and what it does, this may or may not be a suitable solution. YMMV.

 I will be installing tomcat 5.5 on both machines. this is shipped as
 default with BOE.

Tomcat 6.0 should work just as well.

 1. Do i need to install Apache on both machines?

Apache HTTPD?  No.
One reason for using HTTPD is to make it the load balancer.  So you
would need only one HTTPD in that case.

 2. What are the configuring steps to cluster tomcat for HA  fail over?

Read the Cluster documentation for information about what Tomcat offers:

 http://tomcat.apache.org/tomcat-5.5-doc/cluster-howto.html

 3. Do i need to cluster Apache as well??

Not if you're not using it.


p

 Regards,
 *Alok Kakani*

 



0x62590808.asc
Description: application/pgp-keys


signature.asc
Description: OpenPGP digital signature


Re: Basic Question : Tomact Clustering

2010-10-29 Thread alok kakani

 Hi All,

 I am working Business Objects 3.1(BOE) with tomcat being the application
 server. I am new to the web application part, hence i had some doubts

 We are trying to step up a BOE on 2 machines  we will have tomcat
 installed on both machines. We plan to use MS NLB for high availability. I
 am not sure how will i configure the web + web apps in such scenario with
 Tomcat.

 I will be installing tomcat 5.5 on both machines. this is shipped as
 default with BOE.

 1. Do i need to install Apache on both machines?
 2. What are the configuring steps to cluster tomcat for HA  fail over?
 3. Do i need to cluster Apache as well??

 Regards,
 *Alok Kakani*



Re: Basic Question

2010-04-16 Thread Zachary Valentiner
For starting Tomcat in Eclipse, check this out:
http://www.eclipsetotale.com/tomcatPlugin.html

As for the other part, I'm not really sure at all. Good luck, though.

Zach


On Apr 16, 2010, at 3:07 AM, Rhino wrote:

 I hope someone will take pity on me and help me with this very basic 
 question. I was moderately fluent with servlets and Tomcat several years ago 
 but haven't touched them in a while. I'm trying to get back into servlets now.
 
 I am having trouble getting my servlets to start in Tomcat. I inevitably get 
 a 404 error. I am running Tomcat 6.0.26 on Windows XP SP2. The sample 
 applications in Tomcat run fine.
 
 My servlets are in Eclipse 3.5.2. They compile fine and I have used the 
 Tomcat menu to export them to the war file directory; no error gets reported 
 when I do the export. I did a manual deploy of the war file from the war 
 file to deplay section of the Tomcat Manager page.
 
 When I start the Tomcat Manager in my browser, it shows several servlets, 
 including the examples and the servlets that I have deployed myself. In each 
 case, my own servlets seem to be started just fine. All of them say 
 running, the number of sessions is 0 for each of them, and all of them have 
 stop, reload and undeploy options which are clickable and a start option 
 which is not clickable. To me, that says these puppies are started and there 
 is no error in any of them.
 
 However, when I click on my servlets, like /FileUploadServlet for example, I 
 get this:
 
 
 HTTP Status 404 - /FileUploadServlet/
 
 
 
 *type* Status report
 
 *message* _/FileUploadServlet/_
 
 *description* _The requested resource (/FileUploadServlet/) is not available._
 
 
 
 
 Apache Tomcat/6.0.26
 
 
 
 I feel sure that I've simply neglected to do something simple and 
 straightforward but my memory is failing me. I can't remember what other 
 steps are needed to get a servlet configured so that it runs in Tomcat.
 
 I was going to try to run the servlet in Eclipse but I'm darned if I can 
 remember how to start it there either.
 
 Can someone help me out?
 
 --
 Rhino
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 


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



Re: Basic Question

2010-04-16 Thread Rhino
Can you remind me how to do that (or where to find documentation 
describing it)?


FileUploadServlet is one that I wrote some time back and it has a 
web.xml file associated with it. I'm pretty sure I created it myself 
although I don't actually remember doing so at this point. Here are the 
current contents but I'm not sure if this is still how the web.xml 
should look at this point:


?xml version=1.0 encoding=ISO-8859-1?

!DOCTYPE web-app
   PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.2//EN
   http://java.sun.com/j2ee/dtds/web-app_2_2.dtd;

web-app

   servlet
   servlet-nameform/servlet-name
   servlet-classupload.UploadForm/servlet-class
   /servlet
   servlet
   servlet-nameservlet/servlet-name
   servlet-classupload.UploadServlet/servlet-class
   init-param
   param-nameuploadDir/param-name
   param-valueuploads/param-value
   /init-param
   /servlet

   servlet-mapping
   servlet-nameform/servlet-name
   url-pattern/form/url-pattern
   /servlet-mapping
   servlet-mapping
   servlet-nameservlet/servlet-name
   url-pattern/servlet/url-pattern
   /servlet-mapping

/web-app

Also, does this file need to be put into Tomcat somehow so that Tomcat 
can see it? If so, what is the proper mechanism to do so? Or does the 
act of exporting to the war file do that automagically? Again, my memory 
is really fuzzy on this stuff and I don't remember where these 
techniques are described.


--
Rhino

Joseph M Morgan wrote:
Did you configure your servlets in your web.xml properly?  Also...it 
sounds as though you are deploying each servlet in its own app.   Make 
sure you are invoking the servlet through the proper app.


-Original message-
From: Rhino rhi...@sympatico.ca
To: tomcat-user tomcat-u...@jakarta.apache.org
Sent: Fri, Apr 16, 2010 01:07:29 GMT+00:00
Subject: Basic Question

I hope someone will take pity on me and help me with this very basic 
question. I was moderately fluent with servlets and Tomcat several 
years ago but haven't touched them in a while. I'm trying to get back 
into servlets now.


I am having trouble getting my servlets to start in Tomcat. I 
inevitably get a 404 error. I am running Tomcat 6.0.26 on Windows XP 
SP2. The sample applications in Tomcat run fine.


My servlets are in Eclipse 3.5.2. They compile fine and I have used 
the Tomcat menu to export them to the war file directory; no error 
gets reported when I do the export. I did a manual deploy of the war 
file from the war file to deplay section of the Tomcat Manager page.


When I start the Tomcat Manager in my browser, it shows several 
servlets, including the examples and the servlets that I have deployed 
myself. In each case, my own servlets seem to be started just fine. 
All of them say running, the number of sessions is 0 for each of 
them, and all of them have stop, reload and undeploy options which are 
clickable and a start option which is not clickable. To me, that says 
these puppies are started and there is no error in any of them.


However, when I click on my servlets, like /FileUploadServlet for 
example, I get this:



 HTTP Status 404 - /FileUploadServlet/



*type* Status report

*message* _/FileUploadServlet/_

*description* _The requested resource (/FileUploadServlet/) is not 
available._





 Apache Tomcat/6.0.26



I feel sure that I've simply neglected to do something simple and 
straightforward but my memory is failing me. I can't remember what 
other steps are needed to get a servlet configured so that it runs in 
Tomcat.


I was going to try to run the servlet in Eclipse but I'm darned if I 
can remember how to start it there either.


Can someone help me out?

--
Rhino

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


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



RE: Basic Question

2010-04-16 Thread Joseph Morgan
Depends upon how geeky you want it.  You can try this, as it will be
certainly the most definitive answer, but somewhat like beef jerky to
digest:

http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd

You could start here for a everything you want to know:

http://jcp.org/aboutJava/communityprocess/mrel/jsr154/index2.html

But I sometimes like to reference something more quick and dirty, but
nicely done:

http://wiki.metawerx.net/wiki/Web.xml



-Original Message-
From: Rhino [mailto:rhi...@sympatico.ca] 
Sent: Friday, April 16, 2010 7:25 AM
To: Tomcat Users List
Subject: Re: Basic Question

Can you remind me how to do that (or where to find documentation 
describing it)?

FileUploadServlet is one that I wrote some time back and it has a 
web.xml file associated with it. I'm pretty sure I created it myself 
although I don't actually remember doing so at this point. Here are the 
current contents but I'm not sure if this is still how the web.xml 
should look at this point:

?xml version=1.0 encoding=ISO-8859-1?

!DOCTYPE web-app
PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.2//EN
http://java.sun.com/j2ee/dtds/web-app_2_2.dtd;

web-app

servlet
servlet-nameform/servlet-name
servlet-classupload.UploadForm/servlet-class
/servlet
servlet
servlet-nameservlet/servlet-name
servlet-classupload.UploadServlet/servlet-class
init-param
param-nameuploadDir/param-name
param-valueuploads/param-value
/init-param
/servlet

servlet-mapping
servlet-nameform/servlet-name
url-pattern/form/url-pattern
/servlet-mapping
servlet-mapping
servlet-nameservlet/servlet-name
url-pattern/servlet/url-pattern
/servlet-mapping

/web-app

Also, does this file need to be put into Tomcat somehow so that Tomcat 
can see it? If so, what is the proper mechanism to do so? Or does the 
act of exporting to the war file do that automagically? Again, my memory

is really fuzzy on this stuff and I don't remember where these 
techniques are described.

--
Rhino

Joseph M Morgan wrote:
 Did you configure your servlets in your web.xml properly?  Also...it 
 sounds as though you are deploying each servlet in its own app.   Make

 sure you are invoking the servlet through the proper app.

 -Original message-
 From: Rhino rhi...@sympatico.ca
 To: tomcat-user tomcat-u...@jakarta.apache.org
 Sent: Fri, Apr 16, 2010 01:07:29 GMT+00:00
 Subject: Basic Question

 I hope someone will take pity on me and help me with this very basic 
 question. I was moderately fluent with servlets and Tomcat several 
 years ago but haven't touched them in a while. I'm trying to get back 
 into servlets now.

 I am having trouble getting my servlets to start in Tomcat. I 
 inevitably get a 404 error. I am running Tomcat 6.0.26 on Windows XP 
 SP2. The sample applications in Tomcat run fine.

 My servlets are in Eclipse 3.5.2. They compile fine and I have used 
 the Tomcat menu to export them to the war file directory; no error 
 gets reported when I do the export. I did a manual deploy of the war 
 file from the war file to deplay section of the Tomcat Manager page.

 When I start the Tomcat Manager in my browser, it shows several 
 servlets, including the examples and the servlets that I have deployed

 myself. In each case, my own servlets seem to be started just fine. 
 All of them say running, the number of sessions is 0 for each of 
 them, and all of them have stop, reload and undeploy options which are

 clickable and a start option which is not clickable. To me, that says 
 these puppies are started and there is no error in any of them.

 However, when I click on my servlets, like /FileUploadServlet for 
 example, I get this:


  HTTP Status 404 - /FileUploadServlet/




 *type* Status report

 *message* _/FileUploadServlet/_

 *description* _The requested resource (/FileUploadServlet/) is not 
 available._





  Apache Tomcat/6.0.26



 I feel sure that I've simply neglected to do something simple and 
 straightforward but my memory is failing me. I can't remember what 
 other steps are needed to get a servlet configured so that it runs in 
 Tomcat.

 I was going to try to run the servlet in Eclipse but I'm darned if I 
 can remember how to start it there either.

 Can someone help me out?

 -- 
 Rhino

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

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


-
To unsubscribe, e-mail

Re: Basic Question

2010-04-16 Thread Konstantin Kolinko
2010/4/16 Rhino rhi...@sympatico.ca:
 However, when I click on my servlets, like /FileUploadServlet for example, I
 get this:

  HTTP Status 404 - /FileUploadServlet/


The keyword here is welcome page.  If your WAR file does not have
index.jsp or index.html, or some explicit mapping for its root
address, you will get a 404 response trying to access the root of your
webapp.

According to the web.xml that you posted, your application will
respond to the following URLs:
/FileUploadServlet/form
/FileUploadServlet/servlet


Some pointers:
http://tomcat.apache.org/tomcat-6.0-doc/index.html
http://tomcat.apache.org/tomcat-6.0-doc/appdev/index.html
http://wiki.eclipse.org/WTP_Tomcat_FAQ

You may also want to know, that ${catalina.base}/conf/web.xml provides
the defaults for your WEB-INF/web.xml.
Do not change that common file (in /conf), though, unless it is really needed.


Best regards,
Konstantin Kolinko

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



Re: Basic Question

2010-04-16 Thread Rhino



Konstantin Kolinko wrote:

2010/4/16 Rhino rhi...@sympatico.ca:
  

However, when I click on my servlets, like /FileUploadServlet for example, I
get this:

 HTTP Status 404 - /FileUploadServlet/




The keyword here is welcome page.  If your WAR file does not have
index.jsp or index.html, or some explicit mapping for its root
address, you will get a 404 response trying to access the root of your
webapp.

According to the web.xml that you posted, your application will
respond to the following URLs:
/FileUploadServlet/form
/FileUploadServlet/servlet

  
As Homer Simpson would say: D'oh!. I was clicking on the application 
from the Tomcat Manager so it was trying to launch FileUploadServlet, 
i.e. it was trying to go to http://localhost:8080/FileUploadServlet. As 
soon as I added /form to the URL it came up fine! It has been at least 
four or five years since I last played with a servlet so I simply forgot 
about adding that part of the URL. Thank you!!!

Some pointers:
http://tomcat.apache.org/tomcat-6.0-doc/index.html
http://tomcat.apache.org/tomcat-6.0-doc/appdev/index.html
http://wiki.eclipse.org/WTP_Tomcat_FAQ

You may also want to know, that ${catalina.base}/conf/web.xml provides
the defaults for your WEB-INF/web.xml.
Do not change that common file (in /conf), though, unless it is really needed.

  

And thanks also for this information! I'll keep it handy.

Best regards,

Rhino

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



Re: Basic Question

2010-04-15 Thread Campbell, Lance

Did you put an entry in your web.XML file?

Lance Campbell
Sent from my iPhone

On Apr 15, 2010, at 8:09 PM, Rhino rhi...@sympatico.ca wrote:

I hope someone will take pity on me and help me with this very basic  
question. I was moderately fluent with servlets and Tomcat several  
years ago but haven't touched them in a while. I'm trying to get  
back into servlets now.


I am having trouble getting my servlets to start in Tomcat. I  
inevitably get a 404 error. I am running Tomcat 6.0.26 on Windows XP  
SP2. The sample applications in Tomcat run fine.


My servlets are in Eclipse 3.5.2. They compile fine and I have used  
the Tomcat menu to export them to the war file directory; no error  
gets reported when I do the export. I did a manual deploy of the war  
file from the war file to deplay section of the Tomcat Manager page.


When I start the Tomcat Manager in my browser, it shows several  
servlets, including the examples and the servlets that I have  
deployed myself. In each case, my own servlets seem to be started  
just fine. All of them say running, the number of sessions is 0  
for each of them, and all of them have stop, reload and undeploy  
options which are clickable and a start option which is not  
clickable. To me, that says these puppies are started and there is  
no error in any of them.


However, when I click on my servlets, like /FileUploadServlet for  
example, I get this:



HTTP Status 404 - /FileUploadServlet/

--- 
-


*type* Status report

*message* _/FileUploadServlet/_

*description* _The requested resource (/FileUploadServlet/) is not  
available._


--- 
-



Apache Tomcat/6.0.26



I feel sure that I've simply neglected to do something simple and  
straightforward but my memory is failing me. I can't remember what  
other steps are needed to get a servlet configured so that it runs  
in Tomcat.


I was going to try to run the servlet in Eclipse but I'm darned if I  
can remember how to start it there either.


Can someone help me out?

--
Rhino

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



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



Re: Basic Question

2010-04-15 Thread Joseph M Morgan

Did you configure your servlets in your web.xml properly?  Also...it sounds as 
though you are deploying each servlet in its own app.   Make sure you are 
invoking the servlet through the proper app.

-Original message-
From: Rhino rhi...@sympatico.ca
To: tomcat-user tomcat-u...@jakarta.apache.org
Sent: Fri, Apr 16, 2010 01:07:29 GMT+00:00
Subject: Basic Question

I hope someone will take pity on me and help me with this very basic question. 
I was moderately fluent with servlets and Tomcat several years ago but haven't 
touched them in a while. I'm trying to get back into servlets now.

I am having trouble getting my servlets to start in Tomcat. I inevitably get a 
404 error. I am running Tomcat 6.0.26 on Windows XP SP2. The sample 
applications in Tomcat run fine.

My servlets are in Eclipse 3.5.2. They compile fine and I have used the Tomcat menu 
to export them to the war file directory; no error gets reported when I do the 
export. I did a manual deploy of the war file from the war file to deplay 
section of the Tomcat Manager page.

When I start the Tomcat Manager in my browser, it shows several servlets, including the 
examples and the servlets that I have deployed myself. In each case, my own servlets seem 
to be started just fine. All of them say running, the number of sessions is 0 
for each of them, and all of them have stop, reload and undeploy options which are 
clickable and a start option which is not clickable. To me, that says these puppies are 
started and there is no error in any of them.

However, when I click on my servlets, like /FileUploadServlet for example, I 
get this:


 HTTP Status 404 - /FileUploadServlet/



*type* Status report

*message* _/FileUploadServlet/_

*description* _The requested resource (/FileUploadServlet/) is not available._




 Apache Tomcat/6.0.26



I feel sure that I've simply neglected to do something simple and 
straightforward but my memory is failing me. I can't remember what other steps 
are needed to get a servlet configured so that it runs in Tomcat.

I was going to try to run the servlet in Eclipse but I'm darned if I can 
remember how to start it there either.

Can someone help me out?

--
Rhino

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


Re: Basic question on requiring a login

2008-06-11 Thread Mark Thomas


Justin Morgan - Logic Sector wrote:


Hi Tomcat users,

Maybe I'm not googling with the right keywords, but I can't seem to find 
a simple answer to this...


I have a standard Tomcat 6.0.10 installation (no Apache httpd front end 
or anything).  All the contents of the webapps directory have been 
removed, and a single web app has been deployed -- my root application 
(ROOT.war).  Very simple, and all's working great.


Here's the part I need help with:  Now I want Tomcat to require a login 
panel before anyone can access the application.


How to I get Tomcat to force a login panel when users access the root 
web app?  (Basically I'm looking for the same sort of functionality you 
get with Apache .htaccess files etc but without the extra complexity of 
integrating with Apache httpd).


Any tips or pointers greatly appreciated!  Thanks!


Take a look a the security section of the Servlet spec. For hints, look in 
the web.xml for the manager app that comes with Tomcat.


Mark


-
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: Basic question on requiring a login

2008-06-11 Thread Johnny Kewl


- Original Message - 
From: Justin Morgan - Logic Sector [EMAIL PROTECTED]

To: users@tomcat.apache.org
Sent: Wednesday, June 11, 2008 8:02 AM
Subject: Basic question on requiring a login



Hi Tomcat users,

Maybe I'm not googling with the right keywords, but I can't seem to  find 
a simple answer to this...


I have a standard Tomcat 6.0.10 installation (no Apache httpd front  end 
or anything).  All the contents of the webapps directory have been 
removed, and a single web app has been deployed -- my root application 
(ROOT.war).  Very simple, and all's working great.


Here's the part I need help with:  Now I want Tomcat to require a  login 
panel before anyone can access the application.


How to I get Tomcat to force a login panel when users access the root  web 
app?  (Basically I'm looking for the same sort of functionality  you get 
with Apache .htaccess files etc but without the extra  complexity of 
integrating with Apache httpd).


Any tips or pointers greatly appreciated!  Thanks!


Look at this article... then once you got the lingo, you can google for the 
other half million ;)

http://www.informit.com/articles/article.aspx?p=24253seqNum=3


---
HARBOR : http://www.kewlstuff.co.za/index.htm
The most powerful application server on earth.
The only real POJO Application Server.
See it in Action : http://www.kewlstuff.co.za/cd_tut_swf/whatisejb1.htm
---



-
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: Basic question - Ingterating Tomcat with Apache

2007-09-24 Thread Peter Crowther
 From: albrecht andrzejewski [mailto:[EMAIL PROTECTED] 
 I think tomcat stand alone is
 - easier to deploy.
 And that's all.

There are also fewer things to fail, and a smaller learning curve for
your system administrators (if they don't already know Apache httpd and
the JK connector).

 I think apache as a front end is a more flexible and secure solution.
 - if apache fails, tomcat is not affected

... but is inaccessible.  This is a failure mode you don't have with
just a Tomcat.

 - if tomcat fails, apache can redirect request to another tomcat

True.  How often do you expect this failure mode?

 - when you serve static content juste like image of your 
 site and all  
 static text part , javascripts, etc ( i mean... dynamic content is  
 often just an hour ticking at the top of the page!) apche can better  
 handle the request and serve them quickier (with cache).

There have been a couple of benchmarks on this, most recently by Peter
Lin (available at
http://tomcat.apache.org/articles/benchmark_summary.pdf).  They showed
that Tomcat 5.0 and higher are sufficiently efficient at serving static
content that you'll saturate your network before you run out of
resources on the server.  Peter saturated a 100Mbit/s LAN connection.

 Am i wrong ?  As i have currently nothing pre-installed on it... and  
 it would be fine to know what you are thinking about it. You seem to  
 be pro vanilla tomcat... But just let us know WHEN pure 
 tomcat has to be choosen !

Vanilla Tomcat never *has* to be chosen.  I like systems with fewer
moving parts - they're generally simpler to manage, more robust and
easier to debug when they go wrong.  And security-wise, I'd much rather
put a proper firewall in front of a web server than rely on httpd to
catch all the possible attacks!

You may have other reasons to add httpd.  Unless you have very slow
boxes and very fast network connections, speed of serving static content
is not a valid reason.  I'd never assume httpd is any more secure than
Tomcat, so security (to me) is not a valid reason.  You may want to put
httpd in front, simply so that you can load-balance and scale Tomcats as
your application grows - that's a valid reason if you don't want to use
a hardware load-balancer, and plenty of folks load-balance that way,
including some quite large sites with quite demanding SLAs.  Just make
sure you know what you're gaining by adding the extra system!

- Peter

-
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: Basic question - Ingterating Tomcat with Apache

2007-09-22 Thread albrecht andrzejewski

Quoting Peter Crowther [EMAIL PROTECTED]:



What are you doing that doesn't just need a vanilla Tomcat?


Peter... I plan to have a box, and I just think about pro and cons...

I think tomcat stand alone is
- easier to deploy.
And that's all.

I think apache as a front end is a more flexible and secure solution.
- if apache fails, tomcat is not affected
- if tomcat fails, apache can redirect request to another tomcat
- when you serve static content juste like image of your site and all  
static text part , javascripts, etc ( i mean... dynamic content is  
often just an hour ticking at the top of the page!) apche can better  
handle the request and serve them quickier (with cache).


Am i wrong ?  As i have currently nothing pre-installed on it... and  
it would be fine to know what you are thinking about it. You seem to  
be pro vanilla tomcat... But just let us know WHEN pure tomcat has to  
be choosen !

I need an expert point of view, so tell us about what you experienced !

Thanks :-)


Ce message a ete envoye par le serveur IMP de l'EMA.



-
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: Basic question - Ingterating Tomcat with Apache

2007-09-21 Thread Peter Crowther
 From: Tata, Jagadeesh [mailto:[EMAIL PROTECTED] 
 I installed tomcat 6.0.13 on Solaris SPARC. Which is the 
 better (suited)
 version of Apache and Apache connector for installed Tomcat?

If you don't already have Apache on the box, please ask yourself this
question first:

Why do I need Apache httpd?

What are you doing that doesn't just need a vanilla Tomcat?

- Peter

-
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: Basic question - Ingterating Tomcat with Apache

2007-09-21 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Jagadeesh,

Tata, Jagadeesh wrote:
 I installed tomcat 6.0.13 on Solaris SPARC. Which is the better (suited)
 version of Apache and Apache connector for installed Tomcat?

The version of Apache httpd you choose is up to you and depends more on
your own environment requirements than anything else. If I were you, I'd
use Apache httpd 2.2 if possible.

The only supported Tomcat web server connector is mod_jk, which works
for all reasonably current Apache httpd versions (1.3, 2.0, and 2.2)

Peter asks a valuable question: are you sure you even /need/ Apache httpd?

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFG9AJp9CaO5/Lv0PARAgTeAJ45Dl7iHhEgCYytWCYd5yDgAbeyywCguawS
fVRPj7ucrx4AOAkKF9IM6e8=
=GQ2s
-END PGP SIGNATURE-

-
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: Basic question - Ingterating Tomcat with Apache

2007-09-21 Thread Hassan Schroeder
On 9/21/07, Christopher Schultz [EMAIL PROTECTED] wrote:

  are you sure you even /need/ Apache httpd?

I concur with that, but...

 The only supported Tomcat web server connector is mod_jk

There's mod_proxy_ajp and mod_proxy_http, eh?

-- 
Hassan Schroeder  [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: Basic question - Ingterating Tomcat with Apache

2007-09-21 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hassan,

Hassan Schroeder wrote:
 On 9/21/07, Christopher Schultz [EMAIL PROTECTED] wrote:
 The only supported Tomcat web server connector is mod_jk
 
 There's mod_proxy_ajp and mod_proxy_http, eh?

Aah, forgive me. I tend to think of mod_proxy_ajp as part of the Apache
httpd, and not really a connector. But, you're right: they are
equivalent components.

I believe mod_proxy_ajp requires Apache httpd 2.2, right?

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFG9BaV9CaO5/Lv0PARAkAdAJ9YMBqBhwKmIWfP/me556bJiFz0qACeJcNW
bBycWu2NzHk5ijFT6hUnsjU=
=02DV
-END PGP SIGNATURE-

-
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: Basic question - Ingterating Tomcat with Apache

2007-09-21 Thread Hassan Schroeder
On 9/21/07, Christopher Schultz [EMAIL PROTECTED] wrote:

 I believe mod_proxy_ajp requires Apache httpd 2.2, right?

Yep. But it's definitely less work to set up, if you don't need to split
static and dynamic content.

-- 
Hassan Schroeder  [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: basic question regarding BASIC and FORMS logins

2006-03-13 Thread Khawaja Shams
Hello,
I thought the topic was relevant, and the people involved in this
discussion would know the answer.  I did not know this is considered
hijacking a thread.  I appologize for the inconvenience, and I will repost
in a new thread.

Khawaja

On 3/9/06, David Smith [EMAIL PROTECTED] wrote:

 You could start by not hijack an existing thread.  Please repost your
 question in a new thread.

 --David

 Khawaja Shams wrote:

 Hello,
If I am using BASIC authentication, how can I log users out? I tried
 doing session.Invalidate, but as described above, it seems like the
 browser
 is caching the credentials.  I would like my app users to be able to log
 out.  I would sincerely appreciate any guidance.
 
 Khawaja
 
 
 On 3/8/06, David Smith [EMAIL PROTECTED] wrote:
 
 
 An idea I've also seen floated is to have javascript keep refreshing a
 small transparent image every so often.  I've never tried it, but it
 shows up frequently as a solution in google.  Benefit is you have
 indefinite session life without a lot of dead session clutter.
 
 --David
 
 Richard Mixon wrote:
 
 
 
 Dennis,
 For just that webapp, you can always bump the session timeout to a very
 
 
 high
 
 
 value.
 That would just take a change to the web.xml, no change of
 authentication
 method needed.
 HTH - Richard
 
 -Original Message-
 From: Klotz Jr, Dennis [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, March 08, 2006 3:54 PM
 To: Tomcat Users List
 Subject: basic question regarding BASIC and FORMS logins
 
 Greetings all,
 
 I'm trying to get my facts straight, and I'm hoping you will help.
 
 I am using forms based login right now and when the tomcat session
 times
 out, the user has to login again. No surprise there.
 
 Now, some of our customers don't like this, so for them - can I use a
 
 
 BASIC
 
 
 login (with SSL possibly) and their user will always be able to use the
 session as long as the browser doesn't go away. This is even if the
 
 
 tomcat
 
 
 session expires!
 
 Is that right?
 
 
 Regards,
 
 -Dennis Klotz
 
 
 -
 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]




Re: basic question regarding BASIC and FORMS logins

2006-03-09 Thread David Smith
You could start by not hijack an existing thread.  Please repost your
question in a new thread.

--David

Khawaja Shams wrote:

Hello,
   If I am using BASIC authentication, how can I log users out? I tried
doing session.Invalidate, but as described above, it seems like the browser
is caching the credentials.  I would like my app users to be able to log
out.  I would sincerely appreciate any guidance.

Khawaja


On 3/8/06, David Smith [EMAIL PROTECTED] wrote:
  

An idea I've also seen floated is to have javascript keep refreshing a
small transparent image every so often.  I've never tried it, but it
shows up frequently as a solution in google.  Benefit is you have
indefinite session life without a lot of dead session clutter.

--David

Richard Mixon wrote:



Dennis,
For just that webapp, you can always bump the session timeout to a very
  

high


value.
That would just take a change to the web.xml, no change of authentication
method needed.
HTH - Richard

-Original Message-
From: Klotz Jr, Dennis [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 08, 2006 3:54 PM
To: Tomcat Users List
Subject: basic question regarding BASIC and FORMS logins

Greetings all,

I'm trying to get my facts straight, and I'm hoping you will help.

I am using forms based login right now and when the tomcat session times
out, the user has to login again. No surprise there.

Now, some of our customers don't like this, so for them - can I use a
  

BASIC


login (with SSL possibly) and their user will always be able to use the
session as long as the browser doesn't go away. This is even if the
  

tomcat


session expires!

Is that right?


Regards,

-Dennis Klotz


-
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]



Re: basic question regarding BASIC and FORMS logins

2006-03-08 Thread David Smith
Kind of.  With BASIC auth, the session from the server's perspective can
still go away.  But as the browser caches the credentials, new session
creation is automatic.  The end user experience depends on the data
stored in the session, webapp design, and where they were when they
abandon the previous session.

--David

Klotz Jr, Dennis wrote:

Greetings all,
 
I'm trying to get my facts straight, and I'm hoping you will help.
 
I am using forms based login right now and when the tomcat session times
out, the user has to login again. No surprise there.
 
Now, some of our customers don't like this, so for them - can I use a
BASIC login (with SSL possibly) and their user will always be able to
use the session as long as the browser doesn't go away. This is even if
the tomcat session expires!
 
Is that right?
 
 
Regards,
 
-Dennis Klotz


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

  



-- 
===
David Smith
Network Operations Supervisor
Department of Entomology
College of Agriculture  Life Sciences
Cornell University
2132 Comstock Hall
Ithaca, NY  14853
Phone: 607.255.9571
Fax: 607.255.0939


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



RE: basic question regarding BASIC and FORMS logins

2006-03-08 Thread Klotz Jr, Dennis
David,

Thanks for replying.

In our case the application business logic is not storing critical
information in session beans etc. So using the BASIC would be ok. 

Is it possible to get the same behavior from a FORMS based login, in
that it keeps the login credentials and when the client makes a request,
tomcat opens a new session? I'm pretty sure the answer is no.


Regards,

-Dennis Klotz

 

-Original Message-
From: David Smith [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, March 08, 2006 6:07 PM
To: Tomcat Users List
Subject: Re: basic question regarding BASIC and FORMS logins

Kind of.  With BASIC auth, the session from the server's perspective can
still go away.  But as the browser caches the credentials, new session
creation is automatic.  The end user experience depends on the data
stored in the session, webapp design, and where they were when they
abandon the previous session.

--David

Klotz Jr, Dennis wrote:

Greetings all,
 
I'm trying to get my facts straight, and I'm hoping you will help.
 
I am using forms based login right now and when the tomcat session
times
out, the user has to login again. No surprise there.
 
Now, some of our customers don't like this, so for them - can I use a
BASIC login (with SSL possibly) and their user will always be able to
use the session as long as the browser doesn't go away. This is even if
the tomcat session expires!
 
Is that right?
 
 
Regards,
 
-Dennis Klotz


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

  



-- 
===
David Smith
Network Operations Supervisor
Department of Entomology
College of Agriculture  Life Sciences
Cornell University
2132 Comstock Hall
Ithaca, NY  14853
Phone: 607.255.9571
Fax: 607.255.0939


-
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: basic question regarding BASIC and FORMS logins

2006-03-08 Thread Richard Mixon
Dennis,
For just that webapp, you can always bump the session timeout to a very high
value. 
That would just take a change to the web.xml, no change of authentication
method needed.
HTH - Richard

-Original Message-
From: Klotz Jr, Dennis [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, March 08, 2006 3:54 PM
To: Tomcat Users List
Subject: basic question regarding BASIC and FORMS logins

Greetings all,
 
I'm trying to get my facts straight, and I'm hoping you will help.
 
I am using forms based login right now and when the tomcat session times
out, the user has to login again. No surprise there.
 
Now, some of our customers don't like this, so for them - can I use a BASIC
login (with SSL possibly) and their user will always be able to use the
session as long as the browser doesn't go away. This is even if the tomcat
session expires!
 
Is that right?
 
 
Regards,
 
-Dennis Klotz


-
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: basic question regarding BASIC and FORMS logins

2006-03-08 Thread David Smith
An idea I've also seen floated is to have javascript keep refreshing a
small transparent image every so often.  I've never tried it, but it
shows up frequently as a solution in google.  Benefit is you have
indefinite session life without a lot of dead session clutter.

--David

Richard Mixon wrote:

Dennis,
For just that webapp, you can always bump the session timeout to a very high
value. 
That would just take a change to the web.xml, no change of authentication
method needed.
HTH - Richard

-Original Message-
From: Klotz Jr, Dennis [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, March 08, 2006 3:54 PM
To: Tomcat Users List
Subject: basic question regarding BASIC and FORMS logins

Greetings all,
 
I'm trying to get my facts straight, and I'm hoping you will help.
 
I am using forms based login right now and when the tomcat session times
out, the user has to login again. No surprise there.
 
Now, some of our customers don't like this, so for them - can I use a BASIC
login (with SSL possibly) and their user will always be able to use the
session as long as the browser doesn't go away. This is even if the tomcat
session expires!
 
Is that right?
 
 
Regards,
 
-Dennis Klotz


-
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]



Re: basic question regarding BASIC and FORMS logins

2006-03-08 Thread Khawaja Shams
Hello,
   If I am using BASIC authentication, how can I log users out? I tried
doing session.Invalidate, but as described above, it seems like the browser
is caching the credentials.  I would like my app users to be able to log
out.  I would sincerely appreciate any guidance.

Khawaja


On 3/8/06, David Smith [EMAIL PROTECTED] wrote:

 An idea I've also seen floated is to have javascript keep refreshing a
 small transparent image every so often.  I've never tried it, but it
 shows up frequently as a solution in google.  Benefit is you have
 indefinite session life without a lot of dead session clutter.

 --David

 Richard Mixon wrote:

 Dennis,
 For just that webapp, you can always bump the session timeout to a very
 high
 value.
 That would just take a change to the web.xml, no change of authentication
 method needed.
 HTH - Richard
 
 -Original Message-
 From: Klotz Jr, Dennis [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, March 08, 2006 3:54 PM
 To: Tomcat Users List
 Subject: basic question regarding BASIC and FORMS logins
 
 Greetings all,
 
 I'm trying to get my facts straight, and I'm hoping you will help.
 
 I am using forms based login right now and when the tomcat session times
 out, the user has to login again. No surprise there.
 
 Now, some of our customers don't like this, so for them - can I use a
 BASIC
 login (with SSL possibly) and their user will always be able to use the
 session as long as the browser doesn't go away. This is even if the
 tomcat
 session expires!
 
 Is that right?
 
 
 Regards,
 
 -Dennis Klotz
 
 
 -
 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]