2. The value tag

The value tag, V, is used to indicate a location where content can be inserted. It's thus simply a placeholder that will disappear once it has something to show. In the guess template we define the placeholders warning and indication. These are later used to set values depending on the results of the form submission. A value tag looks like the following:

<!--V 'name'-->Default Value<!--/V-->

The guess example only has empty default values. This means that if the value is not set to something else, the tag will just be replaced with nothing and leave an empty space. If we set a default value, it will be used unless the value is changed later on. You can see an example of this in the next section. A value can also be set from Java code by a calling setValue.

It is also possible to use a short version of the value tag which has no default value at all. It would look like this:

<!--V 'name'/-->

If such a short value is not set to something, it will just show up as exactly the same tag in the resulting output. This clearly indicates where values are present and not handled. You can then take appropriate action in your code to either remove the value tag if it's useless or to set it to a value if you forgot to do that.