Skip to content

Commit

Permalink
before week 4
Browse files Browse the repository at this point in the history
  • Loading branch information
Dierk Koenig committed Oct 10, 2023
1 parent a9a31f8 commit 7e92ac8
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions docs/week04/readme.md
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.

0 comments on commit 7e92ac8

Please sign in to comment.