Saturday, 9 July 2011

Big Banyan Tree


Seeing the Dodda Alada Mara (Big Banyan Tree) in Bangalore is an incredible experience, often evoking a sense of awe and serenity. This majestic banyan tree, located in the village of Kettohalli, about 28 kilometers from Bangalore, is over 400 years old and spreads across 3 acres, making it one of the largest trees in India. The vast canopy of interlinked aerial roots and branches showcases the sheer power and beauty of nature. Standing beneath it, you might feel humbled by its age and size, as though you're witnessing a timeless force of life. The cool shade and the tranquil atmosphere of the tree make it a perfect place to connect with nature and experience a sense of calm.

Friday, 8 April 2011

Digital Signature


Digital signature
Digital signature algorithm is the one that makes the receiver believe that the message was sent by the claimed sender, and trust the message.
There are different types of signing techniques for Example Text signer, Xml signer etc.. We used the XML Signer. First I will explain the signing process how it will take place.
User will pass the Data along with the certificate and signing process will sign the Data using the certificate and pass the data with signature and certificate. We are calling this data as digitally signed Data. Receiver will separate the data and signature form the digitally signed data. And make another signature from that data and compare the both signature.
CAPICOM is a discontinued ActiveX control created by Microsoft to help expose a select set of Microsoft Cryptographic Application Programming Interface (CryptoAPI) functions through Microsoft Component Object Model (COM). CAPICOM can be used to digitally sign data, inspect, verify and display their digital signature and/or digital certificate. CAPICOM Version 2.1.0.2, the latest and last version of CAPICOM, is officially supported on Windows Vista. We are using CAPICOM Version 2.1.0.2
Signing Process
  • We are passing Data for signing and the certificate information.
  • CAPICOM will take the certificate details like Hash algorithm and apply that algorithm to data and get the Hash called it as Message Digest (MD).
  • Using this MD and primary key which is present in certificate, it will create the signature
  • It will integrate signature certificate and Data. This data is called digitally signed data.
Verify Process
  • We are passing the digitally signed data for verification
  • It will separate the Data signature and certificate.
  • Using data it will create once again the hash (message Digest) let’s say MD1, using certificate primary key and hash algorithm.
  • It will get another MD using signature which is passed though digitally signed data, using local key of certificate. Let’s say this MD as MD2
  • For verifying the signing it will check the MD1 is equal to MD2 or not.

Sunday, 13 February 2011

Struts Life Cycle EXample


  • When any struts based web application loaded into serverinitially it will load the ActionServlet class, due to<load-on-startup> tag in web.xml.
  • It will read struts-config.xml file, due to <init-param> tag inweb.xml.
  • When anybody makes request to the respective webapplication it will display the file which is mentioned in<welcome-file-list> tag of web.xml file.
  • When the view page(.jsp) is displayed to the user internally the strutsframework (ActionServlet) will create an object for the formbean class
  • Which extends the ActionForm by calling zero argument constructor(default construtor) which is mapped with the Action class path mentioned in .jsp file <html:form action=”/path”> later it will call the reset() and all the getter methods of the form bean class.
  • When the user fills the form and submit the input, our form bean class again calls the default constructor, reset(), all setter() methods, validate() methods respectively.
  • Validate method return ActionErrors object. If the ActionErrors object contains any error values(ActionError/ActionMessage values) then the ActionServlet calls the input page mapped with respective action class(<action input=”/input.jps”) that page will display to the user with error messages.
  • If ActionErrors object is null(doesn’t contains any ActionError/ ActionMessage) then the ActionServlet calls the execute() method of the Action class which is bind with input request (<action path=”/path” type=”package.OurActionClass”).
  • execute() method will return ActionForward object. Depend onthe value, again the ActionServlet will call the respectiveview(.jps page) as response and send it back to user.
