This file contains 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
{ | |
state: open | |
settings: { | |
index.analysis.filter.name_ngrams.side: front | |
index.analysis.filter.name_ngrams.type: edgeNGram | |
index.analysis.analyzer.full_name.type: custom | |
index.analysis.filter.name_ngrams.max_gram: 40 | |
index.analysis.analyzer.full_name.tokenizer: standard | |
index.analysis.analyzer.partial_name.filter.3: name_ngrams | |
index.analysis.filter.name_ngrams.min_gram: 2 |
This file contains 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
{ | |
state: open | |
settings: { | |
index.analysis.filter.name_ngrams.side: front | |
index.analysis.filter.name_ngrams.type: edgeNGram | |
index.analysis.analyzer.partial.tokenizer: standard | |
index.store: memory | |
index.number_of_replicas: 1 | |
index.analysis.analyzer.partial.filter.3: name_ngrams | |
index.analysis.analyzer.partial_non_ascii.filter.2: name_ngrams |
This file contains 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.i18n | |
import org.scalatra.{CookieSupport, ScalatraKernel} | |
import java.util.Locale | |
import org.scalatra.i18n.Messages | |
object I18nSupport { | |
def localeKey = "locale" |
This file contains 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
Cookies: | |
http://192.168.2.111:8080/login/test/blub?locale=de -> cookie path is /login/test | |
http://192.168.2.111:8080/login/test -> cookie path is /login | |
http://192.168.2.111:8080/login -> cookie path is / |
This file contains 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
/* File: Build.scala in ~/project */ | |
/*...Build Definition...*/ | |
/* This Task should load a Class on my Project*/ | |
val taskKey = TaskKey[Unit]("task-name", "task-description") | |
val myTask = taskKey <<= (fullClasspath in Runtime, scalaInstance) map { (cp, si) => |
This file contains 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
/*File Runner:scala*/ | |
package com.myCompany | |
object Runner extends App { | |
val myArgument = args(0) | |
/*Do whatever you want :)*/ | |
} |
This file contains 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
get("/status") { | |
val currentUser = SecurityUtils.getSubject(); | |
// Save current User to request, because this request will be suspended and forked in another thread. | |
// See: http://jfarcand.wordpress.com/2011/07/13/quick-tip-using-apache-shiro-with-your-atmospheres-websocketcomet-app/ | |
request.setAttribute("subject", currentUser); | |
import org.atmosphere.cpr.HeaderConfig._ | |
contentType = ContentType.JSON | |
val m: Meteor = Meteor.build(request) | |
m.addListener(new EventsLogger()) | |
// Create or retrieve Broadcaster for current User |
This file contains 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
16:38:32.716 [qtp2112864060-76] WARN o.a.w.protocol.SimpleHttpProtocol - org.apache.shiro.cache.CacheException: net.sf.ehcache.CacheException: java.io.InvalidClassException: scala.collection.mutable.HashSet; local class incompatible: stream classdesc serialVersionUID = 1, local class serialVersionUID = -693344176634852721 Status 500 Message Server Error | |
16:38:50.381 [qtp2112864060-73 Selector0] WARN o.a.websocket.WebSocketProcessor - AsynchronousProcessor.AsynchronousProcessorHook was null | |
16:38:50.775 [qtp2112864060-76] WARN o.a.websocket.WebSocketProcessor - Failed invoking AtmosphereFramework.doCometSupport() | |
org.apache.shiro.cache.CacheException: net.sf.ehcache.CacheException: java.io.InvalidClassException: scala.collection.mutable.HashSet; local class incompatible: stream classdesc serialVersionUID = 1, local class serialVersionUID = -693344176634852721 | |
at org.apache.shiro.cache.ehcache.EhCache.put(EhCache.java:105) ~[shiro-ehcache-1.2.0.jar:1.2.0] | |
at org.apache.shiro.session.mgt.eis.CachingSessionD |
This file contains 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
ivyXML := | |
<dependencies> | |
<exclude org="org.eclipse.jetty.orbit" /> | |
</dependencies> | |
libraryDependencies ++= Seq( | |
"org.scalatra" % "scalatra" % "2.1.0-SNAPSHOT", | |
"org.scalatra" % "scalatra-specs2" % "2.1.0-SNAPSHOT" % "test", | |
"ch.qos.logback" % "logback-classic" % "1.0.0" % "runtime", | |
"org.eclipse.jetty" % "jetty-webapp" % "8.1.4.v20120524" % "container", |
This file contains 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
trait TemplateBindings extends ScalateSupport { | |
self: ScalatraServlet => | |
override protected def defaultTemplatePath: List[String] = List("/webTmpl/views") | |
override protected def createTemplateEngine(config: ConfigT) = { | |
val engine = super.createTemplateEngine(config) | |
engine.layoutStrategy = new DefaultLayoutStrategy(engine, | |
TemplateEngine.templateTypes.map("/webTmpl/layouts/default." + _): _*) |
OlderNewer