Location Labs

  • Company
  • Products
  • Blog
  • Facebook
  • Twitter
  • YouTube
[icon] Universal Location Service

Universal Location Service

  • Overview
  • My Apps
  • Tutorials
  • Test Tools
  • SDK
  • Developer Guide
  • Billing
  • Support
  • Register
  • Sign In

Inheriting from AbstractVeriplaceServlet

Using the Web Tier Java SDK

  • About the Web Tier Java SDK
  • Using Java Server Pages
  • Inheriting from AbstractVeriplaceServlet
  • Using Spring MVC
  • < back to all tutorials

Inheriting from AbstractVeriplaceServlet (back to all tutorials)

Java Server Pages (JSP) are simple and concise, but are often inappropriate for large applications with multiple layers of abstraction. For such cases, it is natural to use Java Servlets to process location data obtained from Veriplace before rendering a page.

  1. Step 1: Writing PageServlet.java

    The simplest way to write a Servlet to process location data is to inherit from the com.veriplace.web.servlet.AbstractVeriplaceServlet:

    The UsesVeriplace annotation informs the AbstractVeriplaceServlet that location must be obtained, using the Zoom location mode, before passing control to doRequestInternal method.

    The VeriplaceState parameter to doRequestInternal provides access to data obtained from Veriplace, including location.

  2. Step 2: Writing page.jsp

    PageServlet.java still renders HTML using a JSP file, which should look very similar to the JSP example above, except for the removal of the setup and require-* tags:

  3. Step 3: Configuring web.xml

    The AbstractVeriplaceServlet requires a few customizations of your application's web.xml:

    This should look very similar to the JSP example above, except that the Page servlet is declared using the servlet-class declaration

  4. Step 4: Done

    You're now ready to deploy a servlet-based web application using the Veriplace API.

  • next: Using Spring MVC >

Developers

  • Developer Terms of Service
  • Privacy Policy
  • Content Requirements
  • Trademark Schedule
  • Forum

End Users

  • Terms of Service
  • Privacy Policy
  • Support

Follow Us

  • [icon] Facebook
    Facebook
  • [icon] Twitter
    Twitter
  • [icon] YouTube
    YouTube

Location Labs

info@locationlabs.com

© 2010 Location Labs

All rights reserved.