Syntax Highlighting

To enable syntax highlighting on blogspot follow the below steps.

Go to Design –> EditHTML–>Edit Template section

Add the following just before </head>

<!-- Add-in CSS for syntax highlighting -->

<script src='http://syntaxhighlighter.googlecode.com/svn/trunk/Scripts/shCore.js' type='text/javascript'/>
<script src='http://syntaxhighlighter.googlecode.com/svn/trunk/Scripts/shBrushCpp.js' type='text/javascript'/>
<script src='http://syntaxhighlighter.googlecode.com/svn/trunk/Scripts/shBrushCSharp.js' type='text/javascript'/>
<script src='http://syntaxhighlighter.googlecode.com/svn/trunk/Scripts/shBrushCss.js' type='text/javascript'/>
<script src='http://syntaxhighlighter.googlecode.com/svn/trunk/Scripts/shBrushDelphi.js' type='text/javascript'/>
<script src='http://syntaxhighlighter.googlecode.com/svn/trunk/Scripts/shBrushJava.js' type='text/javascript'/>
<script src='http://syntaxhighlighter.googlecode.com/svn/trunk/Scripts/shBrushJScript.js' type='text/javascript'/>
<script src='http://syntaxhighlighter.googlecode.com/svn/trunk/Scripts/shBrushPhp.js' type='text/javascript'/>
<script src='http://syntaxhighlighter.googlecode.com/svn/trunk/Scripts/shBrushPython.js' type='text/javascript'/>
<script src='http://syntaxhighlighter.googlecode.com/svn/trunk/Scripts/shBrushRuby.js' type='text/javascript'/>
<script src='http://syntaxhighlighter.googlecode.com/svn/trunk/Scripts/shBrushSql.js' type='text/javascript'/>
<script src='http://syntaxhighlighter.googlecode.com/svn/trunk/Scripts/shBrushVb.js' type='text/javascript'/>
<script src='http://syntaxhighlighter.googlecode.com/svn/trunk/Scripts/shBrushXml.js' type='text/javascript'/>

Add the following just before </body>

<!-- Add-in Script for syntax highlighting -->

<script language='javascript'>
dp.SyntaxHighlighter.BloggerMode();
dp.SyntaxHighlighter.HighlightAll('code');
</script>

Add the <pre> tag surrounding the code snippets.

<pre class="xml" name="code">

Your XML goes here
</pre>


<pre class="java" name="code">
Your Java code goes here
</pre>

How to kill a process running on a port

Hi All,
Many of the Java developers frequently facing some problems with ports.
Ex: If JBoss server has started and closed accedentally without properly shutdown process , several processes will remain running on some ports which will causes Port Already binded kind of exceptions.
In that kind of situations, we can forcefully kill a process running on a port as follows:
1. get the PID of that process
d:>netstat –ao

2. kill the process
D:>taskkill /F /PID p_id

Struts1 Vs Struts2 Vs JSF Vs SpringMVC

Hi,

Recently I have done some research on J2EE Web frameworks usability and features to decide the framework to be used for one of my new projects.
I consider Struts 1, Struts2, JSF and Spring MVC. After spending some hours on going through each of the frameworks features and some more hours to do a simple application(Proof Of Concept).
In this process i was excited looking at some of the features, become a fan of one of the frameworks, felt home sick to leave my all time favourite framework and irritated with some of the frameworks.

Struts1:

This is my all time favourite web framework.Still I love this technology because of its simplicity.Today every new j2ee web framework starts promoting their framework by comparing with Struts because the Struts was adopted by the Java developer community as a default web framework for developing web applications. Now i am feeling sick to leave this struts framework as i fall in love with some other framework on which todays Architects/Developers are Springing.

SpringMVC:

SpringMVC, which is an MVC based web framework with the full support of all the Spring features(IOC/DI, AOP etc..).I really enjoyed learning the SpringMVC because of its simplicity, the number of view technology choices its offering, the different types of controllers each with a dedicated purpose, different ways of URL mappings to controllers and so many other features.

Struts2:

The only reason that force me to study Struts2 is the number of UI controls its offering for build Web pages. I appreciate the Struts2 authors as they tried and build a web application framework with several architectural improvements. But to be said frankly i feel difficult in understanding the Struts2 concepts because of their complex nature.

JSF:

The JSF is Standard Web Framework for developing J2EE Web Applications. Unlike other frameworks which are action oriented, JSF is a Component Oriented framework which brings Swing like programming to the web development. JSF provides rich set of UI controls. Apart from this I didn’t find any new features that are not provided by other frameworks. But i feel very much difficulty in learning and writing a simple POC with JSF. JSF guys claiming that JSF is a render independant technology. That is we can build UIs that can be rendered by Web Browser or by a Mobile. But when it is sure that the application will be run on web browsers only, then why should one take care about JSFs render independent feature and its complexity.

Finally i decided to go with SpringMVC.