#import "../layout/defaultLayout.ftl.html" as layout> <@layout.myLayout
"Home page">
Integration Test
This project serves as integration test of Ninja's functionality.
You should try to test as much as possible with (fast) mocked tests, but from time
to time you have to test functionality running on a real server. And for those test usecases
this project is perfect. Feel free to add new testcases to this page.
Routing
Restful rendering of Html
- Well.. This page already exemplifies that... right?
Restful rendering of Json
Restful rendering of Xml
Rendering Form post form directly to object
Using Ninja's filters
- A working security filter can be found at: /filter
- A filter that generates output, changes the status and
disallows further execution of the filter chain:/teapot
Injection via Guice
- Injection of services is important and can be done easily.
Check out: Not yet completed. /injection
Ninja's session support
- The default mode of Ninja is to store the session as signed
cookie on the client side. Check out /session
Ninja's flash cookie support
- To transmit small bits of information from one request to
another Ninja supports so called flash cookies. They transmit eg a
error message from one request to another. Usually flash cookies only
live for one request.
- Success message via flash cookie: /flash_success
- Error message via flash cookie: /flash_error
- An arbitrary flash message: /flash_any
Internationalization
- To transmit small bits of information from one request to
another Ninja supports so called flash cookies. They transmit eg a
error message from one request to another. Usually flash cookies only
live for one request: /i18n
- You can also get dedicated languages by specifying them via /i18n/en,
/i18n/de and so on...
Html Escaping
- By default all html templates are escaped. This eliminates a
lot of vulnerabilities due to javascript injection attacks. Check out
the following page and have a look in the source code. The html stuff
is escaped in the source... /htmlEscaping
Upload files demo:
- Uploading is straight forward using Ninja. Check out the demo at: /upload
@layout.myLayout>