MyEclipse configuration to be performed after installation

Source: Internet
Author: User

Writing web Project in MyEclipse, there are 2 places to change the encoding settings:

1.window-->preference-->general-->content type

then expand each subkey in the <content types> and enter "UTF-8" or "GB18030" in the <default encoding>, point update!

2.window-->preference-->myeclipse-->files and Editors

Change the "Encoding" of each subkey to "ISO 10645/unicode (UTF-8)" or "Chinese,national Standard", point apply!

All future document types created are UTF-8 or GB18030 formats!

Change eclipse or MyEclipse default encoding for new files

Eclipse's:
Window-preferences-general-contenttype to the right window, change to GBK also can, Utf-8 also line.

MyEclipse of:
Window-preferences-myeclipse-files and editors-jsp inside have encoding, change here for Iso10646/utf-8.

Eclipse and Java file encoding settings

If you search the Web for file coding problems, you can get a lot of answers, even some of the so-called ultimate solution, so you may not encounter coding problems, then why do I have to write this article. Because I work under two platforms, the default encoding is not the same, so you need to jump the whole of the line.

Take a look at Eclipse settings, if you download Eclipse and do nothing, start creating engineering, coding, everything is OK, but you may have your project moved to Linux under development, because you start to get tired of WinXP, and love Ubuntu. That's when the problem comes. Open your eclipse under WinXP, click Window-->preferences, expand General-->workspace, and see the left Text file encoding not, The default setting is the Simplified Chinese code (GBK, gb2312), and Linux below, is UTF-8.

Now that we have understood the difference between them, and so on, now start to all of your workspace file coding set to UTF-8 bar, you will have at any time can be normal display of Java files, no garbled.

MyEclipse must do after installation-such as changing the default encoding project encoding. But you would say, the previous project is already other code, you don't want to change, just want to hug UTF-8 from now, this is also OK, when you create a new project, want to use and workspace different code, please right-click your item, select Properties, click Resource, See Text file encoding, click the other, choose UTF-8, you really need such a coding format, is not it.

JSP encoding

Is it over? No, perhaps JSP is the most you deal with the file, you do not want all the JSP files are UTF-8 it. Then let's see. Or click Window-->preferences, this time is to expand the Web and xml-->jsp Files, see the Encoding, quickly choose UTF-8 Bar. If you can, put your html,css and so on these files set into UTF-8 bar, you will have a complete UTF-8 solution.
Finally, look at the effect you set. Create a new JSP file and select any JSP template in the second step. Then look at the generated JSP file, all are UTF-8, now you can rest assured that your documents are UTF-8.

Struts2 Internationalization garbled problem solving

Development tool: MyEclipse 6.01, all file encodings are set to Utf-8. After all processes are properly developed. Localize the Messagesource.propertis:
Native2ascii Messagesource.propertis Messagesource_zh_cn.propertis
Run, found that the content read from the resource file on the page is still garbled.
Workaround: When localizing, specify the encoding method, as follows:
Native2ascii-encoding UTF-8 Messagesource.propertis Messagesource_zh_cn.propertis

02 Cancel MyEclipse Quick Install dialog box

I used the myeclipse6.0 when I opened it today myeclipse Quick Install dialog box, this dialog is what to do. How to cancel. Who knows, pointing.

First, you remove the MyEclipse Quick Install dialog box.
Windows > Preferences > Install/update > Automatic Updates and uncheck automatically find New Updates and Notif Y Me Check out.
That's good.

03 Enhanced Eclipse, MyEclipse's Code auto tip feature

