Series Tomcat

Programming with JSPs
Introduction: servers and servlet containers / JSPs
Servlets and Java Server Pages (JSPs) are two methods for creating dynamic web server using the Java language. In that sense are similar to other methods or languages such as PHP, the CGI (common gateway interface), programs that generate web pages on the server, or ASP (Active Server Pages), a specific method of Microsoft. However, they differ from them in other things.
For starters, JSPs and servlets running on a Java virtual machine, which allows, in principle, can be used on any computer, provided a Java virtual machine for him. Each servlet (or JSP, from now on we will use interchangeably) runs in its own thread, that is, in its own context, but do not begin to run each time it receives a request, but persists to a request to the next, so that no time is lost in putting it forward (loading program + interpreter). Their persistence also allows you to make a number of things more efficiently: database connection and session management, for example. The JSPs are actually servlets: a JSP is compiled to a Java program the first time it is called, and the Java program creates a class that begins to run on the server as a servlet. The main difference between servlets and JSPs is the approach to programming: a JSP is a Web page with special tags and embedded Java code, while a servlet is a program that receives requests and generates from them a web page.
Both need a program that contains, and whatever it actually send web pages to the server, and receive petitions, circulated among the servlets, and perform all management tasks specific to a web server. While servers like Apache are specially designed for static web pages CGI, and programs implemented by the server, such as PHP, there are other specific servers for servlets and JSPs called servlet containers (servlet containers) or servlet engines. The main are:
- Resin, Rubber Technologies , a unit specifically focused on the XML pages service with a free license for developers. It claims to be quite fast. Javascript also includes support for Java. It also includes a template language called XTP. It’s pretty easy to install, and in two minutes, you can begin to serve JSP pages.
- BEA Weblogic application server is a high-level and high price. It is written entirely in Java, and is combined with another series of products such as Tuxedo, a database server for XML.
- JRun, Macromedia , a Java application server, mid-priced and probably average benefits. You can download a free trial
- Enhydra lutris, another server Free and Open Source, although it has a paid version. Also focused to serve XML, and mobile platforms. The latest versions are extra, of course
- The most popular, Open Source, and continually evolving, is the Jakarta Tomcat , Apache consortium, a servlet container around with many additional developments, such as Cocoon to serve XML pages. Can serve pages only or as an addition to the Apache server. Open Source is relatively fast, and easy to install. The current version is the 4.0.3 , but keep coming versions of the three.
Installing a servlet container :
Let’s see how to install a servlet container. We will look especially at the Tomcat version 4.0, although counts as valid for most other open source containers. The payment will probably have to install a posh interface, based on little buttons, or are very expensive, there will come a man with a tie and leather case for it, so that those we do not care.
Before I ever get off the program in question, one must consider in advance the Java virtual machine that we use to execute it. All are written in Java, so this is essential. Primarily, there are two options: the Sun JVM (who are the original) or IBM, which are somewhat faster but not always updated to the latest version. A servlet container you need the full JDK, not just the runtime environment, mainly by the Java compiler contained in a file called tools.jar. In any case, we can download the Sun JVM versions for Linux , or for any other platform (version 1.4) or version 1.3 of IBM (the most advisable) . Failure to achieve a version of these, it is advisable to get one that is compatible with the version “2″ of Java, ie JVMs from version 1.2. They may work with earlier versions, but most likely do not. Just Java is already installed in the system will verify that java and tools.jar are also installed, just try to run it, or ask your system administrator, who is also a creature of the breast and is entitled to direct someone the word, man.
After installing the JVM, we got the server for your site, if possible, in binary version, and compiled. If you have a Linux distro that uses RPM to install packages (like Mandrake, RedHat or SuSE), one may download the RPMs and install them directly. Depending on what you choose, will have to download only one package, or several. In any event, will include the following: Xerces-J, regexp, servletapi, tomcat-webapps and tomcat. If we lower the file. Tar.gz, is all inclusive. To install the RPM does the following:
Code: [yo@mimaquina]$ rpm -Uvh tomcat4-4.0.2-3.noarch.rpm This after having installed all the previous packages. If you have downloaded the tar:
Code: [yo@mimaquina]$ tar xvfz tomcat4-4.0.2.tar.gz Already unpacked, we will be ready to run Tomcat. Depending on how coding, we have the server in a directory or another, but there will always be directories conf, lib, bin and webapps. It is then necessary to say where is the Java virtual machine, tomcat.conf editing a file that is located in the conf directory (which will vary according to the distribution site, may be in / etc/tomcat4/conf or directory_del_tomcat / conf .) In other operating systems, or other type of installation, we must define an environment variable, like this:
Code: [yo@mimaquina]$ export JAVA_HOME=/opt/IBMJava2-13 or
Code: [yo@mimaquina]$ setenv JAVA_HOME /opt/IBMJava2-13
About the Author
http://install-how.blogspot.com/search?q=Guides
IRIS Pro Series F-14 Tomcat: Setting up for cruise and basic HSD familiarisation