- Trending Categories
- Data Structure
- Operating System
- C Programming
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
What is the use of
tag in JSP?
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.
The <c:redirect> tag has the following attributes −
|url||URL to redirect the user's browser to||Yes||None|
|context||/ followed by the name of a local web application||No||Current application|
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 the request to http://www.photofuntoos.com - Try it yourself.
- What is the use of Action in JSP?
- What is the use of jsp plugin action element?
- What is the use of jsp text action element?
- What is the use of Cookie or hidden fields in JSP?
- I want to create a custom tag in JSP. How to write a custom tag in JSP?
- What is the use of page object in JSP? Need an example.
- How to apply if tag in JSP?
- How to apply choose tag in JSP?
- How to apply forEach tag in JSP?
- How to apply forTokens tag in JSP?
- What is the function of action in JSP?
- How can I create custom tag in JSP which can accept attribute from parent jsp page?
- What are the standard attributes that should be passed to a custom tag in a JSP page?