samedi 28 février 2015

how to iterate from value of parameter request

I'm working on a web application that uses Spring MVC and hibernate,


I have this such data,


enter image description here


on web interface, I send 'MESSAGEID' for request,


'MESSAGEID' is not unique, so I want to iterate the value of parameter request (MESSAGEID) to check the data and just get data that the TRANSACTION='PAYMENT' and SUBTRANSACTION='PROCESSED',


this is my code,



@RequestMapping(value="/admin/Detail-BPJS-TK.html")
public ModelAndView listDetailBPJSTK(ModelMap model, HttpServletRequest request, HttpServletResponse response)throws ParserConfigurationException, Exception{
if(!((request.getParameter("MESSAGEID")) == null)){
String MESSAGEID = request.getParameter("MESSAGEID");
System.out.println(MESSAGEID);

DetailBPJS detailbpjs = detailbpjsService.get(MESSAGEID);

String tes = detailbpjs.getMESSAGEID();
System.out.println(tes);

if (!(detailbpjs) == null){
for (DetailBPJS luna : detailbpjs){
String trans = detailbpjs.getTRANSACTION();
String subtr = detailbpjs.getSUBTRANSACTION();

if(trans == "PAYMENT" && subtr == "PROCESSED"){
System.out.println("Yes");
}else{
System.out.println("No");
}
}
}
}else{
System.out.println("Please, check the 'No. Billing' again!!");
String MESSAGEID = request.getParameter("MESSAGEID");
System.out.println(MESSAGEID);
model.addAttribute("errorMessageBPJSTK", "true");
}

return listDetailBPJS(model);
}


any help will be pleasure :)


Aucun commentaire:

Enregistrer un commentaire