mercredi 14 mai 2014

Passing data from Java Controller to ExtJs

Hi,

I have a java Controller



Code:



@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!





Aucun commentaire:

Enregistrer un commentaire