Announcement Announcement Module
Collapse
No announcement yet.
RestTemplate parameters for @ModelAttribute Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • RestTemplate parameters for @ModelAttribute

    Hello !!! I'm sorry for my English , is not very good !!
    I'm new of this forum, I have created a RestFull Ws in Spring.
    I have this controller :
    Code:
    	@RequestMapping(value = "/modifyGallery")
    	public @ResponseBody Gallery modifyGallery(
    			@ModelAttribute("gallery") Gallery gallery)
    				throws Exception { }
    It get a Model Attribute as input parameter.
    I have to call this with a client in another server with ( i think ) RestTemplate class .
    Now i don't know as i pass the parameters for the model Attribute.
    Code:
    RestTemplate template = new RestTemplate();
    	        	Gallery g = new Gallery();
    	        	g.setGalleryName("vafsdf");
    	        	Gallery ga = template.postForObject(url+path, g, Gallery.class);
    	        	ga.getDesc();
    I don't undestand what i wrong, i have tryed to pass the object , json , map and other type.

    Thank you for your reply !!!!
    Bye
Working...
X