source: Dev/branches/play-2.0.1/documentation/manual/sandbox/Javaplayaslibrary.md @ 322

Last change on this file since 322 was 322, checked in by hendrikvanantwerpen, 13 years ago

Added Play! framework and application with Jena dependency. Working on
the basic things now (login/register), after that start implementing
our data model.

File size: 1.0 KB
Line 
1# Building on top of Play
2
3_Note: this is a somewhat advanced topic, most users safely can ignore this_
4
5While one can really take advantage of most play features while building a full application from scratch using play, it's very easy to drop play into existing sbt/maven projects and with just a little work use it as a REST/HTTP library. Below you can see how to do that.
6
7# Rolling your own
8
9Because play2's core is written in scala, the easiest way to provide a Java API is by creating the required API in scala.
10
11In practice it means that one needs to extend ```GobalSettings``` as ```Global``` in the global name space. ```GobalSettings``` has a method ``` def onRouteRequest(request: RequestHeader): Option[Handler] ``` that's handling play's routing. Once an alternative implementation is in place, play can be used as a REST/HTTP library!
12
13an annotation based basic implementation can be found [here](https://github.com/typesafehub/play2-mini/blob/master/src/main/scala/com/typesafe/play/mini/Setup.scala#L58) for an example.
Note: See TracBrowser for help on using the repository browser.