Myeclipse: Modify the Page Template (JSP and HTML) in myeclipse development tools)
1. Using myeclipse tools to develop web projects, there is a common problem, that is, when creating a page file, you need to modify the pageencoding value, the default pageencoding value in the page is generally a ISO-8859-1.
2. If the web project needs to support Chinese, you must change that ISO-8859-1 to the following: UTF-8, gb2312 or GBK.
3. UTF-8 is good in Chinese, if you want to change the pageencoding value of the page to UTF-8, relatively simple, find myeclipse development tool window | preferences-myeclipse enterprise workbench | files and editors | JSP, in the encoding selection box on the right, select 1st properties: ISO 10646/Unicode (UTF-8), which is the UTF-8. The selection box does not contain gb2312 or GBK.
4. The above is the pageencoding value of the JSP page, and the pageencoding value of pages such as HTML under files and editors is also the same. If the version of myeclipse is relatively high, for example, myeclipse7.0, many font styles are set to italics, which looks uncomfortable. After a long time, the eyes may become oblique. Good, not to mention, you can also change the font style in this section. For example, to change the font style of a JSP page, select attribute values in the right selection box of files and editors-JSP-JSP styles, and then remove the Italic check box on the right of the Selection box.
5. It's a little far away.
6. If you want to change not only pageencoding value, or pageencoding value do not want to use UTF-8, just want to use gb2312 and GBK, or simply the whole page template want to change it, what should I do?
7. In earlier versions of myeclipse, you can search for the. VTL file in the installation path. The. VTL file is the template file, such as searching for JSP. VTL. After finding it, edit it, change the layout to the style you want, and save it. When you create a JSP page, the default style of the page is what you wrote (after modification, the created project may have no effect. Create a new project ). However, when we find the JSP. VTL file, we will find that there are two identical files. Which monkey is true. One of them is index. unique JSP page template (index generated by default when a web project is created. JSP page, manually created index. JSP does not count), the other is the template when the JSP page is created.
8. if the version of myeclipse is relatively high, for example, in myeclipse7. 0m2, search for JSP. you can only search for one VTL file, which is index. JSP templates, but the other one cannot find them. Why? Who hid these template files. The installation path myeclipse/Eclipse/plugins contains a COM. genuitec. eclipse. wizards_6.9.200.zmyeclipse69200200809.jar is the JAR file. After several months, I finally caught it! The. VTL file is in this jar package, so it cannot be found.
9. Copy this file to the outside and leave a draft. If you make a mistake, you have to find a way to restore it. Maybe you have to reinstall myeclipse!
10.jarpackage file cannot be opened. If you change it, change the extension name of the local file to .rar, that is, to the compressed package form, and then open it (you don't need to decompress it, and you have to decompress it back later). A Templates folder is in it, it contains JSP, HTML, XML, and XHTML folders.
11. What do you want to change? Open the folder and change it. Pay attention to the format when you change it. Don't make an error. Save it and change it later. In addition, do not add Chinese characters to the template and parse it into garbled characters.
12. After the modification, I changed the extension back and changed it to. Jar. It felt a bit like doing that. Okay, you can.
From: Small from: http://hi.baidu.com/candy%D0%A1%C6%F0/blog/item/ad6fc2fad816e36c024f5600.html
The description is quite detailed and organized. AMO is here to thank you !!!
Another article is transferred from Netease's blog, which is also good! Thank you !!!
Modify JSP template in myeclipse
In the X:/program files/myeclipse 6.0/myeclipse/Eclipse/plugins/COM. genuitec. eclipse. find JSP in the wizards_6.0.1.zmyeclipse60316710/templates/jsp directory. copy the VTL file and rename it as jsp2.vtl. Then, change the content to the desired format and save it.
Find templates. XML in the directory X:/program files/myeclipse 6.0/myeclipse/Eclipse/plugins/COM. genuitec. Eclipse. wizards_6.0.1.zmyeclipse60%710 and open it in a text editor. In
<Template
Context = "com. genuitec. Eclipse. Wizards. jsp"
Script = "templates/JSP. VTL"
Name = "Default JSP template"/>
Add
<Template
Context = "com. genuitec. Eclipse. Wizards. jsp"
Script = "templates/JSP/jsp2.vtl"
Name = "jsp2 template"/>
Save. Restart eclipse.
Create a new JSP. A jsp2 template is displayed in the template. Select and press finish. The newly created JSP page is generated according to your template!
Note:
1. X:/program files/myeclipse 6.0/is the path for installing myeclipse.
In 2.com. genuitec. Eclipse. wizards_6.0.1.zmyeclipse60%710, wizards_6.0.1.zmyeclipse60%710 may vary depending on the version, for example, Com. genuitec. Eclipse. Example.
Generally, you only need to modify the template information. For example, you can modify the JSP page file header information.
* # <% @ Page Language = "Java" Import = "Java. util. *" pageencoding = "$ encoding" %>
Change
* # <% @ Page contenttype = "text/html; charset = $ encoding" %>