Navigation Home / Tags / Java

ranking Sort Sort   |   date Sort Sort   |   member Sort Sort
Syndication

6
Date Submitted Sun. Jul. 23rd, 2006 5:39 PM
Revision 1
Helper rugi
Tags Array | Java | Random
Comments 0 comments
Method for get n random number's
-4
Date Submitted Wed. May. 31st, 2006 3:19 AM
Revision 2
Beginner fazen
Tags Image | Java | servlet | Stream
Comments 1 comments
Servlet returning an image.
10
Date Submitted Fri. May. 26th, 2006 11:16 AM
Revision 2
Coder mattrmiller
Tags "Email Address" | Java | String | Validate
Comments 2 comments
Fixed the regular expression to check for more strict requirements.
9
Date Submitted Thu. May. 18th, 2006 2:02 AM
Revision 3
Helper jbuchberger
Tags Java
Comments 0 comments
With Java Web Start 1.5.0 all of a sudden new proxy properties were introduced (deployment.proxy.http.host, deployment.proxy.http.port and deployment.proxy.bypass.list) valid only for the webstart environment - and if that was not enough yet, it does not support the existing proxy properties, neither the standard, nor the deprecated ones from old Java releases. To topple even that, for the bypass-list the delimiters were changed to semicolon (http.nonProxyHosts has the pipe char as delimiter) ...

standard networking properties

the workaround here makes sure, that if any one of these proxy properties (deprecated, standard or webstart-5 ones) are set, that all the others get the same settings - this pays off, if you're using different third-party components relying on one specific set of these proxy properties (especially if it's beyond your power, in what kind of environment the software will be executed respectively integrated...)
7
Date Submitted Mon. May. 15th, 2006 11:25 AM
Revision 4
Helper jbuchberger
Tags ant | builds | Java
Comments 0 comments
if you use the same buildfiles on your local codebase and your continuous integration buildserver, the if-attribute for ant's targets comes in handy...

for this ant buildfile snippet to only create+publish javadoc when executed on the buildserver, the buildserver only has to set the referred system property, e.g. on its startup by using a Java D-option "-Dcontinuous.build=true" ...

ant buildtool website
10
Date Submitted Thu. May. 11th, 2006 10:19 AM
Revision 3
Helper jbuchberger
Tags BATCH | Java
Comments 2 comments
Java properties files can yield undesirable results at runtime, if there happen to be spaces at the end of some lines.

Requires a win32 port for the GNU utilities grep and sed - e.g. http://unxutils.sourceforge.net/.
12
Date Submitted Tue. May. 9th, 2006 9:36 AM
Revision 1
Helper jpinkham
Tags Email | Java | Validate
Comments 1 comments
Another solution recommends using a text match pattern.
This works, but as long as you've got mail.jar in your classpath anyway, you might as well use this technique instead. (Plus, I think it works with older JDK 1.2+, whereas pattern.compile is 1.4+)

Note that it also accepts a comma-separated list of emails, just like a To: or CC: address line would.
6
Date Submitted Tue. Apr. 25th, 2006 1:03 PM
Revision 1
Coder mattrmiller
Tags Generate | Java | UID
Comments 3 comments
Another way to generate a unique ID.
9
Date Submitted Tue. Apr. 11th, 2006 9:53 AM
Revision 2
Coder mattrmiller
Tags Java | Read | Stream | URLConnection | Write
Comments 0 comments
Reading and writing to a URL connection, thanks to Java.
6
Date Submitted Fri. Apr. 7th, 2006 9:50 AM
Revision 1
Helper jpinkham
Tags CLASSPATH | DOS | Java
Comments 2 comments
Here's a nifty trick I often use for testing.

Lets say you have a c:\foo\lib directory full of jarfiles for log4j, javamail...whatever.

Modern J2EE containers do a nice job of letting you deploy a jarfile with your code and have a lib directory full of jarfiles like this, but what if you just want to run a quick client from the command line?

Here's what you do: