Eclipse new Workspace (workspace) Preliminary setup

Source: Internet
Author: User
Tags tomcat

The first step:

To protect your eyesight, first modify the background color of the computer window:

Setup method: Open the Display select appearance (appearance) in Control Panel (advanced), then in the Items (items) window (Windows), click Color (color)-Other colors (others), and then put the hue (hue) Set to 85,sat (saturation) set to 90,lum (brightness) set to 205. Then click Add to Custom Color (addtocustomcolors), press "OK" ... been determined. Set the window to green, and then to the IE Web page background also becomes the eye-pleasing green bar: open IE, click Tool (Tools), point Internet Options (internetoptions), point to the lower right corner of the accessibility (assessibility), Then tick not to use the color specified in the page (ignorecolorsspecifiedonwebpages), then click "OK" to exit


Step Two:

Automatically generate annotations when creating new classes in Eclipse

Windows-->preference-->java-->code Style-->code templates-->code-->new Java files
Edit it, the content is as follows

[HTML] view plain copy ${filecomment} ${package_declaration}/** * @Title: ${file_name} * @Package ${ Package_name} * @Description: ${todo} * @author ${user} * @date ${date} ${time} * @version V1.0.0 */${ty Pecomment} ${type_declaration}


Step Three:
Alt+shift+j When you manually insert a comment for the class, modify the following:
Code Style---Java---Code temples, window, preferences
Click Comments->types Click Edit


[HTML] view plain copy/** * @Description: ${todo} * @author ${user} * @date ${date} ${time} */
Fourth Step:

Maximum number of characters in a line when formatting code
Java-codestyle-formatter, click New, create a new profile, click Edit, select the Line Wrapping tab in the newly opened window, modify the maximum line width to 140, save.


Fifth Step:

Set the console to display the maximum number of lines printed so that the error message is not flushed out:

Window--Preferences->run/debug-->console

Set the console buffer size (characters) to: 999999


Sixth step: Modify workspace Default Project code (I change it here to UTF-8)


Window--Preferences->general-->workspace

Select the encoding of the text file encoding UTF-8


7th step: Modify HTML, JSP, etc., the default encoding settings when new

Window--Preferences->web-->html Files

Or

Window--Preferences->web-->jsp Files

Eighth Step:

To set up a JSP template:

Eclipse-->perferences->web->jsp-jsp files-editor->templates You can set a template here.

Replace the contents of the JSP with HTMl as follows:

<%@ page language= "Java" contenttype= "text/html; Charset=utf-8 "
pageencoding= "UTF-8"%>
<%

Request.setcharacterencoding ("UTF-8");
String path = Request.getcontextpath ();
String basepath = request.getscheme () + "://" +request.getservername () + ":" +request.getserverport () +path+ "/";
%>
<! DOCTYPE HTML PUBLIC "-//w3c//dtd HTML 4.01 transitional//en" >
<base href= "<%=basePath%>" >
<title> title </title>
<meta http-equiv= "Pragma" content= "No-cache" >
<meta http-equiv= "Cache-control" content= "No-cache" >
<meta http-equiv= "Expires" content= "0" >
<meta http-equiv= "keywords" content= "keyword1,keyword2,keyword3" >
<meta http-equiv= "description" content= "This is my page" >
<body>
${cursor}
</body>

After the replacement, the newly created JSP will generally default to this format.

10 Configure the local server. (I used Tomcat) to add the Tomcat path to the server.

11 Setting highlighting:



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.