Angular ajax ,I can't get response json from background using struts2 and fastjson


#1

I found that use angular take a look at http://victorblog.com/2012/12/20/make-angularjs-http-service-behave-like-jquery-ajax/


#2

@shunyaram i can send json to background


#3

Can you place your code here


#4

HttpServletRequest request= ServletActionContext.getRequest ();
HttpSession session=request.getSession();
Json j=new Json();
System.out.println(this.username);
System.out.println(this.password);
Map datamap=new HashMap();
if(userDao.checkUser(username, password)){
Users user=(Users)userDao.findByUsername(username);
session.setAttribute(“user”, user);
j.setObj(user);
}
writeJson(j);
i doubt there is something wrong with angular using json-pluin of fastjson


#5

Which platform are you using .NET or PHP