URLEncoder with sample program

Sample program:   package com.javadomain.in; import java.io.UnsupportedEncodingException; import java.net.URLEncoder; public class ComparePrintandSystem { static String intro="I am naveen kumar working @ www.javadomain.in"; public static void main(String[] args) throws UnsupportedEncodingException { System.out.println(URLEncoder.encode(intro,"UTF-8")); } }   Output: I+am+naveen+kumar+working+%40+www.javadomain.in URLEncoder Rules: All the characters (a to z & A to Z) and numbers (0 to 9) remains same. Space is converted to “+” All

181 total views, 1 views today

» Read more

TxtWeb Hello World

Step 1:  Download the eclipse,  http://www.eclipse.org/downloads/ Step 2:  Add the google plugin for txtweb in eclipse Step 3:  New -> other -> Web application project, and paste the below code, package com.agn.meaning; //Package name for the app import java.io.IOException; import javax.servlet.http.*; @SuppressWarnings(“serial”) public class MeaningServlet extends HttpServlet { public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { resp.setContentType(“text/html”); // Remember

164 total views, no views today

» Read more

Installing Google Plugin in Eclipse

Installing Google Plugin in Eclipse: Google plugin can be helpful to work with appengine, android ADT’s and cloud deployments. Appengine is one of the best one to deploy Java J2EE web applications. Appengine gives daily free limits, so you can start using google appengine service to deploy J2EE web application either for learning or small start-ups or initiatives.   Step

144 total views, no views today

» Read more

Retrieving Hashmap value by comparing hashmap key

Program: Hashmap.java package com.javadomain.in; import java.util.HashMap; import java.util.Map.Entry; public class Hashmap { public static void main(String[] args) { String keyword="super"; HashMap<String, String> myMap = new HashMap<String, String>(); myMap.put("super", "java keyword"); myMap.put("array_merge", "php array function"); for (Entry<String, String> pair : myMap.entrySet()) { if(pair.getKey().equalsIgnoreCase(keyword)){ System.out.println(keyword+" is: " + pair.getValue()); } } } }   Output: super is: java keyword Thanks for reading

140 total views, no views today

» Read more

Maven Installations and configurations

Step 1: Go to the link below download the maven file. http://www.apache.org/dyn/closer.cgi/maven/binaries/apache-maven-3.0.4-bin.tar.gz Step 2: Just extract the file and put it in the D drive or where ever you want. Step 3: Now go to the command prompt, and type mvn and you will get as follows, Because we haven’t set the maven path. Step 4: Now set the path as follows and

185 total views, no views today

» Read more

Ant Installations and Configurations

Step 1: Before installing ant ensure that already java has been installed in your system. Step 2: Go to the below link and download the ant. http://ant.apache.org/bindownload.cgi Step 3: Just extract the zip file you downloaded and put in the drive you want. Step 4: Now go to the command prompt and type ant then you will get like as follows, Step 5: Now we

141 total views, 1 views today

» Read more

Java Path Set

Way 1: Setting using System properties Step 1: Right click on computer – > properties – > Advanced system settings – > Advanced – > Environment Variables – > User variables. Step 2: Create New and type as follows, variable: CLASSPATH value : c:\Program Files\Java\jdk1.6.0\jre\lib variable: JAVA_HOME value : C:\Program Files\Java\jdk1.6.0 variable: PATH value : C:\Program Files\Java\jdk1.6.0\bin; Way 2: Setting in the Command prompt Step 1: Just go to

167 total views, no views today

» Read more
1 18 19 20