Java servlet example for read and create cookies in Tomcat

Source Code for Cookie Example import java.io.*; import javax.servlet.*; import javax.servlet.http.*; public class CookieExample extends HttpServlet { public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { response.setContentType(“text/html”); PrintWriter out = response.getWriter(); // print out…

Examples of Ajax requests with jQuery

jQuery simplifies our life a lot, even with Ajax requests, here’s an example of a basic request: $.ajax({ url: ‘myfile.php’, success:function(data){ alert(data); } }); This is the simplest possible Ajax request, if our request is…

Latest updates

Base64 Encoder Decoder online: Improved interface Possibility to upload client-side files MD5, SHA1 and SHA-256 Hash Generator New SHA-512 encoding option Password Generator URL to load your settings on other devices quickly Bug fixes Sitemap…

How to save text files in Java with umlauts

Here at .Maui, working in Java on files written in German, we had difficulty saving files that contained umlauts. Here is the solution we found: package javaexample; import java.io.BufferedWriter; import java.io.FileOutputStream; import java.io.IOException; import java.io.OutputStreamWriter;…

JavaScript loop through json array

If you are not interested in support for old browsers, the best way to browse an array of json is: var dotArrayJSON = [ {“label”: 1}, {“label”: 2}, {“label”: 3}, {“label”: 4} ]; dotArrayJSON.forEach(loopThrough); function…