
- Basic JSP Tutorial
- JSP - Home
- JSP - Overview
- JSP - Environment Setup
- JSP - Architecture
- JSP - Lifecycle
- JSP - Syntax
- JSP - Directives
- JSP - Actions
- JSP - Implicit Objects
- JSP - Client Request
- JSP - Server Response
- JSP - Http Status Codes
- JSP - Form Processing
- JSP - Writing Filters
- JSP - Cookies Handling
- JSP - Session Tracking
- JSP - File Uploading
- JSP - Handling Date
- JSP - Page Redirect
- JSP - Hits Counter
- JSP - Auto Refresh
- JSP - Sending Email
- Advanced JSP Tutorials
- JSP - Standard Tag Library
- JSP - Database Access
- JSP - XML Data
- JSP - Java Beans
- JSP - Custom Tags
- JSP - Expression Language
- JSP - Exception Handling
- JSP - Debugging
- JSP - Security
- JSP - Internationalization
- JSP Useful Resources
- JSP - Questions and Answers
- JSP - Quick Guide
- JSP - Useful Resources
- JSP - Discussion
JSTL - Core <c:redirect> Tag
The <c:redirect> tag redirects the browser to an alternate URL by facilitating automatic URL rewriting, it supports context-relative URLs, and it also supports the <c:param> tag.
Attribute
The <c:redirect> tag has the following attributes −
Attribute | Description | Required | Default |
---|---|---|---|
url | URL to redirect the user's browser to | Yes | None |
context | / followed by the name of a local web application | No | Current application |
Example
If you need to pass parameters to a <c:import> tag, use the <c:url> tag to create the URL first as shown below −
<%@ taglib uri = "http://java.sun.com/jsp/jstl/core" prefix = "c" %> <html> <head> <title><c:redirect> Tag Example</title> </head> <body> <c:redirect url = "http://www.photofuntoos.com"/> </body> </html>
The above code will redirect request to http://www.photofuntoos.com - Try it yourself.
jsp_standard_tag_library.htm
Advertisements