Hello guys i need your help in this topic
well my case is this i have a controller with spring mvc like this
now in the client (ajaxtets.jsp) i have and recieve response from the serverCode:public class TestAjax implements Controller { public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response) throws Exception { Map<String, String> domain = new HashMap<String, String>(); System.out.println("ManoloTestAjax"); domain.put("dateString", "fecha"); domain.put("strings", "some string"); return new ModelAndView("ajaxtest", "domain", domain);
Code:function handleStateChange() { if(xmlHttp.readyState == 4) { if(xmlHttp.status == 200) { alert("from server won!!!!"); <---- works parseResults(); } } }i read a book about how wok with ajax (the server side is java servlets),Code:<h1>Hello World!</h1> <H2><fmt:message key="welcome"/></H2> <input name="test" value="test" type="button" onclick="doRequestUsingPOST();"> <h3>Date string: <c:out value="${domain.dateString}" /></h3> <h3>Mi Muņeca: <c:out value="${domain.strings}" /></h3>
but in all the examples i saw that send the information in format xml,
now i know that the controller can send a "ModelAndView"
so sorry for my ignorance, how can i show the "ModelAndView" in the jsp??,
because when i recieve the information form the server
the jsp fieldsshow nothingCode:<c:out value="${domain.variable}"
thats mean how should i manage the xmlHttp object to show the information from the server because is an object not a xml response how the classical examples of the book
thanks for advanced



Reply With Quote
