aspose file tools*
The moose likes Spring and the fly likes Calling a controller method without reloading whole page Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "Calling a controller method without reloading whole page" Watch "Calling a controller method without reloading whole page" New topic
Author

Calling a controller method without reloading whole page

Lucky J Verma
Ranch Hand

Joined: Apr 11, 2007
Posts: 278
Hi

I have this form in JSP and Spring framework implementation behind.

In form there are many fields along with two comboboxes(form ,entity) which i want to be loaded dynamically from an object (which gets populated from db through DAO method)
Its like a mapping object which stores this mapping between them .

public class FormToEntityTree {

String formId;

List<String> entityIdList = new ArrayList<String>();

public FormToEntityTree(String formId, List<String> entityIdList) {

this.formId = formId;
this.entityIdList = entityIdList;

}

}
If while filling form, form is changed, entity values changes too.
each form has different entities so i get them filled up in m mapping object so can use it dynamically.

Now ,User has filled up form partially and then thought to chage form type.control goes to controller which loads the values from object and comes back to jsp page..all values go away.
Is there any way using java to call and reload without losing enters fields.
I cannt use jquery or yui but plain javascript is okay.
Vyas Sanzgiri
Ranch Hand

Joined: Jun 16, 2007
Posts: 686

Can you please post your JSP and Controller code?


===Vyas Sanzgiri===
My Blog
Lucky J Verma
Ranch Hand

Joined: Apr 11, 2007
Posts: 278

Hi

I am pasting some snippets out of my code.JSp is too big so i pasted just 2 required fields.

Vyas Sanzgiri
Ranch Hand

Joined: Jun 16, 2007
Posts: 686

so why dont you use AJAX.. check out DWR
Lucky J Verma
Ranch Hand

Joined: Apr 11, 2007
Posts: 278

So finally our team decided for ajax. which one is best to start with .Any good tutorials/examples for dwr?
Vyas Sanzgiri
Ranch Hand

Joined: Jun 16, 2007
Posts: 686

http://directwebremoting.org/dwr/documentation/server/integration/spring.html

Use annotations
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Calling a controller method without reloading whole page