Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to make this servlet work?  RSS feed

 
tina wal
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
I will try to explain my issue, as it is pretty confusing.. please bear with me

I am working on a Credit card application .We are merchant, and send the details to the bank for processing.
I am writing this code in JAVA SERVLET. This Servlet will be used by 2 applications as a BACKEND PROCESS,
1. EBS
2. Website (which is in .asp)

Issue.
Now, the Bank's architecture is working in such a way that when a request comes from a Client(Any BROWSER(which is my jsp page)), only than the request gets processed properly, whereas if i send a request from the Servlet(java class) the code never works.
Reason: The URL where the credit card details has to be posted is bank's jsp page, which than submits itself as soon as it receives any cc details to bank's internal Method called as "ProcessDO".

Pictorial description :
This Works perfectly fine.
MyJSP ------> POST Values to BANK's JSP PAGE ------> Which than has script of submitting the bank's jsp form and sending the details to bank's internal Method "ProcessDO" ----> Processes the Requests and sends the Response.

This won't work.
Servlet ------> POST Values to Bank's PAGE -----> Response from bank -----> BANK's JSP PAGE with the method "PROCESSDO". That's it... it won't work as the javascript won't execute as it is been called from a class and not from the (JSP) client.


My Issue is;
As the Servlet is running in the backend, it won't have any Client(Browser (My jsp page) ) to submit the request to the bank.

So how should handle this Issue? how can I mimic my servlet to work like a like a client browser? i tried writing the jsp in the servlet itself, the details are posted to the Bank's JSP page, but the page never gets submitted, as the Servlet cannot understand .jsp file that is returned from the Bank.(I assume).

My Code is :


The response for this from the bank is :


How can i force this javascript that is mentioned in the banks .jsp to execute from my Servlet? OR
How can I make this Jsp popped up on the Website (which is in ASP) & in the EBS Applications? OR
This is not posssible
Please Help!!!

Thanks

[UD: added code tags and line breaks to make the code readable]
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to JavaRanch.

While there may be ways to make this work, given the nature of the application I would strongly advise to use a "proper" solution - which in case is probably to call an API that the bank should provide for such purposes.
 
Surendra Kumar
Ranch Hand
Posts: 236
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why can't you make a direct call to processDO() from the servlet itself?
 
tina wal
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi
Thanks for the Reply.

Dittmer... We checked with the bank and they don't have any API. for processing the Request.

Surendra. I tried calling the PROCESSDO directly, it fails.

Please any more Suggestions!
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The next step would be to use a network monitor (like tcpmon) to observe how the two requests are different. It's probably some hidden parameter or an HTTP header missing.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!