0

Can i use ZK mvvm and ZK spring MVC in a single apllication

asked 2016-04-27 10:22:19 +0800

hswain gravatar image hswain flag of India
1763 3 10
http://corejavaexample.bl...

updated 2016-04-27 10:23:03 +0800

I want to implement JQuery Fullcalendar in ZK application. In javascript side i need json string. That why i want to use Spring rest Services for JSON response. How can i achieve this please share your idea.

Look below code.

 $.get("/json", function(data, status){

                alert("Data: " + data + "\nStatus: " + status);

            });
delete flag offensive retag edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2016-04-27 13:09:02 +0800

chillworld gravatar image chillworld flag of Belgium
5367 4 9
https://github.com/chillw...

We have a sample application for testing where we have spring boot, with spring MVC integrated :

A controller looks like :

@Controller
public class HelloController {

    @RequestMapping("personInJson")
    public @ResponseBody Person getPersonInJson(){
        return new Person("chill", "world", new Date());
    }    
}

The method one will return a Person as json data.

Greetz chill.

link publish delete flag offensive edit

Comments

but same time spring and mvvm not working

hswain ( 2016-04-29 11:22:42 +0800 )edit

More Details: I have a ViewModel. I want to call a JS method then Inside JS I want to call controller Then controller return JSON value. Is it possible?

hswain ( 2016-04-29 11:27:48 +0800 )edit

it's a spring mvc controller, see it like mapping. Of course if you go to a zul page, it's normal that you return html, that's why you need separate url for json.

chillworld ( 2016-04-29 11:46:23 +0800 )edit

when i set DispatcherServlet in web.xml then getting error.

hswain ( 2016-04-29 11:53:04 +0800 )edit

My project structure simple MVVM not spring. For JSON response i want to use Spring MVC in with MVVM. But In web.xml Its loading DispatcherServlet. then MVVM not working.

hswain ( 2016-04-29 11:57:08 +0800 )edit
Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow
1 follower

RSS

Stats

Asked: 2016-04-27 10:22:19 +0800

Seen: 36 times

Last updated: Apr 27 '16

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More