score:0
the reason you're seeing a redirect is that there's an implicit conversion from a string
to a redirect to / (by default) with a lift error notice set.
the string is used as the value of the error notice, which you can see displayed if you have lift notices included on the page. it looks like the implicit is called strtofailmsg
.
the recipe access restriction by http header in the lift cookbook touches on this briefly.
score:0
menu.i("topic") / "topic" >> if(() => false, redirectresponse("/"))
score:0
what lift version are you using?
in both lift 2.4 and lift 2.5, failmsg is a alias of () ⇒ liftresponse
, so just simply provide it with notfoundresponse("myerror")
should work.
menu.i("topic") / "topic" >> if(() => false, () => net.liftweb.http.notfoundresponse("myerror"))
Source: stackoverflow.com
Related Query
- Why it returns 302 and no error message returns with `If` in `Menu`?
- Why there is a different error message on using += and a=x+y on a val variable?
- Why is the Unresolved Dependencies error with SecureSocial and Play 2.3.2?
- Can we convert data frame in Databricks to string and why do we get error Queries with streaming sources must be executed with writeStream.start()
- why flatten and collect_list error in scala? with cannot resolve symbol
- Why I am getting ScalaTest-dispatcher NPE error with Intellij, maven and scala testing?
- A binding to play.api.db.DBApi was already configured, evolutions and injector error with play-slick
- Why am I getting this error when running Scala 2.13 tests in IntelliJ, but not with Scala 2.12?
- Why does Play action fail with "no suitable driver found" with Slick and PostgreSQL?
- Why do Scala 2.11 and Spark with scallop lead to "java.lang.NoSuchMethodError: scala.reflect.api.JavaUniverse.runtimeMirror"?
- Why and when do I need to follow a method name with _?
- Scala: Why does SortedMap's mapValues returns a Map and not a SortedMap?
- Error message with Scala AKKA Actor
- Cannot resolve symbol 'play' error with Play Framework 2.4.x and IntellijIdea 14.x
- Scala: Why does zipped method succeed with tuples of List and not Traversable?
- Error with definition covariant and contravariant types
- Circular Dependency Error for Google Guice with Play2.4 and scala
- Error handling with Try match inside an udf - and log row where it failed
- Why does spark-shell print thousands lines of code after count on DataFrame with 3000 columns? What's JaninoRuntimeException and 64 KB?
- Why does sbt give multiple dependencies warning with Akka and ScalaTest dependencies?
- Why does this two checks for null and empty returns different results?
- Scala compilation error with Java parametrized constructor and parametrized interface
- Why does a scala val definition with a dot in it produce an error in a later stage than parsing?
- Why would "unused import" be a fatal compilation error with sbt?
- Why does this snippet with pattern matching and higher kinded types no longer compile in Scala 2.12?
- Building a project with mixed Scala and Java source files using Ant - illegal cyclic reference error
- Why compilation error in a for comprehension and pattern matching for case classes
- Why does SonarQube find this issue (<static initializer for >() uses a Side Effect Constructor) with case and object class files?
- Why does Akka application fail with Out-of-Memory Error while executing NLP task?
- Why Eclipse shows error with Play Framework render method?
More Query from same tag
- mount S3 to databricks
- | (or) operator for scala parsing combinators does not work
- Play project does not run after JetBrains Scala plugin ugraded to v1.4
- Can Specs2 compare sequence elements with one of the existing matchers?
- Spark job using too many resources
- Anonymous function in Scala, error depending on notation
- Lift-json extract json with 'type' field into a case class
- How to make tests on akka actors response?
- Condition on rows content of dataframe in Spark scala
- The "lower bound" will reverse the variance of a type, but why?
- Scala-arm import error: missing arguments for method resource
- TreeSet not respecting order after mapping
- ClassTag causes Spark to serialize object
- joda Datetime. How to SET timezone to the parsed DateTime?
- How to reduce Dataset of tuple
- sbt dependencies ignoring version
- Abstracting out function across value classes
- Change a variable in the current sbt task scope
- Combining / uniting two strings in Scala
- assigning multiple vals in conditionals
- use Scala to get JSON data in lower levels
- "Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar" when starting the Scala interpreter
- Scala: Get sum of nth element from tuple array/RDD
- Spray IO, add header to response
- play framework with mongodb
- Spark File Streaming get File Names
- Group list of tuples and sum the integers
- how to append a new item to an existing JSON variable?
- implicit param and overloading gotcha
- How to implement the lifecycle PostStop?