Message-ID: <1795594223.34487.1408779202738.JavaMail.email@example.com> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_34486_1700001073.1408779202738" ------=_Part_34486_1700001073.1408779202738 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html
Jetty uses the code formatting as specified in the following file:= =20
Jetty specifies the following code templates for use by the project deve= lopers:=20
The following is an example of the Java formatting and naming styles to = be applied to Jetty:=20 =20
may be used for indents. If tabs are used for
indents, then spaces s= hould not be used. ie all spaces or all tabs - no mixed.
we should write:=20 =20
Private fields and functions should have names starting with '_'.=20
Note that this is a very light weight form of object and we are not usin= g any concept of class. It is equivalent to a javaclass of static members a= nd simply groups related functions together for name space clarity.=20
I know it is optional, but it makes it easier for old C-hacks to parse a= s well as making it easier for the interpretors to spot errors if a typo is= made.=20
The ID of a DOM element must be unique, while multiple DOM elements can = have the same class. A frequent mistake is to use a non unique id, for exam= ple on a cell in a table (if the table has multiple rows then a cell id is = not unique). A class should be used if there are visual ramifications, othe= rwise normal attributes or external associative arrays should be used.= =20
The this automatic field in js works differently to java. If a member fu= nction of an object is called as a callback, then the this does not refer t= o the object but the calling scope. For example in the following code:= =20 =20
the _handle method is called when the mybutton is clicked, but the
this will not refer to the
myhandler object, but rathe=
r the DOM element of the button! The object var
myhandler can =
be used instead of
this in these circumstances.
The exception to this is in JSON, which should always use double quotes = as that is what is defined by the standard.=20
I know this is supposed to be optional but IE does not seem to handle we= ll for loops with variables that are not declared with var. Thus instead of= writing:=20 =20
we should write:=20 =20
Many libraries have a concept of behaviours, not least the behaviour lib=
be used where possible/suitable.