Java-based J2EE is the latest e-commerce solution. its complexity and the high cost of development tool systems have also discouraged many people. in actual project applications, there are not many applications that really need to fully use the J2EE solution. The following combinations are sufficient for small and medium-sized enterprises to deal with e-commerce applications: JSP/servlet + Javabeans (taglib) + MySQL (XML) in specific implementation, the combination of Linux + Tomcat + JDK + MySQL has proved to be stable, fast, and cost-effective. We hope that in many small and medium systems, with the power of Open Source, Java will remain undefeated.
How to construct a simple JSP and javabean development and release Environment?
After practice, I found that the combination of the following development tools can easily form a dynamic and scalable IDE environment:
◆ Jcreator is used to edit and debug javabean;
◆ Homesite (editplus dreamweaver) is used to edit JSP files;
◆ Tomcat serves as the Serlvet/JSP Container server;
◆ Mysql is used as the database server;
◆ Jboss acts as the EJB container server (if you do not use EJB, do not install it );
◆ Ant is used as a release tool (not installed if EJB or J2EE is not used );
This combination can be used to debug JSP and Javabean directly through the IE browser, compared with the huge IDE tool software such as Jbuilder. the biggest advantage is the low resource consumption and the features of their respective tools. For example, homesite is very powerful in html/JSP writing. If your JSP/servlet server or EJB server uses open source software, this combination is no inferior to Jbuilder.
Let's start with the specific configuration: first, let's assume that such a development and running environment: development is in a windows system, while running is in a linux system:
Development Environment
1. First, you need to install Tomcat + jdk on your PC windows, and install Tomcat + jdk on linux;
2. Create a directory for your project. For example, c: myweb stores the JSP and Javabean directories of your project. Create three directories under myweb:
◆ JSP --> JSP source code
◆ Beans --> Javabean source program
◆ WEB-INF/classes --> compiled javabean running program.
3. we hope that the compiled JSP can immediately see the running effect from the IE browser, and the JSP can be called immediately after the javabean compilation. Therefore, the Directory of our project must be placed in the Tomcat environment:
If you want to use http: // localhost: 8080/myweb to access your JSP program, modify server. xml in the conf directory of tomcat:
-
- <Context Path="/Manager" DocBase="Manager" Debug="0" Privileged="True"/>
-
- <Context Path="/Myweb" DocBase="C: myweb" Debug="0" Reloadable="True"/>
Restart Tomcat.
You can access and debug your project through http: // localhost: 8080/myweb.
4. install the mysql database. we recommend that you install the PHP windows environment and PhpmyAdmin to better manage Mysql. Of course, you can also use the management tool provided by Mysql windows. very troublesome. apache for windows is required for PHP installation, or IIS of Win2000 can be used.
Install JDBC, download Mysql JDBC on the Mysql homepage, unzip it to mm. mysql-2.0.4-bin.jar, add the file to Tomcat's common/lib directory.
5. To install Javamail, go to java.sun.com to download two support packages for Javamail. The installation location is also in the common/lib directory of Tomcat.
6. Install JSP development tools: editplus, homesite, or Jrun studio.
7. jcreator is recommended for installing java development tools. It is a free software that runs fast and has low configuration requirements. The disadvantage is that manual programming is required. however, this is good for understanding many underlying concepts of Java.
After completing the preceding steps, we recommend that you start windows before installing Jcreator, so that Tomcat can run effectively and automatically search for your JDK directory during Jcreator installation. you must enter Jcreator to manually configure Jcreator no matter whether it is found or not.
It is troublesome to configure the Java environment of jcreator. Select Options under the Config menu to enter JDK profiles. if Jcreator finds your JDK directory, an item is displayed. select "edit", select "add", and select "add Jar" to add all the Jar files in the common/lib directory under the Tomcat directory one by one.
In particular, the JDBC driver mm. mysql-2.0.4-bin.jar added to the environment, while tomcat/lib/common can be added to the servlet. jar and sendmail package
In this way, no errors will occur when your Jcreator compiles Java-related calling technologies.
8. after the above development environment is installed successfully, you can start to develop JSP and Javabean, and open the browser, http: // localhost: 8080/myweb/to access your project directory, start JSP to run.
Debugging
In JSP and Javabean, use out. println and System. out. println performs some breakpoint settings and debugging. Note that this is two different outputs. The former can see the output debugging results in the browser, and the latter can only be seen in the tomcat console, which is easy to see in the windows tomcat console, it is the Black Start window of tomcat. in linux, you need to open logs/catalina under the tomcat directory. out
Release to running environment
Release the JSP and Javabean you developed in windows to the Linux system for running. Use the FTP software to upload:
In linux, a directory structure similar to myweb under windows is also created, and the corresponding JSP and compiled Javebeans FTP can be uploaded to the corresponding directory. note: you may need to restart Tomcat, but Tomcat will automatically call the new Javabean.
- JDOM-based JSP application for processing database-to-XML Conversion
- Detailed description of Application Usage in JSP Programming
- Ajax and JSF use Rational Application Developer V7 to easily implement Web applications
- JSF technology details
- Use Acegi to protect JSF applications