开发者

How to set the default page in lift

The question seems relatively simple, what I want is that when the user goes to:

http://somesite.ex/

they get the same content as if they had gone to:

http://somesite.ex/func1

That is, I want func1 to be the "home page" for this site. Obviously I do not want to have a func1.html and an index.html which are just copies (or symlinks) of each other.

I have tried using the "welcome-file-list" section in web.xml, but that seems to be ignored. I am guessing that it should be an option that is specified in Boot, however I cannot find what that option would be.

I have tried the following snippet in Boot, but it did not do what I wanted:

L开发者_Python百科iftRules.statelessRewrite.prepend(NamedPF("BaseRewrite") {
  case RewriteRequest(ParsePath(Nil, _, _, _), _, _) =>
    RewriteResponse("func1" :: Nil)
})


It seems that the correct redirect is:

LiftRules.statelessRewrite.prepend(NamedPF("BaseRewrite") {
  case RewriteRequest(ParsePath("index" :: Nil, _, _, _), _, _) =>
    RewriteResponse("func1" :: Nil)
})

Thanks to the comment of coubeatczech which led me to the right answer.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