Joy after ice tea-Eclipse 3_0 + lomboz 3_0 + Tomcat 5_0_16)

Source: Internet
Author: User

The sultry evening in Beijing has made me and my favorite Computer Unable to withstand the suffocating air. Lomboz3 has to be filled with fuel at this moment. After two or three days, there is no clue. Those with no worries on the InternetArticleIt is even more annoying.
Relax! After a cup of ice-cooled ice tea with 1/2 cups, the whole person starts from the beginning to the end.
OK! Start!
1. Environment:
Win2000pro
JDK 1.4.2 _ 05-download from Sun Official Website
Eclipse Release 3.0-on the official eclipse website
Tomcat 5.0.16-download from Jakarta Official Website
Lomboz 3.0 for eclipse 3.0-lombozofficial website downloads two files, emf-sdo-runtime-2.0.0.zip, and lomboz.3.zip.

2. Install software and configure environment variables (The following is my environment)
JDK:
Java_home: C: \ j2sdk1.4.2 _ 05
Path: % SystemRoot % \ system32; % SystemRoot % \ system32 \ WBEM; C: \ j2sdk1.4.2 _ 05 \ bin;
Classpath:.; C: \ j2sdk1.4.2 _ 05 \ Lib \ tools. jar; C: \ j2sdk1.4.2 _ 05 \ Lib \ DT. jar;

Tomcat:
Tomcat_home: C: \ tomcat5

Lomboz:
First, extract emf-sdo-runtime-2.0.0.zip to the eclipse3 directory;
Then, extract lomboz.3.zip to the eclipse3 directory.

Eclipse:
Unlike eclipse 2, the plug-in is not extracted to eclipse and can be found after eclipse is started.
You need to enable the installed plug-in help-software updates-manager Configuraton.
For example:

Start emf2.0.0 and sdo2.0.0
The lomboz J2EE view icon appears on the toolbar.

3. Detailed Configuration
The following configurations are available in Windows-perferences.
(1) Build path
01


(2) lomboz
02

(3) lomboz-server Definitions
Server Types Select Apache Tomcat v5.0.x
A. Properties
03

B. Server classpath
04


C. Project classpath
05

4. Create a test project and page
Add the following content to c: \ tomcat5 \ conf \ Server. XML to connect to the project.
//......
<Context DEBUG = "0"
Docbase = "D: \ workspace \ myjsp \ test"
Path = "/test" reloadable = "true" workdir = "D: \ workspace \ myjsp \ j2src \ org \ apache \ jsp"/>

</Host>

</Engine>
//......

Create a project. After selecting the Java lomboz project, there will be a pipeline to help you build the lomboz project.
One step toward creating a project is "create J2EE module", which has a segmentation form. In the "web module", the project container category should be created, similar to a web development project, my container project name is "test "; in "targeted servers", select "Apache Tomcat v5.0.x" based on the current configuration of the application server that your project operation relies on ".
06

Modify the lomboz category. When you press the lomboz button on the tool, there will be a lomboz work form, including the stop, run, refresh and other functions. Select your lomboz project in this form. On the right side, there will be a menu, and you can run it by selecting "run server.
Start lomboz and test the page in IE.
12

Finally, it's okay. Almost all the problems in the configuration process are in the server classpath. After the test, the jar files contained in the above are, you can ensure that your lomboz will not go wrong during the running process.

Even if a problem occurs, do not worry. Check the prompt and check whether the jar package is not added to the server classpath path.

Oh, I feel a lot better, and the night rain outside also began to burst.
The wind blew the rain into the house,
You can safely and practically go to bed.

In addition, I solve some problems during lomboz Configuration:
1. El problems:
Import atat_home \ common \ Lib \ commons-el.jar in server classpath

2. When parsing the JSP page, the following error occurs:
Import atat_home \ common \ Lib \ jasper-runtime.jar in server classpath

3. the compiler error occurs when parsing the JSP page:
Import atat_home \ common \ Lib \ jasper-compiler.jar in server classpath

Such common problems can be solved.
In fact, in the use of eclipse + lomboz + Tomcat, a lot of scratching problems occur in the configuration, so calm down and carefully analyze the problem, which can generally be solved. For example, "noclassdeffounderror" is generally caused by the absence of necessary class files in classpath. Check whether the jar package required for this type of files is included in the server classpath.

