Posts

Showing posts from January, 2014

KO Js Using in jsp with two objects

KO JS using for iterate a JSON object in JSP When Jsp file loads in that time the two JSO objects reads and convert as a ko object $(document) .ready( function() { var payOptJson = "${paymentOpt}"; var payOptJsonreplace = payOptJson.replace(/'/g, '"'); var payOptJsonKo = ko.observableArray(JSON .parse(payOptJsonreplace)); var paybanksJson = '${paybanks}'; var paybanksJsonreplace = paybanksJson.replace(/'/g, '"'); var paybanksJsonKo = ko.observableArray(JSON .parse(paybanksJsonreplace)); var policydetailsArray; function AppViewModel() { var self = this; self.payOpt = payOptJsonKo; self.paybanks = paybanksJsonKo; } ko.applyBindings(new AppViewModel()); }); iterate the Ko objects in JSP Using KO js <div class="col-md-10 col-sm-10" data-bind="foreach:payOpt"> ...

Simple Captch Using javascript

Captch generated class.This class Generated captche 0-9 numbers import java.awt.Color; import java.awt.Font; import java.awt.FontMetrics; import java.awt.Graphics2D; import java.awt.geom.AffineTransform; import java.awt.image.BufferedImage; /**  * The Class CaptchaImage.java.  *  * @author Raja Maragani  * @created on 25-Dec-2013 12:33:53 PM  */ public class CaptchaImage { public CaptchaImage() { // TODO Auto-generated constructor stub } /** * This Class written for the generate the CaptchaImage * */ String captchaString = ""; // Function to generate random captcha image and returns the BufferedImage public BufferedImage getCaptchaImage() { try { Color backgroundColor = Color.white; // Color borderColor = Color.black; Color textColor = Color.black; Color circleColor = new Color(190, 160, 150); Font textFont = new Font("Arial", Font.BOLD, 16); int charsToPrint = 4; int width = 50; int...