By default, Eclipse, the MyEclipse code hints feature is much worse than Microsoft Visual Studio, primarily Eclipse, where the myeclipse itself has many options that are closed by default, and developers can manually configure them. If the developer is not clear, Eclipse is not known, and MyEclipse's code hints function as powerful as Microsoft Visual Studio's code hints.
Let's take a simple example to illustrate the problem, for example, in Eclipse, MyEclipse code, to play a foreach,switch, and so on, there is no code hint (do not believe yourself to try), the other is not to mention, and in Microsoft Visual Studio inside is getting very friendly code hints. In fact, Eclipse, the code hint feature in the MyEclipse code is typically a dot ".", usually with a dot "." Before there is a code hint.
Principle: "Auto activation triggers for Java" is the option that triggers the code hint, changing "." To ". ABCDEFGHIJKLMNOPQRSTUVWXYZ (," meaning, It means that you encounter 26 letters and., these symbols trigger the code hints feature. (Specific back has said, rest assured)
Enhanced eclipse, MyEclipse code hints, how to configure.
Below begin to say step (note oneself use MyEclipse 6.0.1 do explain):

1. Open MyEclipse 6.0.1, then "window" → "Preferences"
2. Select "Java", expand, "Editor", select "Content Assist".
3. Select "Content Assist" and then see the "Auto Activation triggers for Java" option under "Auto-activation" on the right side of the right. Actually, it means that the trigger code hint is "." This symbol.
4. "Auto activation triggers for Java" option, in "." After adding ABC letter, easy to find the following changes. Then "Apply" and click "OK".
5. Then, "File" → "Export", in the pop-up window select "Perferences", click "Next".
6. Select the export file path, I export to the desktop, enter "test" as the file name, click "Save".
7. On the desktop to find just in the saved file "TEST.EPF", right-click Select "Open with Notepad."
8. You can see a lot of configuration MyEclipse 6.0.1 information
9. Press "CTRL + F" shortcut, enter ". ABC" and click "Find Next".
10. Find the configuration information for ". ABC".
11. Change ". abc" to ". ABCDEFGHIJKLMNOPQRSTUVWXYZ (,", Save, close "TEST.EPF".
12. Back to the MyEclipse 6.0.1 interface, "file" → "Import", in the pop-up window select "Perferences", click "Next", select just in the already modified "TEST.EPF" file, click "Open", click "Finish". This step is similar to the previous export step.
13. Finally, of course, the code is tested.
Create a new project and create a new class. Test the code input Switch,foreach, and so on. You will immediately find that there is a hint, and no matter what letter is to knock on a lot of related tips, very smooth, very convenient.
Summary: The "Auto activation triggers for Java" option refers to the option of triggering code hints, "." To ". ABCDEFGHIJKLMNOPQRSTUVWXYZ (,") means to encounter 26 letters and., (these symbols trigger the Code hints feature.)
By the way, modify the class name, interface name, etc. with different colors highlighted, you can configure this in the "Java" → "Enditor" → "Syntac", the right to expand "Java" → "classes", on the hook "Enable" this option, choose their favorite color can be.
Of course, there are other related color configurations. I will not tell you the details. In fact, in the "Preferences" this thing, there are a lot of things can be configured, so that MyEclipse optimization, specific to each person according to their personal preferences to configure.

04 How to add Javadoc in MyEclipse (SUN source code)

Hold down CTRL and click a method to appear:
The jar file Rt.jar has no source attachment.
Can attach the source by cliking Attack source below:

Workaround:
Because the source of RT is in the Src.zip file of the JDK directory, it is OK to find the Src.zip in the JDK directory.
General MyEclipse no src.zip.
You need to use the path to the JDK installation package, such as your JDK installation path: C:\Program files\java\jdk1.5.0_15
then choose; C:\Program Files\java\jdk1.5.0_15\src.zip can be

05 What does it mean to automatically generate some code when building JSP pages with MyEclipse?

What do you mean by automatically generating some code when you build a JSP page with MyEclipse?
<%
String path = Request.getcontextpath ();
String basepath = request.getscheme () + "://" +request.getservername () + ":" +request.getserverport () +path+ "/";
%>
The above two pieces of code is what to use AH. What do you mean
There are also pageencoding= "iso-8859-1" and charset= "GBK" What is the difference.
The above 2 code is to get the URL of the JSP file,
Pageencoding refers to your JSP file's save code, that is, your JSP file with what code stored on the hard disk
Charset= "GBK" is your JSP input and output encoding, many servers in the absence of pageencoding, there are charset instead of pageencoding

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.