Pages

Thursday, February 28, 2013

Java Script Basics

Java Script validation:

String length validation:

This Tag Validate the String length by property of (“str.length”) .JavaScript validation is not secure as anybody can change what your script does in the browser. Using it for enhancing the visual experience is ok though.
Code :
var textBox = document.getElementById("myTextBox");
var textLength = textBox.value.length;
if(textLength > 5)
{

Saturday, February 16, 2013

Servlet Retrieving all request, response, header elements

Request Handling Practices :

                Hi, When we going to resolving issue need to ensure the request parameters are valid, and all the parameters are valid.

1.Retrieve the request parameters:

Usage : This 'll help you to ensure the request parameters:

String values[];String attripute="";

Enumeration obj_enum=request.getParameterNames();
  while(
obj_enum.hasMoreElements()){
    
attripute=(String) obj_enum.nextElement();
   values=request.getParameterValues(
attripute);
  if(values!=null){
  for(String str:values)
  System.out.println("Name : "+
attripute+" && Values : "+str);
   }
  }