| |

VerySource

 Forgot password?
 Register
Search
View: 1033|Reply: 8

How to get the url of the previous page (via request.getHeader ("referer"); if not available)

[Copy link]

1

Threads

3

Posts

4.00

Credits

Newbie

Rank: 1

Credits
4.00

 China

Post time: 2020-1-31 16:00:01
| Show all posts |Read mode
Through request.getHeader ("referer"); cannot get the previous page address. Don't know what to do
Reply

Use magic Report

0

Threads

10

Posts

9.00

Credits

Newbie

Rank: 1

Credits
9.00

 China

Post time: 2020-3-10 22:15:01
| Show all posts
Best to bring in url
Reply

Use magic Report

0

Threads

3

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 Invalid IP Address

Post time: 2020-3-11 03:45:01
| Show all posts
Put a hidden
Reply

Use magic Report

1

Threads

3

Posts

4.00

Credits

Newbie

Rank: 1

Credits
4.00

 China

 Author| Post time: 2020-3-13 22:45:01
| Show all posts
At the time of the question, the previous page was not written by us, it may be someone else's. Is there any way to get it
Reply

Use magic Report

0

Threads

21

Posts

19.00

Credits

Newbie

Rank: 1

Credits
19.00

 Invalid IP Address

Post time: 2020-3-14 14:00:01
| Show all posts
Seems to violate privacy principles
Reply

Use magic Report

0

Threads

4

Posts

5.00

Credits

Newbie

Rank: 1

Credits
5.00

 China

Post time: 2020-3-14 15:45:02
| Show all posts
With javaScript
document.referrer
Reply

Use magic Report

1

Threads

3

Posts

4.00

Credits

Newbie

Rank: 1

Credits
4.00

 China

 Author| Post time: 2020-3-15 10:30:01
| Show all posts
How can javascript be passed to jsp? Can it be passed in the address bar, and javascipt can definitely be obtained?
Reply

Use magic Report

0

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 Invalid IP Address

Post time: 2020-7-30 21:15:01
| Show all posts
request.getRequestURL().toString()
Reply

Use magic Report

0

Threads

6

Posts

7.00

Credits

Newbie

Rank: 1

Credits
7.00

 Invalid IP Address

Post time: 2020-7-31 02:00:01
| Show all posts
request.getRequestURL().toString()
Is not working

document.referrer is fine, but there may be errors~~

The best way is to construct the URL directly

out.println(<script>location.href = url</script>)
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