Java Tutorial/JSTL/URL

Материал из Java эксперт
Перейти к: навигация, поиск

Build Custom Tag Based On JSTL

   <source lang="java">

<%@ taglib prefix="myTag" tagdir="/WEB-INF/tags" %>

<html> <head> <title>EL Type Conversion Examples</title> </head> <body>

EL Type Conversion Examples

<myTag:CharacterType val="this is it"/> <myTag:CharacterType val="8"/> <myTag:CharacterType val="3.0001"/>
<myTag:DoubleType val=""/> <myTag:DoubleType val="-3"/>
<myTag:BooleanType val=""/> <myTag:BooleanType val="true"/> <myTag:BooleanType val="t"/> <myTag:BooleanType val="3.1"/>

</body> </html></source>





Build URL with Parameters

   <source lang="java">

<%@ taglib uri="http://java.sun.ru/jstl/core" prefix="c" %> <c:set var="originalURL" value="http://localhost:8080/chapter05/core/url/url.jsp" /> <html>

 <head>
   <title>the c:url action </title>
 </head>
 <body>
   This page takes 3 values that you specify, and forwards them to another JSP.
   That JSP will create a URL to another page, that then extracts the
   parameters and displays them.
   <p />
     <form action="createURL.jsp" method="post">
Enter name: <input type="text" name="name" />
Enter age: <input type="text" name="age" />
Enter gender: <input type="text" name="gender" />
       <input type="submit" value="Submit details" />
     </form>
 </body>

</html></source>