Archive for May, 2011

Maven SkipTests command

May 29, 2011 Comments off

This is used to skip tests while running a application with maven.

mvn install -Dmaven.test.skip=true

if you use surefire plugin use the below command

mvn install -DskipTests


Categories: Maven

Running Maven jetty plugin with a different port

May 29, 2011 Comments off
Categories: Maven

Configuring Tomcat 6 For https (SSL)

May 27, 2011 Comments off
1. JDK — i used¬†jdk 1.5.x
2. Tomcat 6.xFor any https (SSL) page a certificate is very necessary. First we will learn generating a keystore, which will contain a certificate chain. We will use the keytool command from JDK.

1. Goto the command prompt.

2. Type keytool -genkey -alias tomcat -keyalg RSA (if your path is not set to the java bin directory, please go there and type the command).

3. Now you will prompted for a keystore password give it as changeit (you can give it different but you will have to make some changes later).

4. Enter the details needed.

5. Now alias password will be aksed. It must be same as keystore password.

6. After the end of it a keystore will be generated in “drive”:\Documents and Settings\”username”\.keystore

Now configure “tomcat_home”\conf\server.xml, add the following code:-

You are done with your configuration. Save the server.xml file. Restart your tomcat. Now type https://localhost:8443This should show you the same tomcat homepage but in secured format.

Categories: General

how do I set eclipse.ini -vm option for m2Eclipse ?

May 24, 2011 Comments off

I installed maven plugin for eclipse, then I get an error like below:

please make sure the -vm option in eclipse.ini is pointing to a JDK

how to use -vm option to point to my jdk in eclipse.ini?


add jdk javaw.exe file path as the first line to the eclipse.ini file and restart the eclipse.

C:/Program Files/Java/jdk1.6.0_24/bin/javaw.exe

Categories: Maven


May 23, 2011 Comments off
Categories: Hyperic SIGAR API

Spring Ajax Sample

May 18, 2011 Comments off
package com.mycompany.samples;

import java.util.Date;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;

public class HelloWorldController
public ModelAndView helloWorld()
return new ModelAndView("hello", "message", "Spring MVC Demo");

@RequestMapping(value = "/time.html", method = RequestMethod.GET)
public @ResponseBody String getTime(@RequestParam String name)
String result = "Time for " + name + " is " + new Date().toString();
return result;
<jsp:useBean id="message" scope="request" type="java.lang.String" />
<title>Spring Ajax Demo</title>
<script type="text/javascript" src=""></script>
<script type="text/javascript">
function doAjax() {
url : 'time.html',
data : ({
name : "Vidya Sagar"
success : function(data) {
<button id="demo" onclick="doAjax()" title="Button">Get the
<div id="time"></div>
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns=""
xmlns:xsi="" xmlns:p=""

<context:component-scan base-package="com.mycompany.samples" />

<bean id="viewResolver"
p:prefix="/WEB-INF/jsp/" p:suffix=".jsp" />
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi=""
xmlns="" xmlns:web=""
id="WebApp_ID" version="2.5">



<%@page contentType="text/html" pageEncoding="UTF-8"%>
<% response.sendRedirect("hello.html"); %>

//project structure

Categories: Ajax, JQuery, Spring MVC
%d bloggers like this: