We help IT Professionals succeed at work.
Get Started

HTTP Response from Servlet to Application

463 Views
Last Modified: 2013-11-24
I am trying to recreate an active directory authentication servlet. (Through change of company, we didn't get the source code for the servlet. But our apps still look for the servlet for user authentication.) The servlet is called from my application. According to the design doc, "the servlet will return the result as an HTTP response. The response will have up to 3 lines after the HTTP header. 1st line: numeric constant representing a customized return code. 2nd line: return message."  (3rd line is irrelevant). Another design doc refers to the returned data as "Lines Displayed by Servlet": Line 1 = Return code, Line 2 = Return message. "Value of Displayed Lines": Line 1= 0, Line 2 = Authentication Successful.

One of my apps is in Cold Fusion. Here is how it wants to see the servlet response:
<cftry>
      <cf_authenticate_admin userID="#userID#" userPassword="#userPassword#">
      <!--- Custom tag sets CALLER scope variables below --->
      <cfset returnCode=codeValue>
      <cfset returnMessage=messageValue>
      <cfif returnCode eq 13>
            <cfset isAdminAuthenticated=True>
        <cfelse>
           <cfset isAdminAuthenticated=False>
      </cfif>
      <cfcatch type="any">
            <cfoutput>#CFCATCH.message#</cfoutput>
      </cfcatch>
</cftry>

Can someone please help me match these two up? I have a servlet that performs the authentication, but can't figure out how to get my response in the right format. If someone could help wtih an example response, it would sure bail me out. Thank you!!!
Comment
Watch Question
CERTIFIED EXPERT
Most Valuable Expert 2015
Commented:
This problem has been solved!
Unlock 3 Answers and 10 Comments.
See Answers
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE