Prabhash Mishra

Ranch Hand
+ Follow
since Jun 01, 2017
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Prabhash Mishra

Hi,
   I am getting JSon response once some error encounter.Once this json link received the user have to click that link and after clicking new page will be opened which will have radio button that will be selected by user and submitted.This is the requirement.

Thanks,
Prabhash
7 years ago
Hello,
       But in jax-rs jersey i was able to do it using exceptionmapper class.There using HAETOS i was able to make json link clickable but in rest spring i am not.

Thanks,
Prabhash
7 years ago
Hello,
       I am working wit spring rest.On some error condition in json response i am sending link.But in browser it is not clickable it is in string from.Following is my code





Controller:

@RequestMapping(value="/sendmail", method=RequestMethod.GET)
public ResponseEntity<ConsentManager> home(Locale locale , Model model,HttpServletRequest request){

System.out.println("Location Is:"+locale);
System.out.println("IP Address Is:"+request.getRemoteAddr());

ConsentManager cm = new ConsentManager();
cm.setRole("Admin");
cm.setJuridection("fr");
cm.setConsentType("email");
cm.setEmail("[email protected]");

Map<String, String> result = new HashMap();

   Enumeration headerNames = request.getHeaderNames();
   while (headerNames.hasMoreElements()) {
       String key = (String) headerNames.nextElement();
       String value = request.getHeader(key);
       result.put(key, value);
   }

   for (String name: result.keySet()){

           String key =name.toString();
           String value = result.get(name).toString();  
           System.out.println(key + " " + value);  


}
   
   String customerName="Prabhash";
String recipantEmail="[email protected]";



boolean status=mailService.sendMail("[email protected]", recipantEmail , "Welcome To Fashioniesta Fashion Store", "Hello"+ " "+customerName+ "\n\n"+ "You Have been successfully registered with Fashioniesta.com."+"\n\n"+"Thanks,"+"\n"+"Team Fashioniesta.");
if(!status){
System.out.println("Inside Fail");
try {
throw new ConsentException("Error Occured While sending mail");
} catch (ConsentException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}

return  new ResponseEntity<ConsentManager>(cm, HttpStatus.OK);



}

@ExceptionHandler(ConsentException.class)
public ResponseEntity<ConsentErrorResponse> exceptionHandler(Exception ex) {
ConsentErrorResponse error = new ConsentErrorResponse();
error.setErrorCode(HttpStatus.PRECONDITION_FAILED.value());
String uri=ServletUriComponentsBuilder.fromCurrentContextPath().path("/my/additional/path").build().toUriString();
Link link = new Link(uri);
error.setMessageLink(link);
return new ResponseEntity<ConsentErrorResponse>(error, HttpStatus.OK);
}

After getting SMTP error i am sending json error response with link.But in browser it is nor clickable.Can anybody let me know where i am making mistake.

Thanks,
Prabhash
7 years ago
Hi,
   Actually some other application is accessing my application through entering URL of my application in browser.I want to know IP of that machine who is accessing my application.

Thanks,
Prabhash
Hi,
   I am calling application which is on remote machine.I want to retrieve IP of remote machine in my java application.Can anyone tell me how i will be able to retrieve IP of remote machine.

Thanks,
Prabhash  
Hi,
   Please get the screenshot of one of the query which execute in SqlDevloper but not in JDBC.

Thanks,
Prabhash
7 years ago
Hi,
   In my WebService i am passing two parameter to query.I tested with more than 3000 parameters(UCN,OrderId).Query is executed with all the passing parameters(UCN,OrderId) but with 6 (UCN,OrderId) the resultset don't have any records(size=0).If i am running the same query on SqlDevloper with 6(UCN,OrderId) it is giving the result but inside JDBC resultset is empty.Can anyone tell me where i m wrong .

Method is:


Resource layer:


URL where i am not getting any records are:

http://schasoa.scholastic.com/OrderHistoryIntegration/orderapi/orderDetail?ucn=623900712&orderId=03240267
http://schasoa.scholastic.com/OrderHistoryIntegration/orderapi/orderDetail?ucn=623900712&orderId=03245513
http://schasoa.scholastic.com/OrderHistoryIntegration/orderapi/orderDetail?ucn=623900712&orderId=03271090

URL for which i am getting records:

http://schasoa.scholastic.com/OrderHistoryIntegration/orderapi/orderDetail?ucn=600036754&orderId=6876113

Please help me out.

Thanks,
Prabhash
7 years ago
Hi,
   Waiting for your solution.

Thanks
Prabhash
Hi,
  DDL for the view is:



Thanks,
Prabhash
Hi,
  I am a java devloper and query is written by some oracle guy.I asked oracle guy to give me view and SCHL_ORDER_DETAILS_V is a view.After so many effort of optimization he was not able to reduce the time.I write this query to fetch required data from view.Since he is not able to optimize query thats why i am optimizing the view query.Oracle guy is absent since one week and its urgent thats why i am optimizing my view query.

Thanks,
Prabhash

apology requirement is .3s.
Hi,
  The query is about fetching billing address,shipping address,total order summary(total amt,total tax,total discount) and all the line items associated with that orderid.In sql devloper it is talking 1.5 sec to 2 sec.But clients requirement is .3 msc.

Thanks,
Prabhash
Hello,
       I have the following query which is taking time to execute.I think it is due to GroupBy.Can anybody modify this query and execute query without using GroupBy but the output result should be same.I am not able to do it.



Thanks,
Prabhash
thanks this is what i was looking for.
7 years ago
Hi,
   I designed endpoint for GET operation.The endpoint is as:

  http://schasoa.scholastic.com/OrderHistoryIntegration/orderapi/ordersHistory/638863641.

It is working fine with number of digit in pathparam is 9 or less tha 9 . When i am increasing number 10 or 11,12 so on it is sending 404 error.Like

http://schasoa.scholastic.com/OrderHistoryIntegration/orderapi/ordersHistory/6388636411111
http://schasoa.scholastic.com/OrderHistoryIntegration/orderapi/ordersHistory/6388636411111111111

In this case it is giving 404 error.In if--else condition i am checking number should be greater than zero.


Can anyone let me know where i am wrong .

Thanks,
Prabhash
7 years ago