Web.xml
<servlet>
<servlet-name>action</servlet-name>
<servlet-class> org.apache.struts.action.ActionServlet </servlet-class>
<init-param>
<param-name>config</param-name>
<param-value>/WEB-INF/struts-config.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>
<taglib>
<taglib-uri>/WEB-INF/struts-html.tld</taglib-uri>
<taglib-location>/WEB-INF/struts-html.tld</taglib-location>
</taglib>
struts-Config.xml
<action path=”/Name” type=”example.NameAction” name=”nameForm” input=”/index.jsp”>
<forward name=”success” path=”/displayname.jsp”/>
<forward name=”failure” path=”/index.jsp”/>
</action>
NameAction.java
public class NameAction extends Action {
public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
String target = new String(“success”);
if ( form != null ) {
// Use the NameForm to get the request parameters
NameForm nameForm = (NameForm)form;
String name = nameForm.getName();
}
// if no mane supplied Set the target to failure
if ( name == null ) {
target = new String(“failure”);
}   else {
request.setAttribute(“NAME”, name);
}
return (mapping.findForward(target));
}
}
NameForm.java
public class NameForm extends ActionForm {
private String name = null;
public String getName() {
return (name);
}
public void setName(String name) {
this.name = name;
}
public void reset(ActionMapping mapping, HttpServletRequest request) {
this.name = null;
}
}
Index.jsp
<html>
<head>
<title>Sample Struts Application</title>
</head>
<body>
<html:form action=”Name” name=”nameForm” type=”example.NameForm”>
<table width=”80%” border=”0″>
<tr>
<td>Name:</td>
<td><html:text property=”name” /></td>
</tr>
<tr>
<td><html:submit /></td>
</tr>
</table>
</html:form>
</body>
</html>
displayName.jsp
<html>
<head>
<title>Sample Struts Display Name</title>
</head>
<body>
<table width=”80%” border=”0″>
<tr>
<td>Hello <%= request.getAttribute(“NAME”) %> !!</td>
</tr>
</table>
</body>
</html>

Friday, 4 February 2011

ORA-28112: failed to execute policy function


ORA-28112: failed to execute policy function
Cause: The policy function has one or more error during execution.
Action: Check the trace file and correct the errors.
Some instatnce are not closed and it reached to max size
My case I was not closed the preparestatemet and it was in loop and reached to max size
At end of code, closed it
PreparedStatement insertStatement = null;
insertStatement = dBConnection.prepareStatement(query);
—-
insertStatement.clearParameters();
insertStatement.close();

Monday, 31 May 2010

Hampi Karnataka

  Visiting Hampi, the UNESCO World Heritage Site in Karnataka, is an unforgettable experience that evokes a mix of awe, wonder, and reverence. As the capital of the historic Vijayanagara Empire, Hampi is a place where history, culture, and nature converge in a truly magical way. Here's how one might feel after experiencing Hampi:

1. Awe at the Grandeur of History

The sheer scale and architectural brilliance of structures like the Virupaksha Temple, Vittala Temple with its iconic Stone Chariot, and the Lotus Mahal leave you marveling at the ingenuity of the Vijayanagara artisans. It’s like stepping back in time to witness the glory of one of India's greatest empires.

2. Reverence for Spirituality

Hampi's temples and ruins resonate with spiritual energy. The tranquil Achyutaraya Temple or the sacred bathing ghats along the Tungabhadra River create a deep connection with the divine, inspiring a sense of peace and introspection.

3. Admiration for Nature's Role

The surreal landscape of boulder-strewn hills, lush paddy fields, and the winding Tungabhadra River adds a mystical charm to Hampi. Watching a sunset from Matanga Hill or the boulder hills creates a sense of wonder and serenity.

4. Curiosity and Imagination

Wandering through the ruins, you might find yourself imagining how life was during Hampi's golden era. The bustling bazaars, royal processions, and thriving trade are almost tangible as you explore remnants like the Hazara Rama Temple and the Queen’s Bath.

5. Pride in Heritage

As you absorb the legacy of the Vijayanagara Empire, there’s a sense of pride in the cultural richness and historical depth of India.

6. Humility and Reflection

The ruins of Hampi, once a prosperous city, remind you of the impermanence of even the grandest achievements. It’s a place that inspires reflection on the passage of time and the resilience of culture.

7. Joy in Exploration

From cycling through the ruins to climbing hills, crossing rivers on coracles, and discovering hidden gems, Hampi offers endless adventure and joy. Every corner has a story waiting to be uncovered.