4. What does \ org \ apache \ JSP in the configuration file workdir = "D: \ workspace \ myjsp \ j2src \ org \ apache \ jsp" mean ??

If you are using tomcat4, lomboz and tomcat cannot be used together to generate your own work environment, which is caused by the reasons of tomcat4.x. Therefore, you must:
1). Add the following content to the server. xml file in the config directory of Tomcat (for details, see the document about server. XML ):
<Context Path = "/testjsp" docbase = "D: \ debugjsp" workdir = "D: \ debugjsp \ j2src \ org \ apache \ jsp">
Path indicates the URL name of the Web application, docbase indicates the physical location of the Web application, and workdir indicates the location where the Java file corresponding to JSP is generated, you must create a directory structure and name such as org \ apache \ JSP.
2) create a subdirectory structure according to org \ apache \ JSP under the corresponding j2src directory, and set j2src as the source directory of the project.
Therefore, you have not set up the org. Apache. jsp directory structure in j2src. Therefore, the package org. Apache. jsp cannot be found during compilation.

However, after tomcat5x, this problem has been corrected and you do not need to set up Org. apache. the directory structure of JSP can be correctly compiled. If you open the j2src directory, you will find that org has been automatically created. apache. JSP. So in Tomcat 5, you only need to declare:
Workdir = "D: \ workspace \ myjsp \ j2src.
09

If you must add a directory structure like this:
Workdir = "D: \ workspace \ myjsp \ j2src \ org \ apache \ jsp"
You will find that worker at5 uses workdir as the project compilation directory by default during compilation, and the package structure of org. Apache. jsp will still be created at the last layer of the directory.
10

5. question about which tomcat version to use
In addition, I personally think that any tomcat version supported by the official lomboz version should be successfully configured. Therefore, if you change the version, the problem may still occur in the tomcat version configuration.

6. Does lomboz3 support Tomcat 5.0.27?
Lomboz3 does not support tomcat5.0.27 in Foreign Forums. There is an inexplicable error in the lomboz3 support file for atat5x.
In % eclipse_home % \ plugins \ COM. objectlearn. jdt. j2ee_3.0.1 \ servers \ tomcat50x. in the Server File, find "-djava. endorsed. dirs string. The correct setting should be-djava. endorsed. dirs = "$ {serverrootdirectory}/common/endorsed", delete an inexplicable path. You need to modify two items in total. After modification, Tomcat will be able to get up smoothly.

Tomcat5.0.28 does not seem to have this problem. I use 5.0.28, Which is okay. Previously I used tomcat5.0.27 to solve this problem. Tomcat can be started after being modified according to the method mentioned on the lomboz website, however, I found that new problems will occur after modifying the file. Therefore, we recommend that you use Tomcat 5.0.27 instead of starting tomcat in lomboz and directly change the publishing Method to the XML file Writing Method for debugging, or simply change the version of Tomcat.

7. How to automatically add servlet to Web. xml in the lomboz Project
Currently, I have manually added the question of Servlet Mapping. Please let me know if you can find a good solution.

8. How can servlet be automatically generated under the web-INF/classes directory?
For the servlet storage directory, if the web project generated by lomboz is used, the servlet is saved in the bin directory by default. In order to facilitate debugging and release, the following settings are required under the classes directory normally:
In the project properties, set according to the image.
In this way, the class file compiled by the servlet will be automatically placed under the classes according to your package structure.
11

9. How can I solve the problem of garbled Chinese characters when lomboz transfers the. jsp file to the. Java (servlet) file?
The key is to set the encoding format in the JSP file.
<% @ Page Language = "Java" contenttype = "text/html; charset = gb2312" %>
The following GIF image shows that when the above label is added to the JSP file, the Chinese characters with garbled characters in the servlet can now be correctly displayed. Check that the servlet has been added.
Response. setcontenttype ("text/html; charset = gb2312 ");
HoweverCodeWhether the Chinese in is garbled does not play a key role. It only tells servlet to output the Chinese in the code in the specified encoding format (the Chinese encoding format specified for execution results ). The reason why the Chinese characters in the servlet code can be correctly displayed is that lomboz is. the JSP file is parsed. java, because the <% @ page Language = "Java" contenttype = "text/html; charset = gb2312" %> label is found. JSP compiled. in Java, the Chinese characters are encoded and converted accordingly. So in one sentence, the key is to ensure that the servlet code is not garbled.

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.