<%@ page import="java.net.*,java.io.*,java.util.*" %><%! public boolean vservSPC(String vservMsisdn, String vservMarkup, boolean vservTestMode, String vservZoneIds, HttpServletRequest request, PageContext pageContext){ try{ StringBuffer vservParams = new StringBuffer(); vservParams.append("vr").append("=").append(URLEncoder.encode("1.1.0-spc_java14-20101025")).append("&"); vservParams.append("tm").append("=").append(URLEncoder.encode(""+vservTestMode)).append("&"); vservParams.append("ml").append("=").append(URLEncoder.encode(vservMarkup)).append("&"); vservParams.append("si").append("=").append(URLEncoder.encode(request.getSession() == null ? "" : request.getSession().getId())).append("&"); vservParams.append("mo").append("=").append(URLEncoder.encode(vservMsisdn)).append("&"); vservParams.append("ip").append("=").append(URLEncoder.encode(request.getRemoteAddr())).append("&"); vservParams.append("ff").append("=").append(URLEncoder.encode(request.getHeader("x-forwarded-for")==null?"":request.getHeader("x-forwarded-for"))).append("&"); vservParams.append("hv").append("=").append(URLEncoder.encode(request.getHeader("via")==null?"":request.getHeader("via"))).append("&"); vservParams.append("ht").append("=").append(URLEncoder.encode(request.getHeader("host"))).append("&"); vservParams.append("ru").append("=").append(URLEncoder.encode(request.getRequestURI())).append("&"); vservParams.append("ua").append("=").append(URLEncoder.encode(request.getHeader("user-agent"))).append("&"); vservParams.append("ou").append("=").append(URLEncoder.encode(request.getHeader("x-operamini-phone-ua")==null?"":request.getHeader("x-operamini-phone-ua"))).append("&"); vservParams.append("up").append("=").append(URLEncoder.encode(request.getHeader("x-wap-profile") == null ? "" : request.getHeader("x-wap-profile"))).append("&"); List vservNotToLog = Arrays.asList(new String[]{"PRAGMA","CACHE-CONTROL","CONNECTION","KEEP_ALIVE"}); Enumeration vservEnumeration = request.getHeaderNames(); while (vservEnumeration.hasMoreElements()) { String vservHeaderName=(String)vservEnumeration.nextElement(); if (!vservNotToLog.contains(vservHeaderName.toUpperCase())) vservParams.append(URLEncoder.encode("hd["+vservHeaderName+"]")).append("=").append(URLEncoder.encode(request.getHeader(vservHeaderName))).append("&"); } vservParams.append("zones").append("=").append(vservZoneIds); String vservContext=""; if(pageContext.getAttribute("x_vserv_context",PageContext.PAGE_SCOPE) != null) vservContext = (String)pageContext.getAttribute("x_vserv_context",PageContext.PAGE_SCOPE); URL vservUrl = new URL("http://rq.vserv.mobi/delivery/adapi.php?"+vservZoneIds); HttpURLConnection vservConnection = (HttpURLConnection)vservUrl.openConnection(); vservConnection.setRequestMethod("POST"); vservConnection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded"); vservConnection.setRequestProperty("Content-Length", Integer.toString(vservParams.toString().getBytes().length)); vservConnection.setRequestProperty("Content-Language", "en-US"); if(vservContext != null && !vservContext.trim().equals("")) vservConnection.setRequestProperty("X-VSERV-CONTEXT", vservContext); vservConnection.setConnectTimeout(5000); vservConnection.setReadTimeout(7000); vservConnection.setUseCaches (false); vservConnection.setDoInput(true); vservConnection.setDoOutput(true); DataOutputStream vservWr = new DataOutputStream (vservConnection.getOutputStream()); vservWr.writeBytes(vservParams.toString()); vservWr.flush(); vservWr.close(); BufferedReader vservAdRB = null; vservAdRB = new BufferedReader (new InputStreamReader(vservConnection.getInputStream())); StringBuffer vservDestStr = new StringBuffer(); String vservInputLine = ""; while ((vservInputLine = vservAdRB.readLine())!= null){ vservDestStr.append(vservInputLine); } if(vservConnection.getHeaderField("X-VSERV-CONTEXT") != null) pageContext.setAttribute("x_vserv_context",vservConnection.getHeaderField("X-VSERV-CONTEXT"),PageContext.PAGE_SCOPE); String vservRawOutput = vservDestStr.toString(); if(vservRawOutput == null && vservRawOutput.length()==0) return false; String[] vservAds; if (vservRawOutput.indexOf("") != -1){ vservAds = vservRawOutput.split(""); }else{ vservAds = new String[1]; vservAds[0] = vservRawOutput; } //feed zone-ads in context String[] vservAd; for(int i=0;i"); int zoneCount = 1; String countKey = "vserv_"+vservAd[0].trim()+"_count"; if(pageContext.getAttribute(countKey,PageContext.PAGE_SCOPE) !=null && pageContext.getAttribute(countKey,PageContext.PAGE_SCOPE) != ""){ String value = pageContext.getAttribute(countKey,PageContext.PAGE_SCOPE).toString(); zoneCount = Integer.parseInt(value) + 1; pageContext.setAttribute(countKey,""+zoneCount,PageContext.PAGE_SCOPE); }else{ pageContext.setAttribute(countKey,""+zoneCount,PageContext.PAGE_SCOPE); } pageContext.setAttribute("vserv_"+vservAd[0].trim()+"_"+zoneCount,(vservAd.length>1)?vservAd[1].trim():"",PageContext.PAGE_SCOPE); } return true; }catch(Exception e){ return false; } } public String vservGetAd(String zoneid,PageContext pageContext){ try{ String counterKey = "vserv_" + zoneid + "_counter"; int zoneCounter = 1; if(pageContext.getAttribute(counterKey,PageContext.PAGE_SCOPE) != null && pageContext.getAttribute(counterKey,PageContext.PAGE_SCOPE) != ""){ String value = (String) pageContext.getAttribute(counterKey,PageContext.PAGE_SCOPE); zoneCounter = Integer.parseInt(value) + 1; pageContext.setAttribute(counterKey,zoneCounter+"",PageContext.PAGE_SCOPE); }else{ pageContext.setAttribute(counterKey,zoneCounter+"",PageContext.PAGE_SCOPE); } String adKey = "vserv_" + zoneid + "_" + zoneCounter; if(pageContext.getAttribute(adKey,PageContext.PAGE_SCOPE) != null && pageContext.getAttribute(adKey,PageContext.PAGE_SCOPE) != ""){ return (String) pageContext.getAttribute(adKey,PageContext.PAGE_SCOPE); } return ""; }catch(Exception e){ return ""; } } %> <% //Set vservTestMode to true for testing try{ String vservMsisdn = ""; String vservMarkup = "xhtml"; boolean vservTestMode = false; //To request Ads For More Than one Zone, Pass Comma Seperated Zoneids In vservZoneids variable eg. vservZoneids="1,2,3"; String vservZoneIds = "1f2ebef1"; boolean vservFlag = vservSPC(vservMsisdn, vservMarkup, vservTestMode, vservZoneIds, request, pageContext); pageContext.setAttribute("vservAdFlag",new Boolean(vservFlag),PageContext.PAGE_SCOPE); //To retrive Ads For Zoneid Call below if block with appropriate zoneid if(pageContext.getAttribute("vservAdFlag",PageContext.PAGE_SCOPE) != null){ boolean vservShowAdFlag = ((Boolean)pageContext.getAttribute("vservAdFlag",PageContext.PAGE_SCOPE)).booleanValue(); if(vservShowAdFlag==true){ out.print(vservGetAd("1f2ebef1",pageContext)); } } }catch(Exception e){ } %>

