Skip to content

Instantly share code, notes, and snippets.

package com.google.sitebricks.binding;
import com.google.inject.Inject;
import com.google.inject.Provider;
import com.google.inject.servlet.SessionScoped;
import net.jcip.annotations.ThreadSafe;
import javax.servlet.http.HttpSession;
import java.io.Serializable;
import static org.appfuse.gwt.service.client.rest.RestConstants.*;
import com.google.gwt.core.client.GWT;
import com.google.gwt.http.client.Header;
import com.google.gwt.http.client.Request;
import com.google.gwt.http.client.RequestBuilder;
import com.google.gwt.http.client.RequestCallback;
import com.google.gwt.http.client.RequestException;
import com.google.gwt.http.client.Response;
/**
package testlib;
import java.io.IOException;
import java.util.concurrent.Future;
import java.util.logging.Logger;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
package testlib;
import java.io.IOException;
import java.util.ArrayList;
import java.util.concurrent.Future;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
@esfand
esfand / User.java
Created October 19, 2010 20:48 — forked from anonymous/User.java
import java.util.Date;
import javax.jdo.PersistenceManager;
import javax.jdo.annotations.Column;
import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;
import com.google.gwt.requestfactory.shared.Version;
@esfand
esfand / Readme.md
Created June 29, 2011 08:11 — forked from biilmann/Readme.md
Form extension for Webpop

Forms with the Contact extension

This contact extension for Webpop is based on writing HTML5 forms with all the validations the HTML5 spec introduces, and having Webpop carry out the validations server-side in case the browser doesn't support them (or has been sidestepped completely).

To use it, simply copy "contact.js" into the Extensions folder of your project.

Writing forms with the <pop:contact> extension is very straight forward, and while the extension can easily be used to output forms with a predefined markup, every part of the final html can be handcrafted.

Here's a simple contact form:

@Controller
@RequestMapping(value = "/book")
public class BookController {
private final Map<Integer, Book> books = new ConcurrentSkipListMap<Integer, Book>();
@RequestMapping(value = "/{id}", method = GET)
public @ResponseBody Book read(@PathVariable("id") int id) {
return books.get(id);
}
@esfand
esfand / tutorial.rst
Created February 9, 2012 18:49 — forked from mojavelinux/tutorial.asciidoc
JBoss Java EE workshop

JBoss Java EE workshop

This tutorial steps through creating, testing and deploying an application using the JBoss Java EE tools and runtimes. You can show up with nothing but Java and a passion to learn. By the end, you'll have a full application running in the cloud.

Here's the development stack we'll be using:

  • OpenShift Express
  • git
  • JBoss Forge
@esfand
esfand / gist:2260989
Created March 31, 2012 08:52 — forked from joliver/gist:1311195
NServiceBusCommitDispatcher
public sealed class NServiceBusCommitDispatcher : IPublishMessages
{
private const string AggregateIdKey = "AggregateId";
private const string CommitVersionKey = "CommitVersion";
private const string EventVersionKey = "EventVersion";
private const string BusPrefixKey = "Bus.";
private readonly IBus bus;
public NServiceBusCommitDispatcher(IBus bus)
{
@esfand
esfand / FailedApproach.java
Created April 9, 2012 03:55 — forked from rklemme/FailedApproach.java
Sample code for dealing with self conscious parametrized types
// Source: http://www.velocityreviews.com/forums/t745036-mixing-self-conscious-parametrized-types-with-inheritance.html
package generics2;
import java.util.SortedSet;
import java.util.TreeSet;
/**
* Base comparable class with "type self consciousness".
*/
class BaseC implements Comparable<BaseC> {