Oracle JavaServer Pages Developer's Guide and Reference Release 8.1.7 Part Number A83726-01 |
|
This section includes the following:
This section provides a basic sample using some of the Oracle JML custom tags.
This is a modified version of the hellouser.jsp
sample provided earlier in this chapter. For contrast, both the JML code and the original code are provided here.
Note that the runtime implementation of the JML tag library is portable to other JSP environments. For an overview of the runtime implementation, see "Overview of the JSP Markup Language (JML) Sample Tag Library". For information about the compile-time (non-portable) implementation, see Appendix C, "Compile-Time JML Tag Support".
<%----------------------------------------------------------- Copyright (c) 1999, Oracle Corporation. All rights reserved. ------------------------------------------------------------%> <%@page session="false" %> <%@ taglib uri="WEB-INF/jml.tld" prefix="jml" %> <jml:useForm id="name" param="newName" scope="request" /> <HTML> <HEAD> <TITLE> Hello User </TITLE> </HEAD> <BODY> <jml:if condition="!name.isEmpty()" > <H3>Welcome <jml:print eval="name.getValue()" /></H3> </jml:if> <P> Enter your Name: <FORM METHOD=get> <INPUT TYPE=TEXT name=newName size = 20><br> <INPUT TYPE=SUBMIT VALUE="Submit name"> </FORM> </BODY> </HTML>
<%----------------------------------------------------------- Copyright (c) 1999, Oracle Corporation. All rights reserved. ------------------------------------------------------------%> <%@page session="false" %> <jsp:useBean id="name" class="oracle.jsp.jml.JmlString" scope="request" > <jsp:setProperty name="name" property="value" param="newName" /> </jsp:useBean> <HTML> <HEAD> <TITLE> Hello User </TITLE> </HEAD> <BODY> <% if (!name.isEmpty()) { %> <H3>Welcome <%= name.getValue() %></H3> <% } %> <P> Enter your Name: <FORM METHOD=get> <INPUT TYPE=TEXT name=newName size = 20><br> <INPUT TYPE=SUBMIT VALUE="Submit name"> </FORM> </BODY> </HTML>
Additional custom tag samples are provided elsewhere in this document:
|
Copyright © 1996-2000, Oracle Corporation. All Rights Reserved. |
|