Home > Articles > Programming > Java

  • Print
  • + Share This
Like this article? We recommend

Water Implementation

Below is the Water code to implement the task of defining a function and calling it from HTML.

<defmethod new_tag message="message not available">
 message
</defmethod>

<HTML>
 <new_tag message="This is a tag with an attribute"/>
</HTML>

Creating a custom tag in JSP is the equivalent to defining a new object or method in Water. The defmethod defines a new method, new_tag, with a single parameter message. The default value of the parameter is "message not available". The method returns the value of the message argument passed into the method. The method returns the value of message because a Water method returns the value of the last expression.

  • + Share This
  • 🔖 Save To Your Account