Servlet Programming Restrictions

Discussions

Web tier: servlets, JSP, Web frameworks: Servlet Programming Restrictions

  1. Servlet Programming Restrictions (1 messages)

    I am confused about the applicability (or non-applicability) of several programming restrictions in the servlet container. I am hoping that someone can shed some light on the issue for me.

    Based on various articles I have read, discussion posts, etc, I have had the understanding that it was 'illegal' in servlets to:
    - open your own socket or http connection and communicate with another server
    - create threads
    - read/write files

    However, after reviewing the servlet spec itself, these activities don't seem to be restricted.

    Are in fact these activities restricted for servlets? Any illumination you can provide on this issue would be appreciated.
  2. These are EJB restrictions[ Go to top ]

    The restrictions you enumarated are spread as "EJB restrictions", not Servlets.

    The only restriction of Servlets is : They are not thread-safe. That means that same INSTANCE of a servlet can serve multiple HTTP request.

    You have to keep this in mind while writing Servlets.