http://www.devdaily.com
http://www.vaannila.com/struts-2/struts-2-example/struts-2-validation-example-1.html
http://www.precisejava.com/javaperf/j2ee/EJB.htm
http://www.devx.com/java/Article/29309/1954
http://www.thatsjava.com/category/java-bean-j2ee/
http://sourceforge.net/
http://articles.sitepoint.com/category/java
http://pdf.coreservlets.com/
http://www.javalobby.org/articles/hibernatequery103/?source=archives
http://www.jwebhosting.net/servlets/jr123/fill.html
http://devzone.skillfusion.com/jasperArticle8.php
www.orafaq.com/wiki/SQL_FAQ
http://www.bodo.com/javacool.htm
http://www.roseindia.net/answers/viewqa/Java-Beginners/6613-how-to-store-data-in-table-using-swings.html
http://www.thatsjava.com/category/jdbc/
http://snippets.dzone.com/posts/show/12961
http://scjptest.com/ http://www.javalobby.org/java/forums/t76867.html
http://www.javachamp.com/public/renderExamQuestion.xhtml?groupId=1938
http://www.jchq.net/mockexams/exam1.htm
http://www.javacertificationexams.com/scjp-mock-exams.php
http://www.javacertificationexams.com/view.php?book=home-1.tiscali.nl/~bmc88/java/javacert/newboone1-19.html&t=Sun+Certified+Programmer+Practice+Exam+by+Barry+Boone+Part+I
http://www.java2s.com/Code/Oracle/User-Previliege/Grant-Permission.htm
"Misc "
<input type="text" name="yourname" />
your First Text Are
</textarea>
<button type="button" onClick='yourSubmit();'>Click </button>
Or
<input type="button" value="Click">
<input type="submit" value="Submit" />
<input type="reset" value="Reset" />
<input type="checkbox" name="vehicle" value="Bike" checked />
<option value="NJ">New Jersy</option>
</select>
<li>First Bullet</li>
<li>First Bullet</li>
</ul>
Div :
<div style="display: none;">
<h2>Click Here</h2>
</div>
<h2>Click Here</h2>
</div>
BufferedInputStream bis = new BufferedInputStream(
new FileInputStream(f));
CacheManager cacheManager = CacheManager.create(bis);
Step 2 : Putting Data in Cache
cacheManager.getCache(YOUR_CACHE).get(key));
Object valeu = element.getValue();
Step 3 : Getting Data From Cache
cacheManager.getCache(YOUR_CACHE).put(new Element(key, value));
maxElementsInMemory="1000"
eternal="true"
timeToLiveSeconds="0"
timeToIdleSeconds="0"
diskPersistent="false"
overflowToDisk="false"
memoryStoreEvictionPolicy="LRU"
>
from HTML to autogenerated source code) based on templates. It's a Java package,
a class library for Java programmers. It's not an application for end-users in itself,
but something that programmers can embed into their products.
import java.util.*;
import java.io.*;
static{
/* Create and adjust the configuration */
Configuration cfg = new Configuration();
cfg.setDirectoryForTemplateLoading(
new File("/store/templates"));
cfg.setObjectWrapper(new DefaultObjectWrapper());
}
/* Get a template */
Template temp = cfg.getTemplate("test.ftl");
Map root = new HashMap();
root.put("user", "John Joe");
Map latest = new HashMap();
root.put("latestProduct", latest);
latest.put("url", "test/yourTest.html");
latest.put("name", "yourTest");
Writer out = new OutputStreamWriter(System.out);
temp.process(root, out);
out.flush();
}
}
Hello $name ! How are you ?
import java.io.StringWriter;
import org.apache.velocity.app.VelocityEngine;
import org.apache.velocity.Template;
import org.apache.velocity.VelocityContext;
public class HelloWorld
{
public static void main( String[] args )
throws Exception
{
/* initialize an engine */
VelocityEngine ve = new VelocityEngine();
ve.init();
/* get the Template */
Template t = ve.getTemplate( "sayHello.vm" );
/* create a contex */
VelocityContext context = new VelocityContext();
context.put("name", "John");
StringWriter writer = new StringWriter();
t.merge( context, writer );
System.out.println( writer.toString() );
}
}
Output : Please see below Name is replaced with "John"
db.driverName=com.mysql.jdbc.Driver
db.userName=userName
db.passWord=password
URL = "jdbc:sybase:Tds:Host:port/yourDB";
integratedSecurity=true;
log4j.appender.FILE=util.ownHTMLFileAppender
log4j.appender.FILE.layout=org.apache.log4j.HTMLLayout
log4j.appender.FILE.layout.Title=HTML Layout Example
log4j.appender.FILE.layout.LocationInfo=true
package util;
import java.io.IOException;
import org.apache.log4j.Layout;
import org.apache.log4j.spi.ErrorCode;
* This is a customized log4j appender, which will create a new file for every
* run of the application.
*
*
*/
public class OwnHTMLFileAppender extends FileAppender {
}
boolean append, boolean bufferedIO, int bufferSize)
throws IOException {
super(layout, filename, append, bufferedIO, bufferSize);
}
boolean append) throws IOException {
super(layout, filename, append);
}
throws IOException {
super(layout, filename);
}
if (fileName != null) {
try {
fileName = getNewLogFileName();
setFile(fileName, fileAppend, bufferedIO, bufferSize);
} catch (Exception e) {
errorHandler.error("Error while activating log options", e,
ErrorCode.FILE_OPEN_FAILURE);
}
}
}
if (fileName != null) {
final String DOT = ".";
final String HIPHEN = "-";
final File logFile = new File(fileName);
final String fileName = logFile.getName();
String newFileName = "";
if (dotIndex != -1) {
// the file name has an extension. so, insert the time stamp
// between the file name and the extension
newFileName = fileName.substring(0, dotIndex) + HIPHEN
+ +System.currentTimeMillis() + DOT
+ fileName.substring(dotIndex + 1);
} else {
// the file name has no extension. So, just append the timestamp
// at the end.
newFileName = fileName + HIPHEN + System.currentTimeMillis();
}
return logFile.getParent() + File.separator + newFileName;
}
return null;
}
}