servlets - get param value to generate a chart -


User two records date to click on a button ...

If the date is valid , is called a jsp page and has been set at the request of some value ... in the jsp, if setSeachDone is true, then generate a chart ...

image another service controller called Kkprntu request already set value is null

  @Controller @RequestMapping ( "/ statError") public class StatisticError {@Autowired not G IUserService userService; @InitBinder ( "Sankyikiform") safety initBinder (WebDataBinder binder) Protect (BinderksetValidator (New StatisticErrorFormValidator ());} @RequestMapping (method = RequestMethodkGET) public String data (model) {StatisticErrorForm Aankdhaform = new StatisticErrorForm (); Model.addAttribute ( "Aankdeform" Sankyikiwadiform); return "Sankyikiviram";} @RequestMapping (method = RequestMethod.POST) public string statistiqueResult (@Valid @ModelAttribute StatisticErrorForm statisticForm, binding results, ModelMap model, HttpServletRequest request, HttpServletResponse Repugnant ) {If (! Result.hasFieldErrors () and amp; amp; amp; amp; Results hasErrors ()) {Request.setAttribute ( "early", Sankyikiform KgetStartDate ()); RequestksetAttribute ( "EndDate", Aankdeform. Getanddet ()); statisticForm.setSearchDone (right);} Model.addAttribute (Aankdeform); return "Sankyikiviram";}   

}

the servlet controller

  @Controller @RequestMapping ( "/ statError.jpg") public class ImageErrorController {@ automatic IUserService userService; @RequestMapping (method = RequestMethod.GET) public void generated chart (Actiteepisaraclet request, Actiteepisrvet Response response) {if (request.getAttribute ( "startdate")! = Null and amp; request.getAttribute ( "endDate")! = NULL ) {Response.setContentType ("Image / JPG"); Axis chat axis: user user service (chart); Servlet encoderhelper.xcodjpeg (excisit, 1.0f, response); }   

}

What the user has to send the value recorded by the image Aararsiaroarelr? Can you pass it as the parameter of the image URL in your view, like this:

    " / & Gt;    

Comments