javascript - TrueMD API does not work in java servlet -
I was trying to apply the TrueMD API as: I have downloaded TrueMD.jar and added to the Java Web Subnet Application Library using Netbeans 8.0. I was able to get medication advice but not his details. I tried the following code:
Secure zero process request (HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {response.setContentType ("text / html; charset = UTF-8") ; PrintWriter out = response.getWriter (); String drugdetail = request.getParameter ("medicine"); TrueMDAPI.key = "3abb58c093fd817e9cddae75b3de2b"; Try {Medical Medicine = TruMDAP Metatcinidata (drugstore); Printmedicine (medicine); } Finally {out.close (); }} Static Wide Printmedicine (Medicine Medicine) {System.out.println ("Manufacturer:" + Medicine. Guest Manipaterator); System.out.println ("Brand:" + medicine.getBrand ()); System.out.println ("Category:" + medicine.getCategory ()); System.out.println ("d_class:" + medicine.getDClass ()); System.out.println ("unit_type:" + medicine.getUnitType ()); System.out.println ("unit_ct:" + medicine.getUnitQty ()); System.out.println ("package_type:" + medicine.getPackageType ()); System.out.println ("package_kitty:" + medicine.getPackageQty ()); System.out.println ("package_pres:" + medicine.getPackagePrice ()); System.out.println ("unit_pris:" + medicine.getUnitPrice ()); System.out.println ("generic_id:" + medicine.getGenericId ()); }
I request you to help find the problem. thank you in advanced.
Before the code fragment
try {medical medicine = trumadiapi} . Med Medicardata (drugstore); Printmedicine (medicine); } Finally {out.close (); } Try pasting:
try {drugdetail = URLEncoder.encode (medicated, "UTF-8"); } Grip (unsupported encoding exception was ignored) {// can safely be ignored because UTF-8 is always supported} I hope it will be helpful.
Comments
Post a Comment