java - Error in getting the input in queryparam -


i have problem in web service. because, on first url path, check plate number. now, want input of user first url path , use on second path. possible? here's first url scan input of user:

package com.taxisafe.server;  import javax.ws.rs.get; import javax.ws.rs.path; import javax.ws.rs.produces; import javax.ws.rs.queryparam; import javax.ws.rs.core.mediatype;  import com.taxisafe.connection.databaseconnection; import com.taxisafe.json.jsonconstruction;   //path checking plate number  @path("platecheck")  //for url  public class platenumbercheck { @get  //to full url : http://ipaddress:portnumber/@path/@getpath  @path("/check") @produces(mediatype.application_json)  //produces response of json.  public string check(@queryparam("platenumber") string platenumber){ string sagot = ""; if(checkinput(platenumber)){     sagot = jsonconstruction.jsonresponse("checked", true); } else{      sagot = jsonconstruction.jsonresponse("checked", false, "not in database"); } return sagot; }  private boolean checkinput (string platenumber){ system.out.println("check input"); boolean output = false; if(jsonconstruction.isnotnull(platenumber)){     try{         output = databaseconnection.checkplate(platenumber);     } catch (exception e){         output = false;     } } else{     output = false; }  return output;  }     } 

here want access platenumber without using string taxi_plate_no

package com.taxisafe.server;  import java.util.arraylist;  import javax.ws.rs.get; import javax.ws.rs.path; import javax.ws.rs.produces; import javax.ws.rs.queryparam; import javax.ws.rs.core.mediatype;  import com.google.gson.gson; import com.taxisafe.array.arrayconnection; import com.taxisafe.connection.databaseconnection; import com.taxisafe.json.jsonconstruction; import com.taxisafe.objects.objects;    @path("/displays") public class displaytaxidetails {  @get @path("taxidetails") @produces(mediatype.application_json)  public string taxidetails(@queryparam("taxi_plate_no") string taxi_plate_no{     string sagot = "";     string taxidetails = null;     if(checkinput(taxi_plate_no)){         sagot = jsonconstruction.jsonresponse("checked", true);         arraylist<objects> taxidetailslist = new arraylist<objects>();         try{             taxidetailslist = new arrayconnection().gettaxidetails(taxi_plate_no);             gson gson = new gson();             taxidetails = gson.tojson(taxidetailslist);         } catch (exception e){             e.printstacktrace();         }          return taxidetails;      } else{          sagot = jsonconstruction.jsonresponse("checked", false, "not in database");     }      return sagot;     }  private boolean checkinput (string taxi_plate_no){     system.out.println("check input");     boolean output = false;     if(jsonconstruction.isnotnull(taxi_plate_no)){         try{             output = databaseconnection.checkplate(taxi_plate_no);         } catch (exception e){             output = false;         }     } else{         output = false;     }      return output; }     } 


Comments

Popular posts from this blog

twig - Using Twigbridge in a Laravel 5.1 Package -

jdbc - Not able to establish database connection in eclipse -

Kivy: Swiping (Carousel & ScreenManager) -