org.glassfish.jersey.examples.shortener.webapp.resource
Class ShortenerResource

java.lang.Object
  extended by org.glassfish.jersey.examples.shortener.webapp.resource.ShortenerResource

@Path(value="/")
public class ShortenerResource
extends Object

Resource responsible of providing a form to create shortened link (see form()) and shortening posted link (see createLink(String)). Client is shown error-404 page if the provided link is not valid (see ErrorTemplate and ShortenLink).

Author:
Michal Gajdos (michal.gajdos at oracle.com)

Constructor Summary
ShortenerResource()
           
 
Method Summary
 ShortenedLink createLink(String link)
           
 org.glassfish.jersey.server.mvc.Viewable form()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ShortenerResource

public ShortenerResource()
Method Detail

form

@GET
@Produces(value="text/html")
public org.glassfish.jersey.server.mvc.Viewable form()

createLink

@POST
@Produces(value="text/html")
@Consumes(value="application/x-www-form-urlencoded")
@ErrorTemplate(name="/error-form")
public ShortenedLink createLink(@FormParam(value="link")
                                                                     String link)


Copyright © 2007-2014, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.