You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Max R. Andersen" <ma...@cs.auc.dk> on 2000/07/03 12:13:20 UTC

"Design patterns" for servlets (or cgi in general)

Hi!

Does anyone here know of some pages describing good "design patterns" for servlets/cgi ?

Im especailly looking for techniques and arguments for and against the following issues:

How should parameters to servlets be represented in urls ?
 As standard cgi-parameters as in ?param1=value1&param2=value2 or as part of the path in the URL ?
 What are the arguments for and against this ? With the parameters as part of the path it is easy(easier?)
 to generate a static version of the web (which I would like to have as an option)

How should sessions be handled ?
 Via cookies ?
  Disadvantage: Not all people (and clients) like cookies.
  Advantage: easy - does not require url rewriting.
 URL rewriting ?
  Disadvantage: Requires rewrite of all urls - How can one handle this for e.g. static html-files at the server which has to remain the state ?
  Advantage: People and all clients can handle this - it only require appending a id to the url

What should and should not be stored in session-objects ?
  

With hope and thanks :)

-- 
Max R. Andersen (max@cs.auc.dk)

Re: Tomcat 3.1 shutting down connection?

Posted by Markus Nietfeld <ni...@agentscape.de>.
I tried the 3.2 beta 1 but didn't get it to work. Besides, we have to
finish the project soon (business as usual ;) and I really would like to
use a final/stable version of Tomcat. If anyone could point me to the
class(es) where the bug was fixed, I might be able to apply the bugfix
myself...

Thanks for any hints,
Markus.

Alex Chaffee wrote:
> 
> That bug should be fixed in the current CVS tree.  Please download it
> (or wait for 3.2 beta 1, which should be out within a week) and see if
> it solves your problem.
> 
>  - A
> 
> > java.net.SocketException: Connection reset by peer
> >         at java.net.PlainSocketImpl.accept(PlainSocketImpl.java:423)
> >         at java.net.ServerSocket.implAccept(ServerSocket.java:191)
> >         at java.net.ServerSocket.accept(ServerSocket.java:174)
> >         at
> > org.apache.tomcat.service.SimpleTcpEndpoint.acceptSocket(SimpleTcpEndpoint.java:267)
> >         at
> > org.apache.tomcat.service.SimpleTcpEndpoint.acceptConnections(SimpleTcpEndpoint.java:248)
> >         at
> > org.apache.tomcat.service.TcpListenerThread.run(SimpleTcpEndpoint.java:319)
> >         at java.lang.Thread.run(Thread.java)
> > Endpoint ServerSocket[addr=0.0.0.0/0.0.0.0,port=0,localport=8080]
> > shutdown due to exception: java.net.SocketException: Connection reset by
> > peer
> >

-- 
Dipl.-Inform. Markus Nietfeld
Software Development
PopNet Agentscape AG (http://www.popnet-agentscape.de)
Kaiserin-Augusta-Allee 10-11, D-10553 Berlin
fon: ++49-30-5900478-27, fax: ++49-30-5900478-99

Re: Tomcat 3.1 shutting down connection?

Posted by Alex Chaffee <gu...@edamame.stinky.com>.
That bug should be fixed in the current CVS tree.  Please download it
(or wait for 3.2 beta 1, which should be out within a week) and see if
it solves your problem.

 - A

On Thu, Jul 06, 2000 at 07:19:11PM +0200, Markus Nietfeld wrote:
> Hi folks,
> 
> we are evaluating Tomcat 3.1 for a customer project, where we use open
> HTTP connections as push channel to the client browser. Thus, Tomcat is
> listening at port 8080 as standalone HTTP server. It seems to be pretty
> stable, but from time to time we get the following exception:
> 
> java.net.SocketException: Connection reset by peer
>         at java.net.PlainSocketImpl.accept(PlainSocketImpl.java:423)
>         at java.net.ServerSocket.implAccept(ServerSocket.java:191)
>         at java.net.ServerSocket.accept(ServerSocket.java:174)
>         at
> org.apache.tomcat.service.SimpleTcpEndpoint.acceptSocket(SimpleTcpEndpoint.java:267)
>         at
> org.apache.tomcat.service.SimpleTcpEndpoint.acceptConnections(SimpleTcpEndpoint.java:248)
>         at
> org.apache.tomcat.service.TcpListenerThread.run(SimpleTcpEndpoint.java:319)
>         at java.lang.Thread.run(Thread.java)
> Endpoint ServerSocket[addr=0.0.0.0/0.0.0.0,port=0,localport=8080]
> shutdown due to exception: java.net.SocketException: Connection reset by
> peer
> 
> After that, Tomcat is not reachable anymore, although the servlets
> inside still seem to be alive (pingable via RMI).
> 
> We have installed Tomcat 3.1 Final on a Linux Kernel 2.2.14, using IBM's
> JDK 1.1.8. We are using Tomcat's SimpleTcpConnector. I did not play yet
> with the PoolConnector and the JVM optimizations mentioned in the User's
> Guide, but I can hardly imagine that this problem is connected to not
> using a threadpool (as we are only three people testing simultaneously
> ;)
> 
> Does anyone have similar experiences?
> Thanks for any help,
> Markus.
> 
> -- 
> Dipl.-Inform. Markus Nietfeld
> Software Development
> PopNet Agentscape AG (http://www.popnet-agentscape.de)
> Kaiserin-Augusta-Allee 10-11, D-10553 Berlin
> fon: ++49-30-5900478-27, fax: ++49-30-5900478-99

-- 
Alex Chaffee                       mailto:alex@jguru.com
jGuru - Java News and FAQs         http://www.jguru.com/alex/
Creator of Gamelan                 http://www.gamelan.com/
Founder of Purple Technology       http://www.purpletech.com/
Curator of Stinky Art Collective   http://www.stinky.com/

Tomcat 3.1 shutting down connection?

Posted by Markus Nietfeld <ni...@agentscape.de>.
Hi folks,

we are evaluating Tomcat 3.1 for a customer project, where we use open
HTTP connections as push channel to the client browser. Thus, Tomcat is
listening at port 8080 as standalone HTTP server. It seems to be pretty
stable, but from time to time we get the following exception:

java.net.SocketException: Connection reset by peer
        at java.net.PlainSocketImpl.accept(PlainSocketImpl.java:423)
        at java.net.ServerSocket.implAccept(ServerSocket.java:191)
        at java.net.ServerSocket.accept(ServerSocket.java:174)
        at
org.apache.tomcat.service.SimpleTcpEndpoint.acceptSocket(SimpleTcpEndpoint.java:267)
        at
org.apache.tomcat.service.SimpleTcpEndpoint.acceptConnections(SimpleTcpEndpoint.java:248)
        at
org.apache.tomcat.service.TcpListenerThread.run(SimpleTcpEndpoint.java:319)
        at java.lang.Thread.run(Thread.java)
Endpoint ServerSocket[addr=0.0.0.0/0.0.0.0,port=0,localport=8080]
shutdown due to exception: java.net.SocketException: Connection reset by
peer

After that, Tomcat is not reachable anymore, although the servlets
inside still seem to be alive (pingable via RMI).

We have installed Tomcat 3.1 Final on a Linux Kernel 2.2.14, using IBM's
JDK 1.1.8. We are using Tomcat's SimpleTcpConnector. I did not play yet
with the PoolConnector and the JVM optimizations mentioned in the User's
Guide, but I can hardly imagine that this problem is connected to not
using a threadpool (as we are only three people testing simultaneously
;)

Does anyone have similar experiences?
Thanks for any help,
Markus.

-- 
Dipl.-Inform. Markus Nietfeld
Software Development
PopNet Agentscape AG (http://www.popnet-agentscape.de)
Kaiserin-Augusta-Allee 10-11, D-10553 Berlin
fon: ++49-30-5900478-27, fax: ++49-30-5900478-99