conventions

What are the conventional locations for for JSPs, JavaScript, CSS, Images in Maven web projects?

删除回忆录丶 提交于 2019-12-18 03:29:25
问题 I need to convert a traditional J2EE web application into a new Maven web project. In traditional project JSPs are under WebApp/jsps folder, JavaScript & CSS files under WebApp/scripts folder, image under WebApp/images folder, .properties files under WebApp/resources folder. In the Maven project where would each of those file types go? Should I create folders under src/main/webapp such as: src/main/webapp/jsps , src/main/webapp/images , src/main/webapp/resources … etc and copy the files from

javascript/DOM event name convention

允我心安 提交于 2019-12-17 23:09:37
问题 Hi when I started doing web development, I realized javascript event names were all in lower case with no separators, i.e. "mousedown" , "mouseup" , etc. And when working with the jQuery UI library, I noticed they also use the same convention; i.e. "dropdeactivate" as in the following example javascript $( ".selector" ).on( "dropdeactivate", function( event, ui ) {} ) While this works well for names that are only 2 or 3 words, it is really awful for names with more words on it. Despite of

Lisp commenting convention

為{幸葍}努か 提交于 2019-12-17 17:33:23
问题 What is the Lisp convention about how many semicolons to use for different kinds of comments (and what the level of indentation for various numbers of semicolons should be)? Also, is there any convention about when to use semicolon comments and when to use #|multiline comments|# (assuming they exist and exist on multiple implementations)? 回答1: In Common Lisp: ;;;; At the top of source files ;;; Comments at the beginning of the line (defun test (a &optional b) ;; Commends indented along with

Python “private” function coding convention

岁酱吖の 提交于 2019-12-17 15:59:17
问题 When writing a python module and functions in it, I have some "public" functions that are supposed to be exposed to outsiders, but some other "private" functions that are only supposed to be seen and used locally and internally. I understand in python there is no absolute private functions. But what is the best, most neat, or most used style to distinguish "public" functions and "private" functions? I list some of the styles I know: use __all__ in module file to indicate its "public"

Learning Ant path style

给你一囗甜甜゛ 提交于 2019-12-17 05:36:27
问题 Where can I find resources to learn Ant path style conventions? I've gone to the Ant site itself, but couldn't find any information on path styles. 回答1: Ant-style path patterns matching in spring-framework: The mapping matches URLs using the following rules: ? matches one character * matches zero or more characters ** matches zero or more 'directories' in a path {spring:[a-z]+} matches the regexp [a-z]+ as a path variable named "spring" Some examples: com/t?st.jsp - matches com/test.jsp but

Difference between <script src=“foo.js”></script> and <script src=“foo.js”/>? [duplicate]

十年热恋 提交于 2019-12-17 02:51:42
问题 This question already has an answer here : Difference between <script /> and <script></script> for importing multiple js file in HTML (1 answer) Closed 2 years ago . What's the difference between these two ways of pulling javascript into a page? <script src="foo.js"></script> Vs: <script src="foo.js"/> The script tag isn't going to have children, so there's no need to separate the start and end tags, right? Like how if you have an empty row in a table, you can do <tr/> instead of <tr></tr> ?

Java Coding standard: multiple variable declaration [closed]

♀尐吖头ヾ 提交于 2019-12-16 18:03:45
问题 Closed . This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 5 years ago . Which of the following is best practice according to Java coding standards public void function1(){ int i1 = 0, i2 = 1, i3 = 2; // some code here } public void function1(){ int i1 = 0; int i2 = 1; int i3 = 2; // some code here } Is there any practice which recommends the

What is the best way to style in css?

心不动则不痛 提交于 2019-12-14 03:10:58
问题 I read through this (this is a post from css-tricks.com), and this (this one is a comment to a post). This is how my css looks: .m0 { margin : 0%; } //m0 = Margin 0% <br> .mla { margin-left : auto; } //mla = Margin Left Auto <br> .mra { margin-right : auto; } //mra = Margin Right Auto .w100px { width : 1000px; } //w1000px = Width 1000px .h100 { height : 100%; } //h100 = Height 100% etc.. I use my css only with classes, like this: <html class="h100"> <!-- Height 100% -->, <body class="m0 h100"

What is the advantage of the 'src/main/java'' convention?

匆匆过客 提交于 2019-12-13 11:32:27
问题 I've noticed that a lot of projects have the following structure: Project-A bin lib src main java RootLevelPackageClass.java I currently use the following convention (as my projects are 100% java): Project-A bin lib src RootLevelPackageClass.java I'm not currently using Maven but am wondering if this is a Maven convention or not or if there is another reason. Can someone explain why the first version is so popular these days and if I should adopt this new convention or not? Chris 回答1: Main

Where to put AbstractPersistenceEventListener subclasses in Grails 2.5.4?

末鹿安然 提交于 2019-12-13 06:28:37
问题 I want to subclass AbstractPersistenceEventListener so I can register custom event listeners in Grails 2.5.4. However, where should I place these subclasses? Most importantly I want these event listeners to use autowired beans, especially service beans. If I put these classes in src/groovy , it seems I'll have to manually register the beans in resources.groovy , which is an extra step I'd like to avoid. 回答1: This post shows how you can register a custom event listener in grails if you are not