Skip to content

Instantly share code, notes, and snippets.

View steppat's full-sized avatar

Nico Steppat steppat

View GitHub Profile
@steppat
steppat / gist:1286144
Created October 14, 2011 03:01
filro para imprimir as IDs do component tree (Mojarra)
package br.com.caelum.filter;
import java.io.IOException;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Set;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
@steppat
steppat / gist:1286181
Created October 14, 2011 03:30
Simples bean para um formulario JSF
package br.com.caelum.bean;
import javax.faces.component.UIForm;
/*
No faces-config.xml
<managed-bean>
<managed-bean-name>formularioBean</managed-bean-name>
@steppat
steppat / gist:1291637
Created October 17, 2011 00:20
HAProxy config (sticky)
global
daemon
maxconn 256
defaults
mode http
timeout connect 5000ms
timeout client 50000ms
timeout server 50000ms
@steppat
steppat / build.xml
Created December 5, 2011 16:14
FJ-31 ANT Build file
<?xml version="1.0"?>
<!-- ======================================================================= -->
<!-- FJ-31 build file -->
<!-- ======================================================================= -->
<project name="FJ-31" default="ear" basedir=".">
<property name="src.dir" value="${basedir}/src"/>
<property name="jboss.home" value="/home/SEU_USUARIO/jboss-6.0.0.Final" />
@steppat
steppat / echoant
Created December 20, 2011 01:12
exemplo echo no build.xml
<?xml version="1.0" encoding="UTF-8"?>
<project name="compilar" default="empacotar" basedir=".">
<property name="build.dir" value="alguma pasta dentro do projeto" />
<target name="init">
<echo message="Initilzando a construção do projeto" />
<echo message="${build.dir}"/>
</target>
@steppat
steppat / simple build
Created December 20, 2011 02:09
simple build file
<?xml version="1.0" encoding="UTF-8"?>
<project name="argentum" default="executar">
<property file="build.properties" />
<path id="libs.classpath">
<fileset dir="lib">
<include name="*.jar" />
</fileset>
</path>
<?xml version="1.0"?>
<!-- ======================================================================= -->
<!-- FJ-31 build file for jboss 7 -->
<!-- ======================================================================= -->
<project name="FJ-31" default="ear" basedir=".">
<property name="src.dir" value="${basedir}/src"/>
<property name="jboss.home" value="/home/SEU-USUARIO/jboss-as-7.1.1.Final" />
@steppat
steppat / FJ-31 JAAS
Last active December 11, 2015 17:28
No JBoss AS 7 standalone-jms.xml (dentro da tag security-domains)
<security-domain name="fj31domain" cache-type="default">
<authentication>
<login-module code="Database" flag="required">
<module-option name="dsJndiName" value="java:/livrariaDS"/>
<module-option name="principalsQuery" value="select password from users where user like ?"/>
<module-option name="rolesQuery" value="select role, 'Roles' from roles where user like ?"/>
</login-module>
</authentication>
</security-domain>
<beans 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/beans_1_0.xsd">
</beans>
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:security="http://www.springframework.org/schema/security"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.2.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.2.xsd