Web Hosting Java, JSP, Tomcat 6, J2EE, Servlets, Struts, Jboss
Web hosting forum - JavaSercer Pages Pick a compression format that’s appropriate
November 28, 2006 on 5:33 am | In Java | No Comments JavaSercer Pages Pick a compression format that’s appropriate for your platform. For Windows, select jakarta-tomcat.zip and save it to your hard drive, for instance in a directory named C:Jakarta. You can unpack the package either with a ZIP utility program such as WinZip, or by using the jar command that’s included in the Java distribution. Using the Command Prompt window where you set the JAVA_HOME and PATH environment variables earlier, change directory to the directory where you downloaded the ZIP file and unpack it: C:> cd Jakarta C:Jakarta> jar xvf jakarta-tomcat.zip For Unix platforms, download the jakarta-tomcat.tar.gz file, for instance to /usr/local, and use these commands to unpack it (assuming you have GNU tar installed): [hans@gefion /] cd /usr/local [hans@gefion /usr/local] tar xzvf jakarta-tomcat.tar.gz If you don’t have GNU tar installed on your system, you can use this command: [hans@gefion /usr/local] gunzip -c jakarta-tomcat.tar.gz | tar xvf This creates a directory structure with a top directory named jakarta-tomcat with a number of subdirectories. Like most software packages, the doc subdirectory contains a file named Readme ; do exactly that. Software distributions change and if, for instance, the instructions in this chapter no longer apply when you download the software, the Readme file should contain information about how to get started. You also need to set the TOMCAT_HOME environment variable. For Windows, use: C:Jakarta> set TOMCAT_HOME=C:Jakartajakarta-tomcat For Unix, use: [hans@gefion /usr/local] export TOMCAT_HOME=/usr/local/jakarta-tomcat The jakarta-tomcat directory contains a number of subdirectories: bin Scripts for starting the Tomcat server. conf Tomcat configuration files. doc Documents describing how to install and start Tomcat. Other documentation is available as web pages once the server is started. lib Binary (platform-dependent) modules for connecting Tomcat to other web servers such as Apache. src The source code for all servlet and JSP specification classes and interfaces. webapps Default location for web applications served by Tomcat. No matter what your platform, the bin directory contains both Windows batch files and Unix scripts for starting and stopping the server. page 36
Note: If you are looking for inexpensive but high quality provider to host and run your jsp application check Astra jsp hosting services
JavaSercer Pages 4.2 Installing the Tomcat Server You (Hosting java)
November 27, 2006 on 10:25 pm | In Java | No Comments JavaSercer Pages 4.2 Installing the Tomcat Server You can download the Tomcat Server either in binary format or as source code that you compile yourself. If you’re primarily interested in learning about JSP, I recommend that you use the binary download to run the examples in this java blog and develop your own applications. If you’re a Java programmer and interested in seeing how Tomcat is implemented, feel free to download the source and take a look at the internals. The binary distribution is available at http://jakarta.apache.org/downloads/binindex.html On this page you find three types of builds: Release builds Milestone builds Nightly builds Release builds are stable releases that have been tested extensively and verified to comply with the servlet and JSP specifications. Milestone builds are created as intermediary steps towards a release build. They often contain new features that are not yet fully tested, but are generally known to work. A nightly build, however, may be very unstable. It’s actually a snapshot of the latest source code and may have been tested only by the person who made the latest change. You should use a nightly build only if you’re involved in the development of Tomcat. You should download the latest release build. All examples in this java blog were developed and tested using the 3.2 (Beta 3) version, but any release later than 3.2 should work fine as well. When you click on the link for the latest release build and select the bin directory, you see a list of archive files in different formats, similar to Figure 4.1. Figure 4.1. Release build packages page 35
Note: If you are looking for cheap and quality provider to host and run your java application check Astra java hosting services
Web hosting shopping cart - JavaSercer Pages Chapter 4. Setting Up the JSP
November 27, 2006 on 3:22 pm | In Java | No Comments JavaSercer Pages Chapter 4. Setting Up the JSP Environment this java blog contains plenty of examples to illustrate all the JSP features. All examples were developed and tested with the JSP reference implementation, known as the Apache Tomcat server, which is developed by the Apache Jakarta project. In this chapter you will learn how to install the Tomcat server and add a web application containing all the examples used in this java blog. You can, of course, use any web server that supports JSP 1.1, but Tomcat is a good server for development and test purposes. You can learn more about the Jakarta project and Tomcat, as well as how you can participate in the development, at the Jakarta web site: http://jakarta.apache.org. 4.1 Installing the Java Software Development Kit Tomcat is a pure Java web server with support for the Servlet 2.2 and JSP 1.1 specifications. To use it, you must first install a Java runtime environment. If you don’t already have one, you can download a Java SDK for Windows, Linux, and Solaris at http://java.sun.com/j2se/. I recommend that you install the Java 2 SDK as opposed to the slimmed-down Runtime Environment ( JRE) distribution. The reason is that JSP requires a Java compiler, which is included in the SDK but not in the JRE. Sun Microsystems has made the javac compiler from the SDK available separately for redistribution by the Apache Software Foundation. So technically, you could use the JRE and download the Java compiler as part of the Tomcat package, but even as I write this chapter, the exact legal conditions for distributing the compiler are changing. Another alternative is to use the Jikes compiler from IBM (http://www10.software.ibm.com/developerworks/opensource/jikes/ ). Tomcat can be configured to use Jikes instead of the javac compiler from Sun; read the Tomcat documentation if you would like to try this. To make things simple, though, I suggest installing the Java 2 SDK from Sun. The examples were developed and tested with Java 2 SDK, Standard Edition, v1.2.2 and v1.3. I recommend that you use the latest version of the SDK available for your platform. If you need an SDK for a platform other than Windows, Linux, or Solaris, there’s a partial list of ports made by other companies at Sun’s web site http://java.sun.com/cgi-bin/java-ports.cgi/ Also check your operating system vendor’s web site. Most operating system vendors have their own SDK implementation available for free. Installation of the SDK varies depending on platform but is typically easy to do. Just follow the instructions on the web site where you download the SDK. Before you install and run Tomcat, make sure that the JAVA_HOME environment variable is set to the installation directory of your Java environment, and that the Java bin directory is included in the PATH environment variable. On a Windows system, you can see if an environment variable is set by typing the following command in a Command Prompt window: C:> echo %JAVA_HOME% C:jdk1.1.2 If JAVA_HOME is not set, you can set it and include the bin directory in the PATH like this on a Windows system (assuming Java is installed in C:jdk1.2.2): C:> set JAVA_HOME=C:jdk1.1.2 C:> set PATH=%JAVA_HOME%bin;%PATH% On a Windows 95/98 system, you can add these commands to the C:AUTOEXEC.BAT file to set them permanently. Just use a text editor, such as Notepad, and add lines with the set commands. The next time you boot the PC, the environment variables will be set automatically. For Windows NT and 2000, you can set them permanently from the Environment tab in the System Properties tool. If you use Linux or some other Unix platform, the exact commands depend on which shell you use. With bash, which is commonly the default for Linux, use the following commands (assuming Java is installed in /usr/local/jdk1.2.2): [hans@gefion /] export JAVA_HOME=/usr/local/jdk1.2.2 [hans@gefion /] export PATH=$JAVA_HOME/bin:$PATH [hans@gefion /] echo $PATH /usr/local/jdk1.2.2/bin:/usr/local/bin:/bin:/usr/bin page 34
Hint: If you are looking for high quality webhost to host and run your jsp application check Vision web hosting jsp services
JavaSercer Pages 3.4 JSP Application Design with MVC
November 27, 2006 on 9:44 am | In Java | No Comments JavaSercer Pages 3.4 JSP Application Design with MVC JSP technology can play a part in everything from the simplest web application, such as an online phone list or an employee vacation planner, to full-fledged enterprise applications, such as a human resource application or a sophisticated online shopping site. How large a part JSP plays differs in each case, of course. In this section, we introduce a design model suitable for both simple and complex applications called Model-View- Controller (MVC). MVC was first described by Xerox in a number of papers published in the late 1980s. The key point of using MVC is to separate components into three distinct units: the Model, the View, and the Controller. In a server application, we commonly classify the parts of the application as: business logic, presentation, and request processing. Business logic is the term used for the manipulation of an application’s data, i.e., customer, product, and order information. Presentation refers to how the application is displayed to the user, i.e., the position, font, and size. And finally, request processing is what ties the business logic and presentation parts together. In MVC terms, the Model corresponds to business logic and data, the View to the presentation logic, and the Controller to the request processing. Why use this design with JSP? The answer lies primarily in the first two elements. Remember that an application data structure and logic (the Model) is typically the most stable part of an application, while the presentation of that data (the View) changes fairly often. Just look at all the face-lifts that web sites have gone through to keep up with the latest fashion in web design. Yet, the data they present remains the same. Another common example of why presentation should be separated from the business logic is that you may want to present the data in different languages or present different subsets of the data to internal and external users. Access to the data through new types of devices, such as cell phones and Personal Digital Assistants (PDAs), is the latest trend. Each client type requires its own presentation format. It should come as no surprise, then, that separating business logic from presentation makes it easier to evolve an application as the requirements change; new presentation interfaces can be developed without touching the business logic. This MVC model is used for most of the examples in this java blog. In Part II, JSP pages are used as both the Controller and the View, and JavaBeans components are used as the Model. The examples in Chapter 5 through Chapter 7 use a single JSP page that handles everything, while Chapter 8 through Chapter 11 show how you can use separate pages for Control and View to make the application easier to maintain. Many types of real-world applications can be developed this way, but what’s more important is that this approach allows us to examine all the JSP features without getting distracted by other technologies. In Part III, we look at other possible role assignments when JSP is combined with servlets and Enterprise JavaBeans. page 33
Note: If you are looking for inexpensive but high quality provider to host and run your jsp application check Astra jsp hosting services
JavaSercer Pages (Web hosting packages) Client-Side Versus Server-Side Code Page authors
November 27, 2006 on 2:30 am | In Java | No CommentsJavaSercer Pages Client-Side Versus Server-Side Code Page authors who have some experience developing client-side scripts using JavaScript (ECMAScript) or VBScript can sometimes get a bit confused when they start to use a server-side technology like JSP. Client-side scripts, embedded in