Created
August 27, 2012 03:00
-
-
Save LeifWarner/3485204 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.scalatra.servlet | |
import javax.servlet.http.HttpSession | |
trait TestImplicits extends ServletApiImplicits { | |
override implicit def enrichSession(session: HttpSession): TestSerializationSession = | |
new TestSerializationSession(session) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.scalatra.servlet | |
import javax.servlet.http.HttpSession | |
import java.io.{OutputStream, ObjectOutputStream} | |
object NullOut extends OutputStream { | |
def write(b: Int) {} | |
} | |
class TestSerializationSession(session: HttpSession) extends RichSession(session) { | |
//val oos = new ObjectOutputStream(System.out) | |
val oos = new ObjectOutputStream(NullOut) | |
override def update(key: String, value: AnyRef) { | |
oos.writeObject(value) | |
super.update(key, value) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Use with