Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/d6y/matchwithoutcurrentvalueexample
Example of using MatchWithoutCurrentValue
https://github.com/d6y/matchwithoutcurrentvalueexample
Last synced: about 1 month ago
JSON representation
Example of using MatchWithoutCurrentValue
- Host: GitHub
- URL: https://github.com/d6y/matchwithoutcurrentvalueexample
- Owner: d6y
- Created: 2015-01-14T13:06:07.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2015-01-16T09:14:49.000Z (almost 10 years ago)
- Last Synced: 2023-03-10T19:08:48.423Z (almost 2 years ago)
- Language: Scala
- Size: 1.04 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Match Without Current Value Example
A `MatchWithoutCurrentValue` example for Lift 2.6.
## Scenario
We have a `Menu.param` matching _/product/{id}_.
There is one known product ID: `1`.
## Expected Behaviour
- A request of _/product/1_ should produce a "product information" page which simply echos the product ID.
- A request of _/product/2_ should redirect the user to the home page.
## Try it...
$ sbt
> container:startTry the above URLs:
- http://127.0.0.1:8080/ (home page).
- http://127.0.0.1:8080/product/1 (product detail page).
- http://127.0.0.1:8080/product/2 (should redirect to home page).## Code
The `Menu.param` is created and added to site map in _Boot.scala_. This is also where our "database" lives.
The `ProductInfo` and rendering class is in _code.snippet/products.scala_.
The HTML page is _src/main/webapp/product/star.html_