Skip to content

Commit

Permalink
Merge branch 'master' of github.com:scalatra/scalatra
Browse files Browse the repository at this point in the history
  • Loading branch information
casualjim committed Mar 14, 2011
2 parents 9533c45 + 4fd4248 commit 191f390
Show file tree
Hide file tree
Showing 29 changed files with 938 additions and 167 deletions.
30 changes: 30 additions & 0 deletions CREDITS.md
@@ -0,0 +1,30 @@
# Credits

## Committers

- [Gabriele Renzi](http://www.riffraff.info/)
- [Alan Dipert](http://alan.dipert.org/)
- [Ross A. Baker](http://www.rossabaker.com/)
- [Hiram Chirino](http://hiramchirino.com/)
- [Ivan Porto Carrero](http://flanders.co.nz/)

## Other contributors

- [Luke Amdor](http://rubbish.io/)
- [JR Boyens](http://jrboyens.github.com/)
- [Tuomas Kareinen](http://www.iki.fi/kareinen/)
- [Miso Korkiakoski](http://github.com/mwing)
- [Yusuke Kuoka](http://d.hatena.ne.jp/mumoshu/)
- [Yung-Luen Lan](http://yllan.org/)
- [Paul Lambert](http://paulitex.com/)
- [Ted Nyman](http://github.com/tnm)
- [Erik Rozendaal](http://github.com/erikrozendaal)
- [Ivan Willig](http://github.com/iwillig)
- [Phil Wills](http://github.com/philwills)

## Special thanks

- [The Sinatra Project](http://www.sinatrarb.com/), whose excellent framework,
test suite, and documentation we've shamelessly copied.
- [Mark Harrah](http://github.com/harrah) for his support on the [sbt mailing
list](http://groups.google.com/group/simple-build-tool)
28 changes: 9 additions & 19 deletions README.markdown
Expand Up @@ -43,6 +43,10 @@ Note: if you keep getting frequent OutOfMemory errors from `sbt` you can try cha

Note 2: if you already have a checkout, and after a `git pull` the build fails, try to explicitly run the `update` and `clean` sbt tasks before running `compile`.

### Alternative Maven quickstart.

See the [simple-scalatra-archetype](http://github.com/Srirangan/simple-scalatra-archetype).

## Community

### Mailing list
Expand Down Expand Up @@ -521,6 +525,11 @@ Another difference is that ScalatraFilter matches routes relative to the WAR's c

## Migration Guide

### scalatra-2.0.0.M2 to scalatra-2.0.0.M3

Should be compatible. If it broke, please share your tale of woe on the
mailing list.

### scalatra-2.0.0.M1 to scalatra-2.0.0.M2

1. Session has been retrofitted to a Map interface. `get` now returns an option instead of the value.
Expand All @@ -539,22 +548,3 @@ Scalatra was renamed from Step to Scalatra to avoid a naming conflict with (an u
- [SSGI](http://github.com/scalatra/ssgi): Work in progress. Will provide an abstraction layer allowing a future version of Scalatra to run on web servers other than Servlet containers.

- [Bowler](http://bowlerframework.org): A RESTful, multi-channel ready web framework in Scala with a functional flavour, built on top of Scalatra and [Scalate](http://scalate.fusesource.org/).

## Credits

### Committers

- [Gabriele Renzi](http://www.riffraff.info/), who started it all with his [blog posts](http://www.riffraff.info/tags/step)
- [Alan Dipert](http://alan.dipert.org/)
- [Ross A. Baker](http://www.rossabaker.com/)
- [Hiram Chirino](http://hiramchirino.com)
- [Ivan Porto Carrero](http://flanders.co.nz)

### Other contributors

- [The Sinatra Project](http://www.sinatrarb.com/), whose excellent framework, test suite, and documentation we've shamelessly copied.
- [Mark Harrah](http://github.com/harrah) for his support on the SBT mailing list.
- [Yusuke Kuoka](http://github.com/mumoshu) for adding sessions and header support
- [Miso Korkiakoski](http://github.com/mwing) for various patches.
- [Ivan Willig](http://github.com/iwillig) for his work on [Scalate](http://scalate.fusesource.org/) integration.
- [Phil Wills](http://github.com/philwills) for the path parser cleanup.
14 changes: 14 additions & 0 deletions example/src/main/scala/org/scalatra/CookiesExample.scala
@@ -0,0 +1,14 @@
package org.scalatra

class CookiesExample extends ScalatraServlet with CookieSupport {
get("/cookies-example") {
val previous = cookies.get("counter") match {
case Some(v) => v.toInt
case None => 0
}
cookies.update("counter", (previous+1).toString)
<p>
Hi, you have been on this page {previous} times already
</p>
}
}
3 changes: 2 additions & 1 deletion example/src/main/scala/org/scalatra/TemplateExample.scala
Expand Up @@ -33,7 +33,8 @@ class TemplateExample extends ScalatraServlet with UrlSupport /*with FileUploadS
<a href={url("/flash-map/form")}>flash scope</a>
<a href={url("/login")}>login</a>
<a href={url("/logout")}>logout</a>
<a href={url("/filter-example")}>filter demo</a>
<a href={url("/filter-example")}>filter example</a>
<a href={url("/cookies-example")}>cookies example</a>
<a href={url("/chat")}>chat demo</a>
</body>
</html>
Expand Down
104 changes: 56 additions & 48 deletions example/src/main/webapp/WEB-INF/web.xml
@@ -1,61 +1,65 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
"http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
"http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
<web-app>

<servlet>
<servlet-name>TemplateExample</servlet-name>
<servlet-class>org.scalatra.TemplateExample</servlet-class>
</servlet>
<servlet>
<servlet-name>BasicAuthExample</servlet-name>
<servlet-class>org.scalatra.BasicAuthExample</servlet-class>
</servlet>
<servlet>
<servlet-name>SocketIOExample</servlet-name>
<servlet-class>org.scalatra.SocketIOExample</servlet-class>
<init-param>
<param-name>flashPolicyServerHost</param-name>
<param-value>localhost</param-value>
</init-param>
<init-param>
<param-name>flashPolicyServerPort</param-name>
<param-value>843</param-value>
</init-param>
<init-param>
<param-name>flashPolicyDomain</param-name>
<param-value>localhost</param-value>
</init-param>
<init-param>
<param-name>flashPolicyPorts</param-name>
<param-value>8080</param-value>
</init-param>
</servlet>
<servlet>
<servlet-name>ChatApplication</servlet-name>
<servlet-class>org.scalatra.ChatServlet</servlet-class>
<init-param>
<param-name>flashPolicyServerHost</param-name>
<param-value>localhost</param-value>
</init-param>
<init-param>
<param-name>flashPolicyServerPort</param-name>
<param-value>843</param-value>
</init-param>
<init-param>
<param-name>flashPolicyDomain</param-name>
<param-value>localhost</param-value>
</init-param>
<init-param>
<param-name>flashPolicyPorts</param-name>
<param-value>8080</param-value>
</init-param>
</servlet>
<servlet>
<servlet-name>BasicAuthExample</servlet-name>
<servlet-class>org.scalatra.BasicAuthExample</servlet-class>
</servlet>
<servlet>
<servlet-name>SocketIOExample</servlet-name>
<servlet-class>org.scalatra.SocketIOExample</servlet-class>
<init-param>
<param-name>flashPolicyServerHost</param-name>
<param-value>localhost</param-value>
</init-param>
<init-param>
<param-name>flashPolicyServerPort</param-name>
<param-value>843</param-value>
</init-param>
<init-param>
<param-name>flashPolicyDomain</param-name>
<param-value>localhost</param-value>
</init-param>
<init-param>
<param-name>flashPolicyPorts</param-name>
<param-value>8080</param-value>
</init-param>
</servlet>
<servlet>
<servlet-name>CookiesExample</servlet-name>
<servlet-class>org.scalatra.CookiesExample</servlet-class>
</servlet>
<servlet>
<servlet-name>ChatApplication</servlet-name>
<servlet-class>org.scalatra.ChatServlet</servlet-class>
<init-param>
<param-name>flashPolicyServerHost</param-name>
<param-value>localhost</param-value>
</init-param>
<init-param>
<param-name>flashPolicyServerPort</param-name>
<param-value>843</param-value>
</init-param>
<init-param>
<param-name>flashPolicyDomain</param-name>
<param-value>localhost</param-value>
</init-param>
<init-param>
<param-name>flashPolicyPorts</param-name>
<param-value>8080</param-value>
</init-param>
</servlet>

<servlet-mapping>
<servlet-name>ChatApplication</servlet-name>
<url-pattern>/socket.io/*</url-pattern>
<servlet-name>ChatApplication</servlet-name>
<url-pattern>/socket.io/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>TemplateExample</servlet-name>
Expand All @@ -69,6 +73,10 @@
<servlet-name>SocketIOExample</servlet-name>
<url-pattern>/echoserver/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>CookiesExample</servlet-name>
<url-pattern>/cookies-example/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>default</servlet-name>
<url-pattern>/images/*</url-pattern>
Expand Down
14 changes: 14 additions & 0 deletions notes/2.0.0.M3.markdown
@@ -0,0 +1,14 @@
* [GH-16](http://github.com/scalatra/scalatra/issues/16): Dealing with multiple servlets/filters which have FileUploadSupport.
* [GH-18](http://github.com/scalatra/scalatra/issues/18): ScalatraTests doesn't track the session cookie correctly across more than 2 requests
* Generate CSRF token once per session instead of once per request.
* [GH-19](http://github.com/scalatra/scalatra/issues/19): Render a File when returned by an action
* [GH-20](http://github.com/scalatra/scalatra/issues/20): Add support for the HTTP HEAD method. ScalatraTests support still pending.
* Upgrade to Jetty 7.
* Concurrency support for dynamic route addition and deletion.
* [GH-25](http://github.com/scalatra/scalatra/issues/25): Decode request body with content encoding
* New socketio module. _API subject to change before 2.0.0_
* [GH-26](http://github.com/scalatra/scalatra/issues/26): Support options request
* Support for Rails-style path patterns.
* [GH-29](http://github.com/scalatra/scalatra/issues/29): FlashMap should be serializable
* [GH-34](http://github.com/scalatra/scalatra/issues/34): ScalatraTests.addFilter not compatible with Jetty 8
* [GH-35](http://github.com/scalatra/scalatra/issues/35): Support for POST in ScalatraTests
1 change: 1 addition & 0 deletions notes/about.markdown
@@ -0,0 +1 @@
[Scalatra](http://github.com/scalatra/scalatra) is a tiny, [Sinatra](http://sinatrarb.com/)-like web framework for Scala.
77 changes: 0 additions & 77 deletions project/build/ChecksumPlugin.scala

This file was deleted.

32 changes: 32 additions & 0 deletions project/build/GenerateChecksums.scala
@@ -0,0 +1,32 @@
import sbt._

import java.{util => ju}
import scala.collection.jcl.Conversions._
import org.apache.ivy.plugins.resolver._

trait GenerateChecksums extends BasicManagedProject {
override def ivySbt = {
def setChecksums(resolver: DependencyResolver): Unit = resolver match {
case r: ChainResolver =>
r.getResolvers foreach {
case child: DependencyResolver => setChecksums(child)
}
case r: RepositoryResolver =>
r.setChecksums("sha1,md5")
}

val i = super.ivySbt
i.withIvy { ivy =>
ivy.getSettings.getResolvers.toList foreach {
case r: DependencyResolver => setChecksums(r)
}
}
i
}

private implicit def juCollection2Iterable[A](c: ju.Collection[A]): Iterable[A] = {
val list = new ju.ArrayList[A](c.size)
list.addAll(c)
list
}
}

0 comments on commit 191f390

Please sign in to comment.