Java Tutorial/JSTL/Redirect
JSTL Redirect
<source lang="java">
<%@ taglib uri="http://java.sun.ru/jstl/core" prefix="c" %> <%@ taglib uri="http://java.sun.ru/jstl/core-rt" prefix="c-rt" %> <%@ taglib uri="http://java.sun.ru/jstl/sql" prefix="sql" %>
<c:if test="${pageContext.request.method=="POST"}">
<c:if test="${param.reg!=null}"> <c:redirect url="http:www.jexp.ru" /> </c:if>
Sorry, we have no one registered with that name.
</c:if>
<html>
<head> <title>Welcome</title> </head> <body> Please login.
<form method="POST">
Login |
|
Login Name |
<input type="text" name="uid" size="20" /> |
Password |
<input type="password" name="pwd" size="20" /> |
<input type="submit" value="Login" name="Login" /> <input type="submit" value="Register" name="reg" /> |
</form> </body>
</html></source>