jsphttp-redirectasp-classicserver-variables

How to retrieve custom server variables ASP to JSP


I have two custom server variables that I can see on ASP page:
"HTTP_ONE" and "HTTP_TWO"
How can I retrieve these data on a JSP page when redirected from a classic ASP page? I don't want to use query string or form.


Update:

ASP Page

   <% 
  ' Send redirect
  Call Response.Redirect("yourjspURL?ssouserid=" & Request.ServerVariables("HTTP_SSOUSERID"))
   %>

JSP Page

<%
    String sso = request.getParameter("ssouserid");
    out.println(sso);  
%>

Solution

  • I think you pull headers in like this;

    <%= request.getHeader("HTTP_ONE") %>
    

    Remember though you will need to manually set these headers in your classic asp response before the redirect is called. Something like;

    <%
    ' Pass-through two custom headers before response is sent.
    Call Response.AddHeader("HTTP_ONE", Request.ServerVariables("HTTP_ONE"))
    Call Response.AddHeader("HTTP_TWO", Request.ServerVariables("HTTP_TWO"))
    ' Send response
    Call Response.Redirect("yourjspurl")
    %>
    


    Update:

    After realising this wouldn't work due to the server sending a HTTP 301 Found to the client the only thing I can suggest is passing the header values as a querystring

    Call Response.Redirect("yourjspurl?http_one=" & Request.ServerVariables("HTTP_ONE"))