I hereby claim:
- I am eduarddedu on github.
- I am eduarddedu (https://keybase.io/eduarddedu) on keybase.
- I have a public key whose fingerprint is C81A 4A95 52C6 656C BA62 B8E7 BC1F CA09 3EDC 1EF5
To claim this, I am signing this object:
package org.codecritique.thrifty.mapping; | |
import org.codecritique.thrifty.entity.Expense; | |
import com.google.gson.Gson; | |
import javax.ws.rs.Consumes; | |
import javax.ws.rs.core.MediaType; | |
import javax.ws.rs.core.MultivaluedMap; | |
import javax.ws.rs.ext.MessageBodyReader; | |
import javax.ws.rs.ext.Provider; |
@POST | |
@Consumes({ | |
MediaType.APPLICATION_JSON | |
}) | |
public Response createExpense(Expense expense) { | |
try { | |
em.persist(expense); | |
} catch (Exception e) { | |
throw new WebApplicationException(e); | |
} |
package org.codecritique.thrifty.rest; | |
import javax.ejb.Stateless; | |
import javax.ws.rs.*; | |
import javax.ws.rs.core.MediaType; | |
import javax.ws.rs.core.Response; | |
import org.codecritique.thrifty.entity.Expense; | |
@Stateless |
package org.codecritique.thrifty; | |
import javax.ws.rs.ApplicationPath; | |
import javax.ws.rs.core.Application; | |
@ApplicationPath("rest-api") | |
public class RestApplication extends Application { | |
} |
import javax.ws.rs.GET; | |
import javax.ws.rs.Path; | |
import javax.ws.rs.Produces; | |
@Path("hello") | |
public class HelloService { | |
@GET | |
@Produces("text/html") | |
public String getHtml() { | |
return "<html><body><h1>Hello!</h1></body></html>"; |
" Enter command line mode and press the | |
" right arrow key to run this function. | |
" The script will attempt to compile and execute | |
" the program file opened in active buffer. | |
cnoremap<Right> <C-R> call RunProgram()<CR> | |
function! RunProgram() | |
let b:filetype = getbufvar("%", "&filetype") | |
let b:filename = expand("%") |
I hereby claim:
To claim this, I am signing this object: