in Education by
I am building a plugin for a web application in java which is running on Tomcat and behind a apache reverse proxy server. I am able to get the following: Host Name : request.getLocalName() Port: request.getLocalPort() How can I get the following for original request, not for proxy request: Request Scheme : ?? Context Path: ?? JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
To get the authentication scheme used to protect the Servlet you can call from class HttpServletRequest the method getAuthType(). This will return values matching the static finals as specified in the javadocs. Field Summary: static String BASIC_AUTH String identifier for Basic authentication. static String CLIENT_CERT_AUTH String identifier for Client Certificate authentication. static String DIGEST_AUTH String identifier for Digest authentication. static String FORM_AUTH String identifier for Form authentication. To get the context path you would just call getContextPath() of HttpServletRequest. EDIT: To get the local machine name of the server behind the proxy you could get the localhost machine name: java.net.InetAddress localMachine = java.net.InetAddress.getLocalHost();

Related questions

0 votes
    I am building a plugin for a web application in java which is running on Tomcat and behind a apache ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 17, 2022 in Education by JackTerrance
0 votes
0 votes
    What happens when Intercept is off? A.) The request will hit the server B.) The request will hit the proxy C.) Hit the proxy...
asked Apr 29, 2021 in Technology by JackTerrance
0 votes
    I have a fairly similar docker-compose file to what is officially provided namely version: '3' volumes: ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 7, 2022 in Education by JackTerrance
0 votes
    Which of the following methods returns proxy object? (a) loadDatabase() (b) getDatabase() (c) load() (d) ... & Miscellaneous of Java Select the correct answer from above options...
asked Feb 23, 2022 in Education by JackTerrance
0 votes
    There are two web-apps: an app for desktop browser; an app for mobile browser; Ahead of them ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 6, 2022 in Education by JackTerrance
0 votes
    We have a SQUID reverse proxy and a MOSS 2007 portal. All sites are using NTLM. We cannot get it ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 17, 2022 in Education by JackTerrance
0 votes
    Which of this method is used to find out that a thread is still running or not? (a) run() (b) ... in chapter Multithreading of Java Select the correct answer from above options...
asked Mar 1, 2022 in Education by JackTerrance
0 votes
    Which of the following will ensure the thread will be in running state? (a) yield() (b) notify() (c ... section Multithreading of Java Select the correct answer from above options...
asked Mar 1, 2022 in Education by JackTerrance
0 votes
    compare the running time to determine if 16 bit and 32 bits are prime? Select the correct answer from above options...
asked Dec 19, 2021 in Education by JackTerrance
0 votes
    Which of these methods can be used to determine the type of event? (a) getID() (b) getSource() (c) ... chapter Event Handling of Java Select the correct answer from above options...
asked Feb 24, 2022 in Education by JackTerrance
0 votes
    Which of these methods can be used to determine the type of adjustment event? (a) getType() (b) getEventType ... Event Handling of Java Select the correct answer from above options...
asked Feb 24, 2022 in Education by JackTerrance
0 votes
    How to override or replace the Embedded tomcat server in Spring Boot?...
asked Jul 7, 2021 in Technology by JackTerrance
0 votes
    I have the following code (just as a test) and I want to create an HTTP proxy using EventMachine. The code below ... , data, b].inspect end conn.on_data do |data| @buffer...
asked Feb 13, 2022 in Education by JackTerrance
0 votes
    Which design pattern suggests multiple classes through which request is passed and multiple but only relevant classes carry ... of Java Select the correct answer from above options...
asked Feb 22, 2022 in Education by JackTerrance
...