本文整理汇总了Scala中javax.servlet.ServletException类的典型用法代码示例。如果您正苦于以下问题:Scala ServletException类的具体用法?Scala ServletException怎么用?Scala ServletException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ServletException类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Scala代码示例。
示例1: RootResource
//设置package包名称以及导入依赖的类
package probot
import java.net.{URI, URL}
import javax.servlet.ServletException
import com.typesafe.config.Config
import org.apache.http.client.utils.URIBuilder
import org.apache.juneau.microservice.ResourceGroup
import org.apache.juneau.rest.annotation.{HtmlDoc, RestResource}
import org.apache.streams.config.StreamsConfigurator
object RootResource {
lazy val url : String = asUri(StreamsConfigurator.getConfig().getConfig("server")).toString
def asUri(config : Config) : URI = {
val uri = new URIBuilder()
.setScheme(config.getString("scheme"))
.setHost(config.getString("host"))
.build()
uri
}
}
@RestResource(
defaultRequestHeaders = Array("Accept: application/json", "Content-Type: application/json"),
//defaultResponseHeaders = Array("Content-Type: application/json"),
htmldoc=new HtmlDoc(
aside=""
+ "<div style='max-width:400px;min-width:200px'>"
+ "Probot.Home"
+ "</div>",
nav="probot",
title="Probot",
description="Probot.Home",
header="Probot",
footer="ASF 2.0 License"
),
// messages = "messages.properties",
path = "/",
title = "Probot",
description = "Probot"
,
children = Array(
classOf[probot.TwitterResource]
)
)
class RootResource extends ResourceGroup {
@throws[ServletException]
override def init(): Unit = {
this.log("init")
}
}