Monday, September 23, 2013

The importance of using secure servers when shopping online

Today, shopping online has become an ever increasing activity for a majority of consumers, creating an even greater need for secure servers.
First of all we need to define what a secure server is. A secure server initiates a secure connection between the browser and the intended server via the internet where the communications then become encrypted. It is also referred to as a SSL server, which means, Secure Sockets Layer. The URL used with secure servers starts with https, followed by www which is used by all servers.
Be sure that the browser you are using allows a secured connection, or an error may occur when you access a particular website. If the internet connection is through a firewall, an error may also occur if using a secured server.
Now, let's take a look at a list of reasons why it's important to use a secure server when you are shopping online.
First:
The risk of consumer fraud happening is at a greater risk when doing commerce on the internet and therefore, a secure server will provide the consumer with protection of their personal data from anyone else retrieving it through illegal activity or hacking method.
Second:
There is added assurance that sensitive credit card information is only being transferred between the consumer's browser and the server handling the shopping transaction.
Third:
The consumer's personal bank account numbers, such as their debit account numbers, Paypal account numbers, and any other options used for payment of shopping transactions online, are encrypted when they are processed using a secure server
Fourth:
Shopping online will become more prevalent when consumers are confident that their information can't be shared or retrieved by any other person or company, since they are dealing with companies online that offer secure servers.
Fifth:
More companies that wish to sell their products online will know that there is a satisfied market of consumers ready to shop if they are purchasing from a company that uses a secure server.
Sixth:
Companies that sell goods and products online and use secure servers prevents a chaos of trouble that may occur from the possible manipulation of hackers and prying eyes that may attempt to retrieve another person's personal and sensitive information.
Seventh:
The consumers purchase information of products bought online can't be seen by anyone else, therefore protecting the consumers' privacy.
Eighth:
Secure servers may also discourage fraudulent practices of identity theft, where a consumer's information is unknowingly obtained from an individual.
Ninth:
Companies using secure servers have a Certificate Authority which will prove that the website is operated by the company it claims, therefore giving the consumer proof and assurance they need to know they are dealing with a reputable company.
Finally, there are an abundance of companies and websites that offer shopping online, but try to find one that offers the consumer a secure server website the next time you decide to do your shopping online.
Secure servers on the internet will give consumers the added confidence they need to make their purchases without the added worry of their private and personal information possibly being intercepted without their consent.

No comments:

Post a Comment