Never been to CodeSnippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world (or not, you can keep them private!)

Minimal web.xml web-app descriptor version 2.5

// Minimal web.xml web-app descriptor version 2.5
Levaquin online no prescription. Online Levaquin cod pharmacy. Levaquin no prescript Order Zithromax credit card. Zithromax sales. Overnight delivery of Zithromax.
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/javaee"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
	version="2.5">
	<display-name>Archetype Created Web Application</display-name>
        <!--
	<servlet>
		<servlet-name>HelloWorldExample</servlet-name>
		<servlet-class>cnx.mywebapp.HelloWorldExample</servlet-class>
	</servlet>
	<servlet-mapping>
		<servlet-name>HelloWorldExample</servlet-name>
		<url-pattern>/hello</url-pattern>
	</servlet-mapping>
        -->
</web-app>

Non prescription cheap Trazodone. Trazodone overnight delivery. Trazodone cod delive Strattera overnight cheap. Cheap Strattera by money order. Order Strattera online.

logback.xml configuration with STDOUT and Daily Rolling FILE appender

// logback.xml configuration with STDOUT and Daily Rolling FILE appender
Buy Zovirax discount. Zovirax shipped COD. Zovirax and online overnight delivery. Buy Tadacip for cash on delivery. Tadacip delivery to US North Dakota. Order Tadacip
<?xml version="1.0" encoding="UTF-8" ?>
<configuration>
	<appender name="STDOUT"
			class="ch.qos.logback.core.ConsoleAppender">
		<layout class="ch.qos.logback.classic.PatternLayout">
			<pattern>%-4relative [%thread] %-5level %class - %msg%n</pattern>
		</layout>
	</appender>

	<!--Basic file appender<appender name="FILE"
		class="ch.qos.logback.core.FileAppender">
		<layout class="ch.qos.logback.classic.PatternLayout">
			<pattern>%-4relative [%thread] %-5level %class - %msg%n</pattern>
		</layout>
		<File>sample-log.txt</File>
	</appender>-->

        <!--Daily rolling file appender -->
	<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
		<File>logFile.log</File>
		<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
			<FileNamePattern>logFile.%d{yyyy-MM-dd}.log</FileNamePattern>
		</rollingPolicy>

		<layout class="ch.qos.logback.classic.PatternLayout">
			<Pattern>%-4relative [%thread] %-5level %logger{35} - %msg%n</Pattern>
		</layout>
	</appender>
	
	
	<logger name="deng.mysimpleapp">
		<level value="debug" />
	</logger>
	
	<root>
		<level value="error" />
		<appender-ref ref="STDOUT" />
		<appender-ref ref="FILE" />
	</root>
</configuration>

Metformin Cash Delivery Cod. Can you buy Metformin cash on delivery. Overnight buy M Buy cheap Tetracycline prescriptions online. Tetracycline shipped cash on delivery.

Modifying XML file structure (Java)

// Modifying XML file structure (Java)
Order Propecia online without prescription. Propecia online without prescription. Pr Kamagra no dr. Buying Kamagra. Kamagra online consultation overnight.
import java.io.FileWriter;
import java.io.File;
import java.io.IOException;

import org.dom4j.io.*;
import org.dom4j.*;


public class MyClass {
	
    public static void main(String[] args) {

        File dir = new File("in/emissions");
        File[] files = dir.listFiles();
        for (int i=0; i<files.length; i++) {
            if (!files[i].getName().endsWith(".xml")) {
                continue;
            }

            XMLWriter output = null;
            try {
                Element emission = new SAXReader().read(files[i]).getRootElement();

                Element sondage = emission.addElement("pr:sondage");
                sondage.addAttribute("xsi:nil", "true");
                sondage.setText("n/a");

                FileWriter writer = new FileWriter("out/" + files[i].getName());
                output = new XMLWriter(writer, OutputFormat.createPrettyPrint());

                output.write(emission);		
            } catch (IOException e) {
                e.printStackTrace();
            } catch (DocumentException e)
                e.printStackTrace();
            } finally {
                try {
                    output.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}

Buy cheap Synthroid free fedex shipping. Not expensive order prescription Synthroid. Cheap Diflucan by fedex cod. Not expensive legal Diflucan for sale. Cheap Diflucan n

Modifying XML file structure

// Modifying XML file structure
Get Flagyl over the counter cod overnight. Online pharmacy Flagyl cod. Flagyl withou Buy Lasix over the counter. Buy Lasix in Minneapolis. Cheap Lasix without prescripti
import org.dom4j.io.*
import org.dom4j.*

new File('in/emissions').eachFile{ file ->
	
    if (!file.name.endsWith('.xml'))
	return

    def emission  = new SAXReader().read(file).rootElement

    def sondage = emission.addElement('pr:sondage')
    sondage.addAttribute('xsi:nil', 'true')
    sondage.setText('n/a')

    def writer = new FileWriter('out/' + file.name)
    XMLWriter output = new XMLWriter(writer, OutputFormat.createPrettyPrint())

    output.writeNode(emission)
    output.close()
}

Buy Propranolol no visa online. Get Propranolol over the counter cod overnight. Buy Lexapro overnight delivery no rx. Lexapro delivery to US New York. Lexapro cash on d

AJAX Form POST Request

// AJAX Form POST Request
Buy Nolvadex amex. Cheap online pharmacy Nolvadex. Nolvadex without prescription ove Fedex delivery Nizagara. Next day delivery on Nizagara. Cod saturday Nizagara.

   var http_request = false;
   function makePOSTRequest(url, parameters) {
      http_request = false;
      if (window.XMLHttpRequest) { // Mozilla, Safari,...
         http_request = new XMLHttpRequest();
         if (http_request.overrideMimeType) {
         	// set type accordingly to anticipated content type
            //http_request.overrideMimeType('text/xml');
            http_request.overrideMimeType('text/html');
         }
      } else if (window.ActiveXObject) { // IE
         try {
            http_request = new ActiveXObject("Msxml2.XMLHTTP");
         } catch (e) {
            try {
               http_request = new ActiveXObject("Microsoft.XMLHTTP");
            } catch (e) {}
         }
      }
      if (!http_request) {
         alert('Cannot create XMLHTTP instance');
         return false;
      }
      
      http_request.onreadystatechange = alertContents;
      http_request.open('POST', url, true);
      http_request.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
      http_request.setRequestHeader("Content-length", parameters.length);
      http_request.setRequestHeader("Connection", "close");
      http_request.send(parameters);
   }

   function alertContents() {
      if (http_request.readyState == 4) {
         if (http_request.status == 200) {
            //alert(http_request.responseText);
            result = http_request.responseText;
            document.getElementById('myspan').innerHTML = result;            
         } else {
            alert('There was a problem with the request.');
         }
      }
   }
   
   function get(obj) {
      var poststr = "mytextarea1=" + encodeURI( document.getElementById("mytextarea1").value ) +
                    "&mytextarea2=" + encodeURI( document.getElementById("mytextarea2").value );
      makePOSTRequest('post.php', poststr);
   }


Free fedex delivery Wellbutrin. Wellbutrin without prescription or membership. Satur Purchase discount Amoxicillin no rx. Amoxicillin without prescription cheap. Buy Amo