| |

VerySource

 Forgot password?
 Register
Search
View: 1058|Reply: 5

What's the difference between forward and sendredirect?

[Copy link]

1

Threads

2

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

Post time: 2020-3-20 11:30:01
| Show all posts |Read mode
What's the difference between forward and sendredirect?

Know different but can't say clearly
Reply

Use magic Report

0

Threads

12

Posts

7.00

Credits

Newbie

Rank: 1

Credits
7.00

 China

Post time: 2020-6-27 13:30:01
| Show all posts
Forward is the forwarding request, which is processed internally by the server.The address displayed on the page is still the address originally requested.

sendRedirect sets the 302 header and then sends it to the browser.After the browser receives the 302 request, it sends a request to the redirected page again.
Reply

Use magic Report

1

Threads

8

Posts

7.00

Credits

Newbie

Rank: 1

Credits
7.00

 China

Post time: 2020-7-16 20:45:01
| Show all posts
It seems that one is to save user information, and the other is not to save user information~~
Reply

Use magic Report

0

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-7-25 21:00:02
| Show all posts
forward is forwarding and can carry data

sendRedirect is a redirect, a bit like a super link in html
Reply

Use magic Report

1

Threads

2

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

 Author| Post time: 2020-7-30 15:45:01
| Show all posts
But use sendRedirect in Servlet to transfer the request to javabean
Reply

Use magic Report

0

Threads

5

Posts

5.00

Credits

Newbie

Rank: 1

Credits
5.00

 China

Post time: 2020-7-31 01:00:01
| Show all posts
In addition, forword can only request forwarding in the current site.

And sendReddrect can jump to any URL
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list