Skip to main content

Posts

Showing posts from 2011

java program to encode string to a valid url

public static String encodeURIComponent(String s)   {     String result = null;     try     {       result = URLEncoder.encode(s, "UTF-8")                          .replaceAll("\\+", "%20")                          .replaceAll("\\%21", "!")                          .replaceAll("\\%27", "'")                          .replaceAll("\\%28", "(")                          .replaceAll("\\%29", ")")                          .replaceAll("\\%7E", "~");     }     // This exception should never occur.     catch (UnsupportedEncodingException e)     {       result = s;     }

enable multi yahoo messenger

Yahoo Messenger is a popular instant messaging software around. Yahoo messenger, by default, runs only a single copy on a single machine so for people with multiple yahoo id's this is a problem. Here is a short snippet that makes yahoo messenger to run multiple versions. REGEDIT Open the registry editor. Start > Run > regedit Navigate to +- HKEY_CURRENT_USER +- Software +- yahoo +- pager Create a new key inside pager named Test Now inside the Test folder create REG_DWORD named plural with value 1. Now you should be able to run multiple instances of yahoo messenger. Alternate Method Copy paste the text below exactly to a file with extension ".reg" REGEDIT4 [HKEY_CURRENT_USER\Software\yahoo\pager\Test] "Plural"=dword:00000001 Double click the reg file and press "yes".

enable multi instance of windows live messenger

Run Registry Editor (regedit). Navigate to the following registry key: KEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Live\Messenge For 64-bit (x64) OS, go to following registry branch instead: HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows Live\Messenger In the right pane, right click on any blank space, select New on context menu, and then click on DWORD (32-bit) Value. Name the new registry value entry as MultipleInstances. Modify the MultipleInstances and set its value data as 1. Start as many Windows Live Messenger windows as you want from Start Menu.

Struts Full Document

1-   Environment setup Eclipse, MyEclipse, Tomcat, Netmeeting. Textpad, Access 2-   J2EE Web Application overview Any web application that runs in the servlet container is called a J2EE web application. The servlet container implements the Servlet and JSP specification 3-   Servlet overview What is a Servlet ? A servlet is any class that can be invoked and executed on the server. Unlike applets, which do their work on the client , servlet do their work on the server What is The Servlet Life Cycle ? A server loads and initializes the servlet [by invoking init() ] The servlet handles zero or more client requests [using service() or doXxx()] The server removes the servlet [by invoking destroy()] Web Application using Servlets  Back in the days when JSPs didn't exist, servlets were all that you had to build J2EE web applications. They handled requests from the browser, invoked middle tier business logic and rendered responses in HTML to the browser. Now that's a prob