A simple way to construct a Jsp/javabean development and publishing environment

Source: Internet
Author: User
Tags ftp homesite install php mysql mysql version mysql database tomcat linux
JS Java-ee is the latest e-business solution, and its complexity and the cost of developing tool systems have deterred many people. In the actual project application, the real need to completely use Java EE solution is not many, facing small and medium-sized enterprises E-commerce applications, the following combination is enough to deal with: jsp/ Servlet + Javabeans (taglib) + MySQL (XML)


In the specific implementation, LINUX+TOMCAT+JDK +mysql combination has proven to be stable and fast and low-cost, hope that in many small and medium systems, with the power of open source (open source), Java will remain invincible.

How do I construct a simple jsp/javabean development and publishing environment?

In practice, I have found that the following development tool combinations can be easily constructed into a dynamically extensible IDE Environment:

JCreator is used to edit debug JavaBean;
Homesite (EditPlus dreamweaver) is used to edit JSP files;
Tomcat as a serlvet/jsp container server;
MySQL as a database server;

JBoss serves as an EJB container server (not installed if EJB is not used);
Ant as the publishing tool (if you do not use EJB or Java EE does not install);


This combination can be directly debugged via IE browser JSP or JavaBean, compared with jbuilder such a large IDE tool software. The biggest advantage is the resource consumption is less, play the characteristics of the respective tools, such as HomeSite write html/jsp very powerful, etc., if your jsp/ The servlet server or EJB server uses Open-source software, which is no worse than JBuilder.

Let's start with a specific configuration: First, suppose such a development and running environment: development is in the Windows system, while the running is in the Linux system:

Development environment

1. First, you need to install TOMCAT+JDK on your PC windows and install TOMCAT+JDK on Linux.

2. Create your own project directory, such as C:myweb placed in their own project JSP or JavaBean directory, under the MyWeb to create three directories:

JSP-->jsp Source Program
Beans-->javabean Source Program
Web-inf/classes--> The compiled JavaBean run the program.


3. We hope that the prepared JSP can immediately see the running effect from IE browser, also want to JavaBean compiled, immediately can be JSP call, therefore, we must put the directory of this project into the Tomcat environment:

If you want to access your JSP program in Http://localhost:8080/myweb, modify the Server.xml in Tomcat's conf directory:


.........

<!--Tomcat Manager context-->
<context path= "/manager" docbase= "manager" debug= "0" privileged= "true"/>

<!--below are the--> you joined.
<context path= "/myweb" docbase= "C:myweb" debug= "0" reloadable= "true"/>

.........



Restart Tomcat.

You will be able to debug your project through the Http://localhost:8080/myweb URL later.

4. Install MySQL database. It is recommended that you install PHP's Windows environment and phpMyAdmin, which is better for managing MySQL, but you can also use the management tools you have with your MySQL version of Windows. It's very troublesome. You need Apache for Windows when you install PHP, Or you can use Win2000 IIS.

Install JDBC, download MySQL's JDBC on the home page of MySQL, after decompression is Mm.mysql-2.0.4-bin.jar, add the file to Tomcat's Common/lib directory.

5. Install JavaMail, need to java.sun.com download JavaMail two support packages, installation location is also tomcat Common/lib directory

6. Install JSP development tools: You can editplus or HomeSite or Jrun studio.


7. Install Java Development Tools, recommend the use of JCreator, is free software, fast running, the configuration requirements are not high, the disadvantage is to hand-programming. But this is good for understanding many of the underlying concepts of java.

It is recommended that after you complete the above steps, start Windows before installing JCreator to enable Tomcat to run effectively, and also allow JCreator to automatically search your JDK directory when it is installed. Whether or not you search, you have to enter the JCreator manual configuration.

Configuring the JCreator Java environment is a bit cumbersome, select options under the Config menu and go to JDK profiles. If JCreator searches your JDK directory, you'll see an item. You select "Edit", select "Add", select " Add jar to add all the jars in the Common/lib directory under the Tomcat directory.

In particular, JDBC-driven Mm.mysql-2.0.4-bin.jar are added to the environment and can be added to the Servlet.jar and SendMail packages in Tomcat/lib/common
This way your jcreator compiles Java related call technology without error.

8. After successful installation of the above development environment, you can start to develop Jsp/javabean, while opening the browser, http://localhost:8080/myweb/will be able to access your project directory, start JSP can run.

Debugging
In Jsp/javabean, use OUT.PRINTLN and System.out.println for some breakpoint settings and debugging, note that this is two different outputs, which can be seen in the browser output debug results, the latter only through the Tomcat console, Windows Tomcat console is easy to see, that is Tomcat's that boot black window; Linux to open the Tomcat directory under Logs/catalina.out



Publish to a running environment
Publish the Jsp/javabean you developed under Windows to the Linux system and use the FTP software to upload:

Under Linux also set up similar windows under the MyWeb directory structure, the corresponding JSP and compiled Javebeans FTP upload to the corresponding directory on it. Note that sometimes you may need to restart Tomcat But in general, Tomcat automatically invokes the new JavaBean.

If you think there are too many files, you can use the ant compile-pressure 淑成. War package uploads can also be referenced by other articles.

This way, your jsp/javabean can run on a Linux machine.





Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.