aspose file tools*
The moose likes Servlets and the fly likes Question on core concepts of servlets/jsp Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Question on core concepts of servlets/jsp" Watch "Question on core concepts of servlets/jsp" New topic
Author

Question on core concepts of servlets/jsp

Mikhail Jennings
Greenhorn

Joined: Nov 10, 2010
Posts: 1
Hi,

I wanted to know how to design servlets/jsp based web applications to handle many users.
What I am looking for is resources where I can learn the basics and advanced know-how of multithreaded servlet apps and how to code and design them.


thanks
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60045
    
  65

Pretty simple really:
  • Write your servlets to be thread-safe. This primarily means avoid instance and read-write static variables.
  • Be mindful of of simultaneous read-write access to session and application scoped variables.
  • Write JSPs using modern standards (no Java code in them) and they pretty much take care of themselves.


  • There are nuances, but that'll get you 99.5% there.


    [Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
    Malatesh Karabisti
    Ranch Hand

    Joined: Jul 28, 2010
    Posts: 153

    Dude seems like you are just starting with your Servlet/Jsp. my advice is don't directly jump to Design of your application. Try some "Hello world" application you will get good hold of basics.
    Ben Souther
    Sheriff

    Joined: Dec 11, 2004
    Posts: 13410

    +1 to both of the previous responses.

    Just to reiterate, the servlet spec was designed from day one with to be multi-user / multi-threaded so, as long as you avoid some of the common issues (primarily the use of instance or non-final static variables) your app -- at least the front end-- will automatically be multi-user. If you're app works with a shared resource such as a relational database, then you'll have to consider what could happen if two people try to access it at the same time.

    Like Malatesh said, have fun with some simple stuff first.


    Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
     
    I agree. Here's the link: http://aspose.com/file-tools
     
    subject: Question on core concepts of servlets/jsp
     
    Similar Threads
    Exceptions back from Server
    Best book for Struts
    DAO Pattern & Head First Series
    Discussion: Project Manage System
    Design Patterm Doubt