alvinalexander.com | career | drupal | java | mac | mysql | perl | scala | uml | unix  

Struts example source code file (example4.ftl)

This example Struts source code file (example4.ftl) is included in the DevDaily.com "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

Java - Struts tags/keywords

amount, amount, example, example, examples, httpsession, httpsession, see, this, this, transfer, we

The Struts example4.ftl source code

<html>
    <head>Token Examples

<body>
    <h1>Token Example 4

    <b>Example 4: This example illustrates a situation where you can transfer money from
    one account to another. We use the token to prevent double posts so the transfer only
    happens once. This page is rendered using freemarker. See the xwork-token.xml where
    we must also use the createSession interceptor to be sure that a HttpSession exists
    when freemarker renders this webpage, otherwise the @s.token tag causes an exception
    while rendering the page.
    <p/>

    <br/>Balance of source account: <@s.property value="#session.balanceSource"/>
    <br/>Balance of destination account: <@s.property value="#session.balanceDestination"/>
    <p/>

    <@s.form action="transfer4">
        <@s.token/>
        <@s.textfield label="Amount" name="amount" required="true" value="400"/>
        <@s.submit value="Transfer money"/>
    </@s.form>

</body>
</html>

Other Struts examples (source code examples)

Here is a short list of links related to this Struts example4.ftl source code file:

... this post is sponsored by my books ...

#1 New Release!

FP Best Seller

 

new blog posts

 

Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.

A percentage of advertising revenue from
pages under the /java/jwarehouse URI on this website is
paid back to open source projects.