Wednesday, February 27, 2008

Preventing Cross Site Scripting (XSS) Attacks

I came across very nice & informative article by Greg Murray on his blog here.
He had explained the XSS attacks & how to prevent them very nicely. Really worth reading :)

Tuesday, February 26, 2008

-C-O-N-C-E-P-T- Series : Java

<CONCEPT>

Casting String to Boolean in Java:

We can achieve this using the Boolean class' static method:
Boolean.parseBoolean(String s) - returns a boolean value

Sample code:


String str = "true";
if( Boolean.parseBoolean(str) ){
    System.out.println("Value is true");
} else{
    System.out.println("Value is false");
}


Casting Boolean to String in Java:

We can achieve this using the String class' static method:
String.valueOf(boolean b) - returns the string representation of the boolean argument

Sample code:


boolean blnFlag = true;
String strVal = String.valueOf(blnFlag);

</CONCEPT>

-C-O-N-C-E-P-T- Series

Hello Friends,

It have been a very long time since I've posted my last blog. I have came up with a new idea of posting blogs on any kind of CONCEPT related to programming(any language), design patterns or any technical stuff. Please feel free to correct me at appropriate points.

Thanks.

Keep visiting... :)

Saturday, February 9, 2008

Locked Struts2 bug on Apache JIRA

Struts2 has in-built functionality of ajax enabled date-time picker control. But it has got one bug, which I've locked on Apache JIRA [here]

Bug Details:

Struts Version: 2.0.11

Description:
Suppose, I am currently on date Jan, 2008. When I click on the the dates 30, 31 on the topmost left corner, it takes the date as 1/3/2008 & 2/3/2008 [dd-mm-yyyy].
Same thing happens when I go to the month of Dec & click on the Jan dates. This problem is there while changing the year. I was dealing with the default view of the control.

Hope it gets fixed in the future releases of Struts2.

Saturday, February 2, 2008

Using JConsole to monitor and manage JVMs

In-built monitoring and management support:
The J2SE 5.0 release provides built-in comprehensive monitoring and management support. It not only defines the management interfaces for the Java virtual machine, but also provides out-of-the-box remote monitoring and management on the Java platform and of applications that are running on it.
Also the JDK 5.0 includes the Java Monitoring and Management Console (JConsole) tool. It uses the extensive instrumentation of the Java virtual machine to provide information on performance and resource consumption of applications running on the Java platform using Java Management Extension (JMX) technology.

What is JConsole?
It's a JMX-compliant graphical tool for monitoring a Java virtual machine. It can monitor both local and remote JVMs.

I tried monitoring both local & remote JVMs. Really it's a very useful tool that helps user know the memory used by their application & many other important things. It is useful for both, a developer & a tester.

I've started exploring more on this tool as it'll be very much helpful in our Projects which will make them more efficient. I'll regularly post my experiences regarding my future explorations. Keep visiting :)


_________________________________________________________________________________________________________________

"Look at the sky. We are not alone. The whole Universe is friendly to us and conspires only to give the best to those who dream and work."

- Dr. A P J Abdul Kalam
_________________________________________________________________________________________________________________