Skip to content

Instantly share code, notes, and snippets.

View carlosspohr's full-sized avatar

Carlos Spohr carlosspohr

View GitHub Profile
@carlosspohr
carlosspohr / ResourceBundleJavascriptExport.java
Created October 17, 2011 18:29
ResourceBundleJavascriptExport
package com.wp.carlos4web.cpropriedades.vraptor.i18n;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.security.CodeSource;
import java.security.ProtectionDomain;
import java.util.ArrayList;
@carlosspohr
carlosspohr / web.xml
Created October 26, 2011 11:59
exemplo do web.xml para VRaptor com JPA direto.
<?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_ID" version="2.5"
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">
<display-name>controle-propriedade</display-name>
<context-param>
<description>VRaptor handles HTTP requests in UTF-8 format</description>
<param-name>br.com.caelum.vraptor.encoding</param-name>
<param-value>UTF-8</param-value>
@carlosspohr
carlosspohr / gist:1724602
Created February 2, 2012 17:07
Inject like modo jegue
package testes.rmi.vraptor;
import org.apache.log4j.Logger;
import persistency.annotation.RMI;
import persistency.manager.ObjectManager;
import br.com.caelum.vraptor.InterceptionException;
import br.com.caelum.vraptor.Intercepts;
import br.com.caelum.vraptor.core.InterceptorStack;
import br.com.caelum.vraptor.http.MutableRequest;
@carlosspohr
carlosspohr / gist:1724894
Created February 2, 2012 18:04
Passando a instância dos facades lá no parameters provider do VRaptor
package br.com.swa.portais.commons;
import java.util.List;
import java.util.ResourceBundle;
import org.apache.log4j.Logger;
import swa.persistency.annotation.RMI;
import swa.persistency.manager.ObjectManager;
import br.com.caelum.vraptor.http.ParametersProvider;
@carlosspohr
carlosspohr / pom.xml
Created June 1, 2012 23:24
pom.xml direto para o webContent/web-inf/lib
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.wp.carlos4web.imasters.geo</groupId>
<artifactId>vraptorgeo</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>war</packaging>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
@carlosspohr
carlosspohr / ReportServiceController.java
Created June 9, 2012 02:40
Web service Java com VRaptor para gerar o stream dos jaspers para o Jacad3
package com.wp.carlos4web.services.controllers;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.net.URLConnection;
import java.util.Properties;
import br.com.caelum.vraptor.Get;
@carlosspohr
carlosspohr / pom.xml
Created July 16, 2012 12:58
pom.xml para o JasperReports 3.7.6
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.wp.carlos4web.teste-jasper</groupId>
<artifactId>teste-jasper</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
@carlosspohr
carlosspohr / pom.xml
Created July 16, 2012 13:23
Maven config para o Jacad 3
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.wp.carlos4web.teste-jasper</groupId>
<artifactId>teste-jasper</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
package br.inf.bcamp.generics.utils;
import java.lang.reflect.Field;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Collection;
import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;
@carlosspohr
carlosspohr / AliasToBeanResultTransformer.java
Created August 29, 2012 13:13
Exemplo do AliasToBeanResultTransformer usando no Hibernate 3.6.9
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
* distributed under license by Red Hat Middleware LLC.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU