JSP Tutorial





Español Français 中文 Deutsch Portuguese Japanese nederlands
   
 
JSP Tutorial
Introduction Introduction
Installing JDK-Windows Installing JDK-Windows
Installing JDK-Linux Installing JDK-Linux
Installing Tomcat Installing Tomcat
Simple Program in JSP Simple Program in JSP
Pre-defined Variables Pre-defined Variables
Syntax of Tags Syntax of Tags
JSP Expression Language JSP Expression Language
JSP EL Operators JSP EL Operators
EL Implicit Variables EL Implicit Variables
Scopes Scopes
Using Arrays Using Arrays
Methods Methods
JSP Elements JSP Elements
Including Beans Including Beans
JSTL Tags JSTL Tags
Custom Tags Custom Tags
Session Session in JSP
Handling Cookies Handling Cookies
JSP Application Structure JSP Application Structure
Configuring web.xml Configuring web.xml
Tomcat Configuration Tomcat Configuration
JSP Examples JSP Examples
Forums Ask Your Doubts
Feedback Feedback
 






outsourced web hosting support

Configuring Tomcat Server


Tutorials Jsp

Topic

How to configure a Tomcat Server for JSP web application?



Explanation
Configuring Tomcat Server:

A web application is executed using a WAR file or from a root directory with unpacked contents of a webapplication. Usually all this context information is contained in a "context.xml" file contained inside the "conf" folder.

Example:
    <Host>
         <Context path="/" reloadable="false" docBase="test/" />
    </Host>

In the above example the "Context path" is a unique path that is the default application. The docBase or Context Root specify the absolute path of the root directory "test", it can also have "WAR" file. If the attribute "reloadable" is set to "true" then it will make catalina to check the "WEB-INF" folders like "class", "lib" for changes. If a change is detected the web application is restarted. This has some issues with some web applications as it takes some time to load so that the default value is "false".

How set the Heap Size for Tomcat:

Heap size is the memory that is allocated by the Java Virtual Machine or JVM.It is set by using two parameters Xms and Xmx of JVM.

  • Stop the Tomcat server
  • Set the Environment variable CATILINA_OPTS as below
  • set CATALINA_OPTS="-Xms512m -Xmx512m"
  • This is done in catalina.bat or catallina.sh files.

The maximum size for the heap memory is "1024m" which is 1GB.

How to Restart an Application in Tomcat:

An application alone can be restarted by following the below instructions.

  • Open the url "http://localhost:8080/manager/html"
  • Type in the admin "username,password"
  • Now all the applications will be listed
  • Click the "reload" link to reload a specific application



A Note
JSP(Java Server Pages) is one of the most used Server Side Programming Language in the world. Simple introduction, basic program codes with examples. Begin coding your own JSP scripts with this online tutorial. Hope you enjoy this tutorial. Do send your feedback or suggestions on this JavaServer Pages tutorial. This is a copyright content.


Other Links

web hosting