You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: _posts/2015-03-17-templates.md
+25Lines changed: 25 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -140,6 +140,31 @@ public class CrudApplication extends Application {
140
140
}
141
141
```
142
142
143
+
In Pippo, each builtin template engine comes with special templates for routing problems and exceptions.
144
+
See below the special templates that come by default with `pippo-freemarker`
145
+
```bash
146
+
$ tree src/main/resources/
147
+
src/main/resources/
148
+
└── templates
149
+
└── pippo
150
+
├── 000base.ftl
151
+
├── 400badRequest.ftl
152
+
├── 401unauthorized.ftl
153
+
├── 402paymentRequired.ftl
154
+
├── 403forbidden.ftl
155
+
├── 404notFound.ftl
156
+
├── 405methodNotAllowed.ftl
157
+
├── 409conflict.ftl
158
+
├── 410gone.ftl
159
+
├── 500internalError.ftl
160
+
├── 501notImplemented.ftl
161
+
├── 502overloaded.ftl
162
+
└── 503serviceUnavailable.ftl
163
+
```
164
+
You may override these templates within your own application (put a file with the same name, to same location, in your application classpath).
165
+
If you feel that is too much to have a template for each error code, you can return the same template for all error code. In this situation you must override
By default, all template engines disable the cache in `dev` and `test` mode (to speed the development - change template and refresh the page in browser)
144
169
and enable the cache in `prod` mode (to improve the performance).
0 commit comments