Skip to content

Instantly share code, notes, and snippets.

@marcric
marcric / web.xml
Last active December 18, 2015 05:58
Exemplo de web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
id="WebApp_ID" version="2.5">
<display-name>Aplicação Web Simples</display-name>
<welcome-file-list>
<welcome-file>Cliente.jsp</welcome-file>
</welcome-file-list>
@marcric
marcric / ExibirClienteServlet.java
Last active December 18, 2015 05:49
Exemplo de Java Servlet.
package iniciantes;
import java.io.IOException;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@marcric
marcric / Cliente.java
Last active December 18, 2015 05:49
Exemplo de Java Bean
package iniciantes;
import java.io.Serializable;
public class Cliente implements Serializable{
private static final long serialVersionUID = 2L;
private String name;
private String address;
@marcric
marcric / BemVindo.jsp
Last active December 18, 2015 05:49
Exemplo de JSP
<%@page import="iniciantes.Cliente"%>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Detalhes do Cliente</title>
</head>
<body>
@marcric
marcric / Cliente.jsp
Last active September 13, 2016 02:37
Exemplo de JSP.
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Detalhes do Cliente</title>
</head>
<body>
HTTP/1.1 200 OK<crlf>
Date: Mon, 19 Jan 1998 03:52:49 GMT<crlf>
Server: Apache/1.2.4<crlf>
Last-Modified: Wed, 08 Oct 1997 04:15:24 GMT<crlf>
ETag: "2ce0b-89f-343b08dc"<crlf>
Content-Length: 2207<crlf>
Accept-Ranges: bytes<crlf>
Keep-Alive: timeout=15, max=100<crlf>
Connection: Keep-Alive<crlf>
Content-Type: text/html<crlf>
GET /documentation/apache/ HTTP/1.0<crlf>
Connection: Keep-Alive<crlf>
User-Agent: Mozilla/4.01 [en] (Win95; I)<crlf>
Host: hal.etc.com.au<crlf>
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*<crlf>
Accept-Language: en<crlf>
Accept-Charset: iso-8859-1,*,utf-8<crlf>
<crlf>
@marcric
marcric / carolina.rb
Created May 8, 2012 13:44
Helping Google stoping Carolina search
if query == "Carolina Dieckmann"
puts "This person doesn't even exists!"
end
<img src ="../images/coconut_beach.jpg" width="225" height="151" border="0"
alt="Coconut Palms, Awesome Beach, and I" usemap ="#tiffanymap" />
<map id="tiffanymap" name="tiffanymap">
<area title="Myself" shape="rect" coords="90,80,120,151" href="javascript:alert('Me');" alt="Me">
<area title="The Place" shape="poly" coords="55,55,120,80,90,80,90,100,70,100,20,80,55,55"
href="http://en.wikipedia.org/wiki/Natal,_Rio_Grande_do_Norte" target="_blank" alt="Natal Beach">
<area title="Around me" shape="poly" coords="145,80,145,100,215,90,215,80,180,60,145,80"
<div align=center>
<map name="map1">
<area
href="contacts.html" alt="Contacts" title="Contacts"
shape=rect coords="6,116,97,184">
<area
href="products.html" alt="Products" title="Products"
shape=circle coords="251,143,47">