Welcome To Snipplr


Everyone's Recent Java Snippets



This is a simple lookup and usage of the default DS in JBoss
0 261 posted 14 years ago by narkisr
1 410 posted 14 years ago by raulintosh
0 224 posted 14 years ago by mehlam2
Does not include any of the U.S. properties such as Guam, Virgin Islands, and Puerto Rico.
0 477 posted 14 years ago by jrphelps
ch.qos.logback logback-classic 0.9.8
1 661 posted 14 years ago by thebugslayer
1. mvn archetype:create -DgroupId=deng -DartifactId=mywebapp -DarchetypeArtifactId=maven-archetype-webapp 2. Replace web.xml with http://snipplr.com/view/3800/minimal-webxml-webapp-descriptor-version-24 3. Replace pom.xml in this snipplet. 4. mvn...
1 416 posted 14 years ago by thebugslayer
this goes under src/main/resource/META-INF/persistence.xml
0 347 posted 14 years ago by thebugslayer
0 277 posted 14 years ago by thebugslayer
0 278 posted 14 years ago by joaocosta
Simple snippet on how to get/set a cookie
0 315 posted 14 years ago by jsbournival
Shows reading a file bundled with a Sun SPOT application. The file, called winners.txt contains the following 2 lines: Walker Griffin ----------------------------------------------------------- The output would include: NameOfFile=/winners.txt...
0 342 posted 14 years ago by javapda
This demonstrate the expressiveness of Groovy vs Java.
1 1270 posted 14 years ago by thebugslayer
0 487 posted 14 years ago by pablazo
3 387 posted 14 years ago by pablazo
This redirects visitors to a new URL using a 301 redirect. Using a 301 redirect is the safest way to let search engines like Google, Yahoo!, Live and Ask know your address has changed.
0 371 posted 14 years ago by jonhenshaw
This code uses the new Java 5 foreach loop to iterate through every element of a list. It avoids the need to declare an iterator.
0 396 posted 14 years ago by cpjobling
You can use these attributes to format the display of your form bean properties. This works pretty well in displaying currency and date/time values. For example, you can display 1234.567 as $1,234.57 and 08/12/2006 as Aug 12, 2006. In order to ge...
0 363 posted 15 years ago by springett
4 382 posted 15 years ago by springett
reading in a properties file from the file system
6 399 posted 15 years ago by springett
0 325 posted 15 years ago by whitetiger