Source used to get the redirect source URL in Java

Introduction

When passing the URL item to be set in OGP to the field It was displaying an unintended value. This is the source used for the investigation at that time.

Enumeration<String> headerNames = request.getHeaderNames();
while (headerNames.hasMoreElements()) {
  System.out.print.ln(headerNames.nextElement());
}
Enumeration<String> attributeNames = request.getAttributeNames();
while (attributeNames.hasMoreElements()) {
  System.out.print.ln(attributeNames.nextElement());
}

What I had a hard time

I usually use __request.getHeaderNames () __ a lot, but this time it wasn't relevant at all. request.getAttribute("javax.servlet.forward.request_uri"); In conclusion, I was able to get the above value.

Recommended Posts

Source used to get the redirect source URL in Java
[Java] How to get the URL of the transition source
Get the URL of the HTTP redirect destination in Java
How to get the date in java
[Rails] How to get the URL of the transition source and redirect
[Java] How to get the redirected final URL
Get the URL of the HTTP redirect destination in Ruby
How to get the class name / method name running in Java
Get the result of POST in Java
Java reference to understand in the figure
[Java] How to get the current directory
Get the public URL of a private Flickr file in Java
How to get the length of an audio file in java
How to get the value after "_" in Windows batch like Java -version
I want to get the IP address when connecting to Wi-Fi in Java
How to get the absolute path of a directory running in Java
What is CHECKSTYLE: OFF found in the Java source? Checkstyle to know from
How to create your own annotation in Java and get the value
How to get Class from Element in Java
Library "OSHI" to get system information in Java
[Java] Memo on how to write the source
[Java] How to get the authority of the folder
I want to get the value in Ruby
Comments in Java source
What is ... (3 dots) found in the Java source? Variadic arguments to know from
Sample code to get the values of major SQL types in Java + MySQL 8.0
The right way to see the tomcat source in eclipse
[Java] How to omit the private constructor in Lombok
[Java] How to get the maximum value of HashMap
[Java] Get the file in the jar regardless of the environment
[Java] Get the file path in the folder with List
Java classes and instances to understand in the figure
I tried to implement the Euclidean algorithm in Java
Pass the condition to be used in the Java8 lambda expression filter () as a parameter
[Java] How to get the key and value stored in Map by iterative processing
How to get the class name of the argument of LoggerFactory.getLogger when using SLF4J in Java
# 1_JAVA I want to get the index number by specifying one character in the character string.
Get EXIF information in Java
[Java] Get KClass in Java [Kotlin]
Input to the Java console
Get the next business day after the specified date in JAVA
Get to the abbreviations from 5 examples of iterating Java lists
Refer to C ++ in the Android Studio module (Java / kotlin)
[Android, Java] Convenient method to calculate the difference in days
Create a method to return the tax rate in Java
Correct the character code in Java and read from the URL
How to derive the last day of the month in Java
How to switch Java in the OpenJDK era on Mac
I want to simplify the conditional if-else statement in Java
[Ruby on Rails] I want to get the URL of the image saved in Active Storage
Sample code to get the values of major SQL types in Java + Oracle Database 12c
Access the network interface in Java
How to use Java HttpClient (Get)
[Java] Get date information 10 days later using milliseconds in the Date class
Guess the character code in Java
Pass the i18n locale to JavaScript
[java8] To understand the Stream API
[Java] Get the dates of the past Monday and Sunday in order
Multithreaded to fit in [Java] template
Specify the java location in eclipse.ini
How to learn JAVA in 7 days