Skip to content

Instantly share code, notes, and snippets.

View steppat's full-sized avatar

Nico Steppat steppat

View GitHub Profile
@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
insert into Usuario (login,senha) values ('eu','eu');
insert into Grupo (nome) values ('ROLE_USER');
insert into Usuario_Grupo values (1,1);
<list>
<negocio>
<preco>39.5</preco>
<quantidade>1076</quantidade>
<data>
<time>1221277070740</time>
<timezone>America/Sao_Paulo</timezone>
</data>
</negocio>
<negocio>
body {
font-family: "arial", sans-serif;
padding-top: 20px;
}
h1,h2,h3 {
text-shadow: 2px 1px 5px grey;
}
input, textarea {
@steppat
steppat / TesteEstadosJPA
Created April 19, 2013 16:18
Classe para testar os estados do JPA
package br.com.caelum.financas.teste;
import javax.persistence.EntityManager;
import br.com.caelum.financas.util.JPAUtil;
public class TesteEstadosJPA {
public static void main(String[] args) {
<?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_3_0.xsd"
version="3.0">
<display-name>produtos-web</display-name>
</web-app>
verifica anta mvn -version (java home)
---------------------------------------
Maven 3
<properties>
<maven.compiler.source>1.7</maven.compiler.source>
<maven.compiler.target>1.7</maven.compiler.target>
</properties>
------------------
<build>
<plugins>
<build>
<plugins>
<!-- definicao do plugin Jacoco -->
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.6.2.201302030002</version>
<executions>
<execution>