当前位置:网站首页>The difference between forward and redirect
The difference between forward and redirect
2022-07-30 04:07:00 【Tiger up】
What are forward and redirect?
There are two main ways of jumping in servlet.Forward is also called forwarding, and redirect is called redirection.
Summary of the difference between the two:
1. From the address bar display:
1) forword is an internal redirection of the server. The server directly accesses the url of the target address and reads the contents, but the client does not know it. Therefore, if forward is used, the URL of the client browser is notwill change.
2) Redirect means that the server sends a status code according to the logic, telling the browser to re-request that address, so the address bar displays the new address.
2. In terms of data sharing:
1) Since the same request is used in the entire orientation process, forward will bring the request information to the redirected jsp or servlet for use.data can be shared
2) Redirect cannot be shared
3. From the point of application
1) Forword is generally used when a user logs in, and is forwarded to the corresponding module according to the role
2) redirect is generally used to return to the main page or jump to other websites when users log out and log in
4. In terms of efficiency:
1) Forword is efficient, but redirect is inefficient
5. Essentially:
Forword forwarding is an action on the server, while redirect redirection is an action on the client side
forward means that after the memory server is processed, the client can access the specified interface without perception. Forward is as shown below:
Redirect is sent to the client redirection address through redirection, waiting for the client to re-visit to the new address, the client is aware of this redirection, the redirection is as follows:
边栏推荐
- [ 云原生之谜 ] 云原生背景 && 定义 && 相关技术详解?
- Based on all volunteers - H and D1 XR806 rare plant monitoring device
- cv2.polylines
- golang中如何比较struct,slice,map是否相等以及几种对比方法的区别
- 小程序毕设作品之微信二手交易小程序毕业设计成品(6)开题答辩PPT
- Taobao/Tmall get Taobao store details API
- 一起来学习flutter 的布局组件
- Nacos cluster partition
- Eureka Registry
- Pytorch framework learning record 3 - the use of Transform
猜你喜欢
随机推荐
The underlying mechanism of the function
操作配置:如何在一台服务器中以服务方式运行多个EasyCVR程序?
发给你的好友,让 TA 请你吃炸鸡!
New LaaS protocol Elephant Swap provides ePLATO with sustainable premium space
SQL Server data type conversion function cast () and convert () explanation
Roperties class configuration file & DOS to view the host network situation
运行时间监控:如何确保网络设备运行时间
逆向理论知识3【UI修改篇】
AI智能安防视频平台EasyCVR如何配置音视频同时传输?
对均匀采样信号进行重采样
Pytorch framework learning record 3 - the use of Transform
High Concurrency Framework Disruptor
Based on all volunteers - H and D1 XR806 rare plant monitoring device
Transformation of traditional projects
The difference between BGP room and ordinary room in Beijing
Smart answer function, CRMEB knowledge payment system must have!
How to extract year, month and day data in date type in SQL Server
Basic introduction to protect the network operations
Problems caused by List getting the difference
Mini Program Graduation Works WeChat Points Mall Mini Program Graduation Design Finished Products (3) Background Functions