aspose file tools*
The moose likes Servlets and the fly likes without reloading the page Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "without reloading the page" Watch "without reloading the page" New topic
Author

without reloading the page

surendar prabu
Ranch Hand

Joined: Jul 24, 2006
Posts: 102
my servlet provides a response to the client with some form fields having default values.when i want to change the default value of a particular field based on some selection over other field or some request........what is the way to achieve this?

I want to do this with out reloading the whole page ,as i want to reduce traffic in my server. Can i use servlet filters for this?


SCJP 1.4
Peter Chase
Ranch Hand

Joined: Oct 30, 2001
Posts: 1970
I don't know much about servlet filters, but I don't think they are going to help you with your problem.

To update parts of a Web page, without doing a full refresh, you can use JavaScript to modify the HTML Document Object Model (DOM). This runs on the client, not the server, so does not cause any load on your server.

If the update requires some information that can only be supplied by the server, you can get that information, without a full refresh. The modern approach is to send an XmlHttpRequest to the server. The XmlHttpRequest calls back to some JavaScript when it has got the data from the server. Alternative approaches use IFRAMEs; you can make your IFRAMEs visible or invisible (zero-sized).


Betty Rubble? Well, I would go with Betty... but I'd be thinking of Wilma.
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

surendar prabu,
Welcome to JavaRanch!

In an effort to help you get the most from our forums, we've compiled a
list of tips for asking questions here. You can find the list in our
FAQ section here.
In particular, please see UseAMeaningfulSubjectLine.

"without reloading the page" is not a very good summary of your question.

Again, welcome to JavaRanch and good luck with your question.
-Ben


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61434
    
  67

Originally posted by surendar prabu:

I want to do this with out reloading the whole page ,as i want to reduce traffic in my server. Can i use servlet filters for this?


Why would you think that servlet filters have anything to do with this?

If you want to grab information from the server without a page reload, then Ajax is the technology you'll need to use. But that won't really eliminate traffic to the server -- a request/response cycle will still take place (though it will reduce the amount of data transferred: typically, Ajax requests return small snippets of data rather than whole pages).

If you want to elminate any server traffic for this, you'll just need to preload any data that you might need to use on the page into JavaScript data structures.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Ajay Krishnamurthy
Greenhorn

Joined: Jul 28, 2006
Posts: 5
Hi surendar,
Without reloading a page you want to get the values from some back end like (Database). For this process you have to use the AJAX.Using java script you can call the AJAX servlet through the Xmlhttp:// request.

Please refer some AJAX Tutorials you can acheive wat exactly you want .. ( I Think the java people provides lots of tutorial for AJAX) .

Regards
Ajay Krishnamurthy
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: without reloading the page