aspose file tools*
The moose likes Servlets and the fly likes About production server and Servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "About production server and Servlet" Watch "About production server and Servlet" New topic
Author

About production server and Servlet

roshan ingole
Greenhorn

Joined: Aug 18, 2001
Posts: 12
Hello techies,
Will you tell me what is production server and what is a relation between Production Server and Servlets.
In advance thanks....
-Roshan :">
chanoch wiggers
Author
Ranch Hand

Joined: May 24, 2001
Posts: 245
a production server is the opposite of a development server ( also known as the production environment vs the development environment, aka system, machine, computer)
it just means real code that is working as opposed to code that you are developing. Production code should be stable, free from bugs (hah), and generally the kind of code that would cause you problems if it went wrong.

chanoch<p><a href="http://www.amazon.com/exec/obidos/ASIN/1861007736/" target="_blank" rel="nofollow">Author of Professional Apache Tomcat</a></p>
roshan ingole
Greenhorn

Joined: Aug 18, 2001
Posts: 12
Thanks chanoch,
will you explain that concept of production server and development server with example, and in relation with servlet and business logic. And in that where our servlet container resides.
- Roshan
christine lorraine
Greenhorn

Joined: Sep 03, 2001
Posts: 20
the production server is where you place your
web application which will be available to the end users
while the development server is where you do the coding and
perform the necessary debugging. so that when you place it
in the production server, your web application will have
minimal errors.
the business logic refers to the operations of an enterprise.
these are the transactions performed by a particular group.
Servlets are used typically to contain the business logic so we
can separate the user interface(html pages) from the processes
like inserting data to a database, validating user inputs etc.
Servlets are contained in a server.
i hope this will give u an idea
----
will you explain that concept of production server and development server with example, and in relation with servlet and business logic. And in that where our servlet container resides.
christine lorraine
Greenhorn

Joined: Sep 03, 2001
Posts: 20
the production server is where you place your
web application which will be available to the end users
while the development server is where you do the coding and
perform the necessary debugging. so that when you place it
in the production server, your web application will have
minimal errors.
the business logic refers to the operations of an enterprise.
these are the transactions performed by a particular group.
Servlets are used typically to contain the business logic so we
can separate the user interface(html pages) from the processes
like inserting data to a database, validating user inputs etc.
Servlets are contained in a server.
i hope this will give u an idea
----
will you explain that concept of production server and development server with example, and in relation with servlet and business logic. And in that where our servlet container resides.
roshan ingole
Greenhorn

Joined: Aug 18, 2001
Posts: 12
Thanks christine,
It helps me to understand what is exactly production and development server and business logic and servlet.
But now I have a one question in my mind that where we use exactly SINGLE THREAD Model
chanoch wiggers
Author
Ranch Hand

Joined: May 24, 2001
Posts: 245
single threaded mode means that your servlet or jsp accepts requests one at a time. What that means is that interrupting your servlet half way through its work and then starting the work later on would cause problems to the code and would change the output.
Ideally you should design your applications so that you dont have to implement single threaded mode. Servlets that are not single threaded are called thread-safe (nothing to do with Anne McCaffrey). That means that you can have more than one copy of your servlet so that more requests can be handled at any given time
chanoch
roshan ingole
Greenhorn

Joined: Aug 18, 2001
Posts: 12
Originally posted by chanoch wiggers:
Ideally you should design your applications so that you dont have to implement single threaded mode. Servlets that are not single threaded are called thread-safe (nothing to do with Anne McCaffrey). That means that you can have more than one copy of your servlet so that more requests can be handled at any given time

chanoch,
you told that single thread servlets are not thread safe, but as there is a service() method present and servlet initializes once due to init() and for each next request then service() method invokes (if I am not wrong), then what is the condition related with this senario in single thred mode either before service() method started that thread will be interrupted.

Rishi Singh
Ranch Hand

Joined: Dec 09, 2000
Posts: 321
Dear Roshan,
when we say a servlet to be threadsafe, it means only one request thread can run within the service()method.This is normally achieved by implementing the singlethreaded model,by default servlets are not thread safe i.e the service () caters to more than one requests and allocates seperate threads to each request.so implementing single-threaded model in a way is nothing but obtaining the object lock for that particular instance(the object reference variable gets synchronized).But this interface doesn't gaurantee ...I mean this scenario can go wrong if u have a static memeber variable in your servlet doGet() or doPost()method.
Normally if u r implementing the single threaded model the container creates a pool of instances and allocates these instances to seperate requests ,now in this situtaion if u have a static memeber variable,it is shared by all the instances...so its no longer remains thread safe.
Rishi Singh
Ranch Hand

Joined: Dec 09, 2000
Posts: 321
dear roshan,
when we say thread safe it means that the service method() is going to handle only one request at a time (this is to be implemented when u r having non local variables in your servelet and u sense that if its is accessed by mutiple threads data may tend to loose its integrity).But just implementing single threded model does not guarantee your servlet to be thread-safe(by default servlets are thread-safe).This may happen when u r having a static member variable in your servlet.The servlet container normally creates a pool of instances when u r implementing single threaded model and allocates each request one instance...in this case if u r having a static variable...which means it is shared between all the instances,so ur servlet no longer remains thread safe even after implementing single threded model.
So the bottom line is u should implement this interface when u want ur data to be secured (remember this data should not be static) .
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: About production server and Servlet