- Preferences
- General
- Ant
- Editor
- Formatter
- Tab size: 3
- Use tab character instead of spaces: uncheck.
- Tab size: 3
- Formatter
- Editor
- Editors
- Displaced tab width: 3
- Insert spaces for tabs: Check.
- Show line numbers: Check.
- Text Editors
- Spelling
- Enable spell checking: Uncheck.
- Enable spell checking: Uncheck.
- Spelling
- Displaced tab width: 3
- Ant
- Java
- Code Style
- Qualify all generated field accesses with 'this.': Check.
- Formatter: new profile "carl"
- Indentation
- General settings
- Tab policy: Spaces only
- Indentation size: 3
- Tab size: 3
- Tab policy: Spaces only
- General settings
- Indentation
- Qualify all generated field accesses with 'this.': Check.
- Compiler
- Errors/Warnings
- Potential programming problems
- Serializable class without serialVersionUID: Ignore
- Serializable class without serialVersionUID: Ignore
- Potential programming problems
- Errors/Warnings
- Editor
- Folding
- Initially fold
- Imports: uncheck.
- Imports: uncheck.
- Initially fold
- Folding
- Code Style
- General
2009-09-23
My Eclipse settings
Eclipse is a great Java IDE. There are just a few things I don't like about its default configuration. Fortunately, it's highly configurable.
2009-09-03
Substring labels in Blogger
Have you ever tried giving your blog post multiple labels, one of which is a substring of the other?
Example: spring security, spring.
Once Google Blogs has latched on to the longer string, it will move heaven and earth to auto-complete the shorter one for you.
One solution is to add a comma immediately after the short string. Auto-completion won't try to overrule you then.
Example: spring security, spring.
Once Google Blogs has latched on to the longer string, it will move heaven and earth to auto-complete the shorter one for you.
One solution is to add a comma immediately after the short string. Auto-completion won't try to overrule you then.
2009-07-30
Table height = Browser window height WITHOUT quirks mode!
In spite of all the CSS hype, I still occasionally like to use tables to lay out a page. I think there are some layout situations where a table lets you do things CSS layouts don't.
For a long time, I've been despairing about the apparent impossibility of getting a page to fill the browser screen, or a known proportion of it, independently of the user's browser window size and without using JavaScript.
It used to be that a table at 100% height would fill the screen vertically. However, this was a "feature" of the so-called "quirks mode." If you build a Web page with a "proper" DOCTYPE, you hint to the browser that you know how to build standards compliant Web pages, and in return it renders your page more or less rigidly according to the standard.
This is very thoroughly explained by Gary White on the AppTools site .
The good news is, there's a standard compliant workaround. You can use CSS to set the height of the <html> and <body> elements of the page to 100%; their parent is the screen, so they will. Then you can use CSS to set the height of your table to 100%, and it will fill your screen.
For a long time, I've been despairing about the apparent impossibility of getting a page to fill the browser screen, or a known proportion of it, independently of the user's browser window size and without using JavaScript.
It used to be that a table at 100% height would fill the screen vertically. However, this was a "feature" of the so-called "quirks mode." If you build a Web page with a "proper" DOCTYPE, you hint to the browser that you know how to build standards compliant Web pages, and in return it renders your page more or less rigidly according to the standard.
This is very thoroughly explained by Gary White on the AppTools site .
The good news is, there's a standard compliant workaround. You can use CSS to set the height of the <html> and <body> elements of the page to 100%; their parent is the screen, so they will. Then you can use CSS to set the height of your table to 100%, and it will fill your screen.
2009-07-22
import static in a JSP
I have yet to try this, but according to this post on the GlassFish forum, the way to do an "import static" in a JSP is like this:
<%@ page import="static foo.*" %>
Implementing an interface in a JSP
I've scoured the net, but apparently it's not possible to make a Java Server Page implement an interface. Not directly, anyway.
What is possible is to extend a class. The directive is:
One reference for JSP page directives is: http://java.sun.com/products/jsp/tags/11/syntaxref11.fm7.html .
The class generated from a JSP usually extends
... and then use "my.package.MyJSP" in a "page extends" directive as shown above.
The caveat to this is that some Web containers will generate their own subclasses of HttpServlet, presumably for some kine of optimization, and using the "page extends" directive will sabotage this scheme. It should still work, it just won't include the fancy footwork your Web container intended to do.
What is possible is to extend a class. The directive is:
<%@ page extends="package.class"%>One reference for JSP page directives is: http://java.sun.com/products/jsp/tags/11/syntaxref11.fm7.html .
The class generated from a JSP usually extends
HttpServlet. If you really want to have your JSP implement an interface, you could do something likemy.package.MyJSP
public abstract classextends HttpServlet implementsMyInterface{
}
... and then use "my.package.MyJSP" in a "page extends" directive as shown above.
The caveat to this is that some Web containers will generate their own subclasses of HttpServlet, presumably for some kine of optimization, and using the "page extends" directive will sabotage this scheme. It should still work, it just won't include the fancy footwork your Web container intended to do.
2009-05-01
Getting the 'wicket:id' attribute to validate
Wicket is great. The "wicket:id" attribute is all that needs to be added to a tag to place it under program control.
If you have a finicky validator (or any validator), it may object to the attribute, which isn't part of (X)HTML.
The solution is to add a namespace declaration, like this:
If you have a finicky validator (or any validator), it may object to the attribute, which isn't part of (X)HTML.
The solution is to add a namespace declaration, like this:
<html xmlns:wicket="http://wicket.apache.org">
Mixing Java and Scala in an Eclipse Project
If you start a project off as a Scala project, then it's OK to mix in some Java source. Everything will be compiled as appropriate, and library references will work out too.
But for some projects, such as the "Dynamic Web Project," that's not an option. You must convert it to a Scala project after it's created as a Java project.
Fiddling with the contents of .project manually didn't get me anywhere.
The correct procedure, as found on Nabble, is:
But for some projects, such as the "Dynamic Web Project," that's not an option. You must convert it to a Scala project after it's created as a Java project.
Fiddling with the contents of .project manually didn't get me anywhere.
The correct procedure, as found on Nabble, is:
As a general rule you should convert Java projects to Scala projects
by using the "Add Scala Nature" package explorer context menu action
unless you know what you're doing.
Subscribe to:
Posts (Atom)
