PDA

View Full Version : Passing data from Java Controller to ExtJs



maylwy
14 May 2014, 6:53 PM
Hi,

I have a java Controller


@RequestMapping("/test")
public ModelAndView test(){
Map<String, String> model = new HashMap<String, String>();
ModelAndView modelAndView = new ModelAndView("TestPage");
model.put('var1', "test1");
model.put('var2', "test2");
modelAndView.addAllObjects(model);
return modelAndView;
}


Then it will create "TestPage.xhtml" where the app.js generated by Sencha Architect is embedded in it.

My question is, how could I get the values of 'var1' and 'var2', which are put in the modelAndView, in ExtJs? I have tried '#{var1}' or '${var1}' but with no lucks.

Much appreciated to your kindly help!

Gary Schlosberg
16 May 2014, 3:52 PM
Here's a thread that might help:
http://www.sencha.com/forum/showthread.php?157160