This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Gerenciando o certificado com o Java keytool: | |
Para gerar um certificado válido por 180 dias, usando algoritmo RSA:: | |
keytool -genkey -keyalg RSA -alias livraria -keystore caelum_keystore.jks -storepass caelum -validity 180 | |
Obs: Para usar com Tomcat usa a mesma senha para o keystore e para o certificado! | |
Para listar todo o conteudo do keystore: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script src="resources/js/jquery.js"></script> | |
<script> | |
$("input[type=submit]").on("click", function(event) { | |
event.preventDefault(); | |
$.ajax({ | |
url : "adiciona", | |
data : $("form").serialize(), | |
success : function(retorno, codigo, xhr) { | |
$(retorno).appendTo("table"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- no arquivo standalone-jms.xml --> | |
<security-domain name="lojaDomain" 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=?"/> | |
<module-option name="rolesQuery" value="select role, 'Roles' from roles where user like ?"/> | |
</login-module> | |
</authentication> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- copia para pasta WEB-INF.xml --> | |
<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> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package br.com.caelum.produtos.aceitacao; | |
import org.junit.Assert; | |
import org.junit.Test; | |
import org.openqa.selenium.By; | |
import org.openqa.selenium.WebDriver; | |
import org.openqa.selenium.WebElement; | |
import org.openqa.selenium.firefox.FirefoxDriver; | |
public class PaginaIndexIT { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<build> | |
<finalName>produtos-web</finalName> | |
<plugins> | |
<plugin> | |
<groupId>org.mortbay.jetty</groupId> | |
<artifactId>jetty-maven-plugin</artifactId> | |
<version>8.1.9.v20130131</version> | |
</plugin> | |
</plugins> | |
</build> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<plugin> | |
<groupId>org.mortbay.jetty</groupId> | |
<artifactId>jetty-maven-plugin</artifactId> | |
<version>8.1.9.v20130131</version> | |
<configuration> | |
<connectors> | |
<connector implementation="org.eclipse.jetty.server.nio.SelectChannelConnector"> | |
<port>9090</port> | |
<maxIdleTime>60000</maxIdleTime> | |
</connector> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<build> | |
<plugins> | |
<!-- definicao do plugin Jacoco --> | |
<plugin> | |
<groupId>org.jacoco</groupId> | |
<artifactId>jacoco-maven-plugin</artifactId> | |
<version>0.6.2.201302030002</version> | |
<executions> | |
<execution> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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> |