Skip to main content

Everything About Apache Tomcat Server

Apache HTTP Server and Tomcat Server (Servlet container with JSP Environment) both reconcile to form Apache Tomcat Server.Apache HTTP Server Serves only Static content e.g. HTML,Images.But Tomcat Server Servers Static as well as Dynamic content e.g. Servlet in Java
So you may ask why are we using Apache Tomcat Server and why not Tomcat only?Actually you can but there are some side where Tomcat is lagging,these are
  •       Tomcat is not as fast as Apache when it comes to static Pages
  •       Tomcat is not as configurable as Apache
  •       Tomcat is not as robust as Apache
Hence in real world ,people uses Apache for static content and Tomcat as Servlet/JSP Add-On.That is Apache Tomcat Server.
There are some question about working of Apache tomcat Server and its one WORD answer,
  1. How will Apache know which request should be forwarded to Tomcat?                            Ans:  httpd.conf
  2. How will apache forward request to Tomcat?                                                                     Ans:   Web server Adaptor library(mod_jk)
  3. How will tomcat Accept and Handle these request?                                                          Ans: server.xml
  4. How will Hosted Application Runs On Server?                                                                  Ans: web.xml
Tomcat Worker is a Tomcat Instance that is waiting to execute servlet on behalf of web server e.g. Apache server.Single server has multiple Applications (Context) Hosted, each Context has Tomcat Worker assigned.

I misses the point that mostly people may jumble you by saying Catallina.What is Catallina?.When you start tomcat Server, you are actually starting Catalina.Catalina is the nothing but the server environment consists of connector and container.It is module of two Connector and Container.
Connector that accept request and sends response’s like a door keeper.Container actually process that Request and response.To change Catalina Behavior that Server default settings, we have six configuration files

1. catalina.policy                -  Tomcat security policy for Catalina Java Class
2. catalina.properties         -  properties for Catalina class and cache setting for performance tuning
3. logging. Properties        -  logger settings
4. content.xml                    - tomcat context information that will loaded for every application running in given instance of tomcat
5. servlet.xml                     - main and global configuration file,containf configuration of various componets
6. tomcat-users.xml          - authentication for tomcat
7. Web.xml                         - configuration for all application that are loaded in tomcat

Catalina.Out is standard destination log file for System.Out and System.err that print information and errors in JVM.

Sources:
http://tomcat.apache.org/tomcat-3.2-doc/tomcat-apache-howto.html

Popular posts from this blog

Share data between Iframe and its Parent using JQuery

There could be requirement that you have to pass variables values to Iframe from parent or in other scenario you have to pass values from Iframe to its parent.I am going to show simple example of above situation with the help of JQuery.
           Support we have parent HTML page having iframe included like below

<html> <body> <input id="parentValue" type="text" value="I am from Parent !" /> <iframe src="domainurl/relativepath" id="iframe"></iframe> <script> $(document).ready(function() { //code to take value from child iframe var childValue = $("#iframe").contents().find("#childValue").val(); alert(childValue); }); </script> </body> </html> 
        and we have frame code like below
<html> <body> <input id="childValue" type="text" value="I …

Get Browser Name and Version in Javascript

JQuery stopped providing $.browser function after 1.9 release.So you have to write your own code to get know browser and its version.There is not standard procedure or code to achieve this.
But I will show you to get browser name and version of  IE > 6, Google Chrome And FF.

Here we have AGENT to rescue.Every browser has navigation object available in its script.In this object userAgent field contains current browser information.

So you can ask me What is User-Agent?How will it help us?
          As I said earlier it contain browser information.There is not standard to show each information but almost every browser support it.
    There is complicated history behind user-agent variable.But in simple sense we can say that user-agent is used by server side component to get information of client-side browser and its compatibility to page it will going to rendered.So we conclude that this user-agent information is little bit 50% same in all browser.

Why is it(user-agent) 50% s…

Spring Default Limit for Collection and Array is 256

If you are working in Web Application Development then you may stuck or already had ,then you will get mad of getting this error


java.lang.ArrayIndexOutOfBoundsException:Arrayindexoutofrange256
How this error emanates in Spring?

i will explain you with example.Suppose you are adding Values in List in JSP using JSTL tag or other.
This list is in Form(HTML).When you POST this form,In behind Stage,Spring does binding of Object and List if present.

But wait...
In Spring,Default limit for array and collection growing is 256.

Why this limit is Set?

seldom you have to send List size greater than this limit.
Spring has set this limit to avoid notable OutOfMemoryErrors in case of large indexes.

So,than What if i want to set Collection greater than this size?

I had told earlier,spring does binding behind.If we tell spring to increase it's size or set collection size behalf of spring.
You you can do it.

We have initBinder,  in Spring  it is called when spring does the binding mechanism
e.g @Mod…