JSP coding conventions document?

All,
I'm teaching a spring 2004 courses on JSP at Park University and I'd like to have a coding conventions document. I have one for my Java, HTML, and C++ courses and they're very helpful. In doing a Google search, I found this Sun article:
http://java.sun.com/developer/technicalArticles/javaserverpages/code_convention/
It looks very promising, but it suddenly stops after only 2 pages. The article says:
[We'll] address file names and organization, indentation, comments, directives, declarations, scriptlets, expressions, white space, naming conventions, and programming practices. As this is our first attempt at presenting a set of JSP coding conventions, we're quite interested in any feedback you may have on these recommendations. Please send all feedback to [email protected]
But the article stops after covering opening comments. I've sent an e-mail to the authors, but no reply yet.
Please help ASAP because I need to get squared away by the end of this coming week (1/9).
Thanks,
John

This article used to be much longer. I read it not long ago.
There was an original post about it here: http://forum.java.sun.com/thread.jsp?forum=45&thread=363196&tstart=540&trange=15
Don't know what happened to it. And after a quick google haven't managed to find it mirrored anywhere.

Similar Messages

  • Java Coding Conventions -  Debugging

    I am developing a Coding Convention document for a group of folks that are doing some remote development for me and while I have reviewed the Java coding conventions provided by Sun, I haven't seen anything that talks specifically about debugging. I have been asked to include some recommendation concerning where (and when) to put debuggin messages within the code (i.e. when you enter a method, etc.) Are there any conventions around this? I have my own practices but I am looking to find a commonly used industry approach. Thanks

    By debugging messages you mean comments? This is all I found in the doc:
    "Use XXX in a comment to flag something that is bogus but works. Use FIXME to flag something that is bogus and broken."
    I doubt that helps :P As far as an industry standard, not much out there that I could find.

  • Flex 2.0 Naming an Coding Conventions

    Hello,
    I'm new with Flex 2.0 and Actionscript 3.0.
    They asked me to define naming and coding conventions for
    Flex 2.0 and Actionscript 3.0 for our company.
    I'm looking for documents for naming and coding conventions
    for Flex 2.0 and Actionscript 3.0 so I can make conventions for our
    company.
    Who can help me?
    Thanks in advance.
    Simson

    I think you could do one based on Sun's coding convention for
    Java, since the syntax is similar. Take a look at the Java
    convention and you'll get a pretty good idea

  • Java style and coding conventions

    Hello All,
    Most of my programming experience is in Java, and as such, I try to conform to the style and coding conventions that are used in all of the Sun tutorials, and to my understanding, the specification. I'm enrolled in my final semester of a bachelor's of computer science and engineering, and one of my courses is "Software Engineering". Our course assignment is to make a website, written in PHP. I don't really care for PHP, so I volunteered for the Code Quality Assurance team, thinking, I'm fairly consistent when it comes to adhering to the Java conventions, it should be reasonable to determine similar conventions for this project, and give my classmates pointers on how to improve the readability and layout of their source listings.
    The problem is, my professor, absolutely, whole-heartedly hates Java. He despises everything about it. For example, I sent him a source listing that I felt was well written, readable, and adequately documented. Some of the things that I was "doing wrong" were:
    1. Naming Conventions
    All of the Classes were first-letter capitalized, subsequent first-letter of each word capitalized. FormLayoutManager was one particular example. All instance or primitive identifiers were first-letter lowercase, subsequent first-letter capitalized, so an instance of FormLayoutManager could be formLayoutManager, or menuLayoutManager, etc. All constants were all capitals, with underscores separating each word. MAXIMUM_POWER. All methods were first-letter lowercase, subsequent first-letter capitalized, showLoginComponents().
    My Professor insists that the convention I (and most of the Java community as far as I can see) is terribly unreadable, and that all instances variables and method names be first-letter capitalized. I tried explaining that this sacrifices the ability to easily distinguish between a class type or interface, and an instance, and was ignored.
    2. Declaration and Initialization
    Also, supposedly declaring a local identifier and initializing it in the same line is some sort of abomination of everything sacred in programming. So I found myself constantly doing things like
    public String info() {
      StringBuilder info;
      info = new StringBuilder(512);
      // append a bunch of information to info
      return info.toString();
    }3. 80 Character line widths
    He wants me to break any statement that is over 80 characters in width into multiple lines. I know a long statement wrapping around in your editor is a irritating, but 80 characters, seriously, who doesn't have an editor that can't handle more than 80 characters on a line?
    4. this and argument names
    In most of my constructors that accept arguments, I would usually do something like
    public Student(String name, int age) {
       this.name = name;
       this.age = age;
    }Which he thinks is horribly confusing, and should be
    public Student(String n, int a) {
      name = n;
      age = a;
    }5. singular collections / arrays identifiers
    I had something like:
    String[] keywords= new String[] { "new", "delete", "save", "quit" };
    for (int i = 0; i < keywords.length; i++) {
       System.out.println(keywords);
    And he insisted that "keywords" be renamed "keyword", as in, the i-th keyword, which I think is kind of stupid because the array is an array of keywords, and having a singular identifier makes that less obvious.
    It's driving me crazy. It's driving everyone else in the class crazy because they're all mostly used to Java style conventions as well. I've tried pleading my case and I can't even get him to acknowledge the benefits of the "alternative" styles that I've used in my programs up to this point.
    Have any of you had to deal with either professors or bosses who have this type of attitude, whether it be towards Java or any other language? This guy has been involved with computer science for a while. I think he's used to Pascal (which I know nearly nothing about).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    You will find people who will disagree about this stuff all the time. I had a similar course and we read "Code Complete" which offers some style suggestions. Fortunately, my professor was intelligent enough to allow a discussion of these styles and I had a chance to argue against the "bracket every if statement" idea and other little things I didn't agree with. It was insightful conversation, rather than a "I'm the professor, you're a student, so listen to me".
    Here's the important part: It doesn't matter what the standard is, only that there is one.
    Unless I misunderstand, he allowed you to take on the responsibility of QA, so it is ultimately your decision. If the project suffers because of poor quality of code, it will be on your head. If, on the other hand, you give in to him and use a style that makes no sense and the project suffers because of poor code, it will still be on your head.
    So he really has no position in this because he is not a stakeholder in this decision. Tell him that this is your responsibility and you need to make the choices that are right for your group, not right for him. If he's teaching you anything that can reasonably be called software engineering, he should understand that. Otherwise he's just teaching out of a book called "Software Engineering" and doesn't know anything (or so it seems from this small window you've given us).
    caveat: If he's reviewing the code and he's particularly snarky about his "styles", you might want to consider giving in to his demands for the sake of your grade. Sad reality.

  • What's up with the Sun Java coding convention

    I thought Sun leading the Java development should also be a better example on the Java coding convention.
    They do publish a coding convention guide, I believe. But looking at Java core library's source code, so long, coding convention! :(
    Just looked at ArrayList.java source for the version 1.4.2. There are method names like RangeCheck(). Shouldn't a method start with lowercase? Shouldn't a method be verb first like checkRange() instead?
    And there are statements like this all over the place:
    if (foo)
    bar();
    shouldn't that be:
    if (foo) {
    bar();
    man, I thought this golden version of the Java Foundation Library code should be almost perfect by this time now. :(
    --

    if (foo)
    bar();
    // I think the most important part of the if statement
    is the condition for executing the following
    statement(s).
    // Using this style the condition is separated from
    the code by white space which I find easier to read
    // It's also easier to maintain as you don't have to
    remember to add {} if you need to add additional
    statements.I follow camickr's example. I think it's more readable. Whitespace is a good thing, IMO, and not used enough. Putting the brace on the next line down not only makes it easier to associate opening and closing braces visually but it sets the block of code off visually from the rest. Personally, I get a gestalt effect from that.
    I don't worry about a byte here or there. It might sound like heresy, but Moore's Law makes memory and disk space cheaper and more plentiful all the time. I think maintainability and readability trumps being miserly about bytes in my thinking these days. ;)
    Spare me the "inefficiency" lectures. I know - performance matters. The 80/20 rule says that byte won't be killer.
    It's too bad that Sun doesn't follow their own conventions. Don't they do code review there?
    Joshua Bloch didn't follow the standard? Too bad - he did a great job on the collections design. Maybe he delegated it to a younger coder and missed that during the code review. Yeah, that's it! ;)

  • Suns standard classes use of constants - bad coding convention

    Wasn't sure where to post this, it didn't quite fit into Java Runtime Environment or Java Virtual Machine forums.
    I was browsing through The Java Standard classes and was amazed by their use of constants. Throughout the codes there is inserted direct constants in the code without any use of global constant declarations.
    Eg: java.lang.StringCoding:
    All over the code is inserted "ISO-8859-1" (used as default encoding) directly instead of using a declared constant DEFAULTENCODING. What if Sun want to change default encoding?
    Seems strange to me that such coding conventions are used by Sun. Any reason for this or just sloppy programing?
    Gil

    Looks like sloppy programming to me. I see no possible
    reason for it. You're not the first person to
    criticise Sun's source code. Maybe they outsourced it
    to http://www.newtechusa.com/PPI/main.asp (I can never
    remember how to format links, no matter how often
    people tell me!)
    RObinThere's logic in getting primates to program.
    Based on the popular theory that an infinite number of monkeys could
    randomly produce the works of Shakespeare, they could also produce the perfect software implementation of any given problem. The downside being that the printed documentation will be smeared liberally with faeces.
    regards,
    Owen

  • Coding conventions for SERVLETS

    Where to find coding conventions for Java Servlets ?

    Why would they be any different from the coding conventions for all of Java?
    http://java.sun.com/docs/codeconv/html/CodeConvTOC.doc.html

  • Naming Convention document for MDM

    Hi,
    I am looking for naming convention document for MDM . If anyone have then please do share with me .
    Thanks,
    Rohit
    [email protected]

    Rohit,
    if you are speaking about programming, the naming convention depends from the language that you are using, e.g. for Java:
    http://java.sun.com/docs/codeconv/html/CodeConventions.doc8.html
    for abap:
    http://help.sap.com/saphelp_nw04/helpdata/en/92/c2b084bc1d11d2958700a0c94260a5/content.htm
    for rdbms:
    http://www.ss64.com/orasyntax/naming.html
    etc. etc.
    Regards,
    Vito

  • Naming convention document...

    Hi,
    Can someone please send me a naming convention document for <b>Custom ABAP devlopment</b> and also for <b>Enterprise portals</b> on [email protected]
    Thanks.
    Regards,
    Rajesh.

    Hi Rajesh,
    It usually differs from company to company and client to client. If the client has no specific document then the company that implements will follow their own naming standards.
    check if these are of any help to you..
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sapportals.km.docs/documents/a1-8-4/sap%20xi%202.0%20%20customer%20developments
    https://websmp101.sap-ag.de/~sapdownload/011000358700004455192006E/NameConventions.pdf

  • Naming convention document for SAP BI 7.0

    Hi,
    Am looking for  Naming convention document for SAP BI 7.0 . I need for all the objects in BI 7.0.
    Thanks in advance,
    Satya

    hi Pavan
    I am not able to access that link
    Access to this place or content is restricted. If you think this is a mistake, please contact your administrator or the person who directed you here.
    please help me  to see that document...
    Regards
    Arun

  • JSPs as XML Documents -- Problems

    Hi --
    Have been following the spec for JSP as XML documents because I want to produce JSPs using XSLT. Two problems which I've yet to find anything but workarounds for:
    1. (Most pressing) JSP Documents do not allow this <%= blah %>. This creates problems when I want to dynamically create an attribute value. The spec recommends this: 'value = "%=var%"', but I've tried this in Tomcat 4.1.12 and the expression gets reproduced literally at run-time. I've searched these forums and not found an answer.
    2. Transformer wigs out on colons in "jsp:root" or "c:out" because it signifies a namespace with which it is unfamiliar. It doesn't need to recognize the namespace. Right now I'm putting in placeholders (jsp999root, for example) and replacing them after processing. Is there a better way?
    These problems are really getting in the way. Any help would be most appreciated.

    Hi,
    It looks from No. 2 that you are using JSLT since you have a fragment of a <c:out tag. I believe the syntax for getting the value out of one of these tags is actually almost identical to that in XSLT:
    value="${var}" instead of what you got from the spec,
    The spec recommends this: 'value = "%=var%"'The name spaces do have to be declared for JSLT to work, declared in the <jsp:root> tag:
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page"
    xmlns:c="http://java.sun.com/jstl/core"
    version="1.2">
    Here's a very simple jsp that uses it:
    <?xml version = '1.0' encoding = 'windows-1252'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page"
    xmlns:c="http://java.sun.com/jstl/core"
    version="1.2">
    <jsp:directive.page contentType="text/html;charset=windows-1252"/>
    <html>
         <head>
         <meta HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=windows-1252"/>
         <title>Hello World</title>
         </head>
         <body>
         <c:set var="nameString" value="John"></c:set>
         <h2>The name is: <c:out value="${nameString}"/></h2>
         </body>
    </html>
    </jsp:root>
    Of course, you have to have the tlds set up and the JSLT jars available for the compiler.
    I haven't yet tried this with transforms, but there are tags in the JSLT for that as well. If you've tried all this already, my apologies.
    Edward

  • Jaseper with JSP coding

    Hi frnds,
    I need full coding for displaying Jasper report using JSP.
    Kindly help me to sort out the problem.

    You can write Java code in your JSP which looks up an EJB and invokes methods on it.
    However it's better to use ordinary Java beans to do the EJB lookup and invocation, and access the Java beans from a JSP.

  • JSP Naming Convention in JIT/JFF

    Any kind of naming standards they follow in naming the JSPs ? I'm finding pretty long named confusing JSP file names. The first 3 character was the module name "qot" , that was one information i could understand from :-)

    yes i tried . it is working . but it looks very odd in the URL and i did not see any site that contains the _(underscore )
    in their file name.
    But still i am not sure whether i use it or not . Because I have less idea about naming convention of jsp apges

  • Naming Conventions Document on PCUI

    Hello Friends,
    Can anyone of you, please forward me a document on <b>Naming Conventions in PCUI</b>??
    Your help on this front would be highly appreciated.
    Please respond to [email protected] (my alternate id)as well
    Regards,
    Praveen

    Hi Sameer,
    Could you pls send me the naming conventions in XI.
    Thanks in advance.
    Regards,
    Saravanan.

  • Difference between facelets and jsp xml in Document Type

    I want difference between facelets and jsp in Document Type in JDeveloper 11gR2 (11.1.2)
    Thanks
    Edited by: Amr Ahmed on Jun 8, 2011 7:46 AM

    Let's see.
    Facelets creates a facelets page
    JSP creates a JSP page
    {noformat}:){noformat}
    Facelets is the "official" view language for JSF 2.0
    http://www.realdevelopers.com/blog/development/facelets-vs-jsp should give you some more insight as well.
    John

Maybe you are looking for