• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

Question on core concepts of servlets/jsp

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Sheriff
Posts: 67752
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
     
    Ranch Hand
    Posts: 153
    Oracle Java
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    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.
     
    Sheriff
    Posts: 13411
    Firefox Browser VI Editor Redhat
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    +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.
     
    No, tomorrow we rule the world! With this tiny ad:
    Gift giving made easy with the permaculture playing cards
    https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
    reply
      Bookmark Topic Watch Topic
    • New Topic