Author of ExamLab - a free SCJP / OCPJP exam simulator
What would SCJP exam questions look like? -- OCPJP Online Training -- Twitter -- How to Ask a Question
Bear Bibeault wrote:An Ajax request, whether issues by jQuery or not, is like any other request. You can use Servlets, JSP, JDBC or any other technology on the server and the jQuery/Ajax code could care less. All that matters is what's returned as the response.
Bear Bibeault wrote:What data do you need to return in the response? Raw data? A pre-formatted table? Other?
Bear Bibeault wrote:You might consider returning the pre-formatted table and just inject it into the DOM. Why do something on the client that you can easily handle on the server?
Bear Bibeault wrote:
This would create a request to the controller. The controller would access the model layer to obtain the data necessary to create the table, it would forward to a JSP that would create the HTML fragment for the table, which gets returned as the response (which jQuery injects into the <div>).
srinivas chary wrote:
This is my controller code
How should I use jQuery above?
Bear Bibeault wrote:
forward to a JSP that would create the HTML fragment for the table, which gets returned as the response (which jQuery injects into the <div>).
Can anybody give me example/sample code/architecture advice
Is DWR (direct web remoting ) relevant in my situation?
Sean Clark ---> I love this place!!!
Me ------> I definitely love this place!!!
srinivas chary wrote:$('#results').load('url?searchTxt&searchFilter');
is actually taking me to the new JSP page after a page refresh
<div id="results">
</div>
</body>
What am I doing wrong above?
srinivas chary wrote:I am using a simple form with 2 inputs, and a submit button onClick = "raise()"
function raise(){
$('#results').load('url?searchTxt&searchFilter');
}
Should I be using AJAX, POST or GET ?
Bear Bibeault wrote:Why are you not using jQuery to establish the handler? If you are going to use jQuery, use jQuery.
Bear Bibeault wrote:Why are you not using jQuery to establish the handler? If you are going to use jQuery, use jQuery.
srinivas chary wrote:Still the page gets refreshed.
$('#divContainer').load() , does not make AJAX call?
I'll look into AJAX, post examples...
Bear Bibeault wrote:Why are you not using jQuery to establish the handler? If you are going to use jQuery, use jQuery.
Did you see how Paul cut 87% off of his electric heat bill with 82 watts of micro heaters? |