Wednesday, March 6, 2013

Parsing all form fields from JSP

 Map parameters = request.getParameterMap();
for(String parameter : parameters.keySet()) {
    int i=0;
     String[] values = parameters.get(parameter);
      out.write(parameter);
     if (values.length>0){
         out.print(values[i]);
     }
     i++;

Tuesday, March 5, 2013

JQuery and Google chrome debugging

Ctr + Shift+ C will get you to the Chrome java script console.



Network will take you the actual page that was executed.

Source will take you to the src where you can set the debug break points.

Console is a good place where you can see the error or your custom log out puts. For example you can do the log content by console.log(data); where data is a string that is printed to the console.



Thursday, February 2, 2012

Gimp Photo scaling for even height and width.

Lot of times when you want to scale the image to a square value lets say 2x2 the scaling value won't match. To fix this use this options

  • Use the rectangle select and choose fixed  and size from drop down.
  • Give a higher square number like 2700x 2700 so that the select rectangle cover the intended area of your picture.
  • now crop the image to selection.
  • During scaling provide DPI value as 300 pixels and your intended scaling number like 2 inch and 2 inch

For clearing the background.

  • Use the fuzzy select and select the area you want to clear.
  • Use the color picker to get the color.
  • right click and fill it with the choose color
  • finish it up with paint tool to get more even color.
  • Finallyuse the fuzzy select tool again on the background now right click on the selection and select image color option and select brightness give the max value for a white background.

Wednesday, February 16, 2011

SOAPUI

Steps needed.

  1. Create a New Rest SOAPUI project.
  2. Import the WADL to create the REST project.
  • If the REST project does not have a WADL file, it can be created easily by typing the REST url with ending application.wadl under the context of REST
  • http://host/project/context/application.wadl
  • This will generate the WADL file required for SOAPUI.
  • Create a TestSetup in the SOAPUI project.
    1. Create a TestSuite.
    2. Write the Groovy script in the setup portion of the Testcase.
    3. If the Groovy file needs an external library or your application class jar that file and add them under the /bin/ext folder in SOAPUI home folder. Otherwise you will get the classnot found error during exception.
    4. Create a property file if you want a dynamic variable change during your request.
    5. Create the REST request as the test case
    6. Now change the Request file to add the properties.
    7. Run the Testsuite.

    Monday, February 14, 2011

    REST WADL

    http://10.xxx.xx.x:8080/{$projectname}/{$rest}/application.wadl That should generate the required WADL for creating SOAPUI project

    Friday, April 16, 2010

    List ports listening

    netstat -tlnp | grep 8080 netstat -tlnp | grep java

    List all installed jre linux

    /usr/sbin/update-alternatives --config java
    There are 2 programs which provide 'java'. Selection Command ----------------------------------------------- * 1 /usr/lib/jvm/jre-1.4.2-gcj/bin/java + 2 /usr/java/jdk1.6.0_18/bin/java Enter to keep the current selection[+], or type selection number: