-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Dierk Koenig
committed
Oct 10, 2023
1 parent
a9a31f8
commit 7e92ac8
Showing
1 changed file
with
43 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# WebEngineering Module, Server Pages | ||
|
||
## Goals | ||
|
||
### Abilities | ||
- Being able to use dynamic content in server pages | ||
- Using pages, templates, taglibs, and layouts | ||
- Testing appropriately | ||
|
||
### Knowledge | ||
- Understanding the request-response cycle | ||
- Understanding the four ways of composing server pages plus when to use which | ||
- Where and how to validate | ||
- Optional: using Grails internationalized error messages for generic error display | ||
|
||
## Demo/Code walkthrough | ||
|
||
Walk through the code of InPlaceCalculator | ||
incl. model, view, controller, tests. | ||
|
||
- Intermediate step:more generic field error handling | ||
- Use of _form_row.gsp template for smart, labeled fields | ||
- Using a taglib for dynamic content | ||
- Grails specific: fully generic error messages plus I18N | ||
- Using a layout for the form | ||
|
||
## Practical work (may extend into homework) | ||
|
||
Make a Fahrenheit to Celsius converter. | ||
|
||
You best make a copy of each artifact that we used for the InPlaceCalculator | ||
(model, view, controller, tests, form_row template). | ||
Just copy the file into the same directory as the original and rename accordingly. | ||
|
||
You can reuse the _form_ layout. | ||
|
||
You can make use of the following conversion functions: | ||
|
||
double c2f(double c) { c * 1.8d + 32 } | ||
double f2c(double f) { (f-32) / 1.8d } | ||
|
||
It is probably best to work with two input fields: one for Fahrenheit, one for Celsius, | ||
and calculate a result for each of the inputs separately. |