sebarmeli / JaxConf2012-SpringMVC_BackboneJS-Demo

Demo application for my presentation at JaxConf 2012 (San Francisco) to show how to integrate SpringMVC and Backbone.js
10 stars 10 forks source link

The application does not work on tomcat #2

Open dnyaneshginde opened 11 years ago

dnyaneshginde commented 11 years ago

I tried deploying the application on tomcat. I was successful and I could get the index.jsp displayed. However when I click the "View list of Contacts" link the getContacts method of the ContactsListController is not called. Why is the this.model.fetch() not invoking the controller? Am I missing something?

dnyaneshginde commented 11 years ago

Just to add to the issue, after clicking the "View list of Contacts" link the "Add new Contacts" link is displayed and the "View list of Contacts" link is hidden. I have created contacts in the DB, so the contacts from DB should show on the jsp.

Sujithaky commented 9 years ago

Following needs to be done to make application work on Tomcat 1.modify Collections as below MyApp.Collections.Contacts = Backbone.Collection.extend({ model: MyApp.Models.Contact, url: '${pageContext.servletContext.contextPath}/list' //url: '/list' });

2.Modify all href in index.jsp with '${pageContext.servletContext.contextPath} prefix ,PSB

                <div>
                    <a class="add" href="${pageContext.servletContext.contextPath}/#add">Add a new contacts</a>
                </div>
sebarmeli commented 9 years ago

@Sujithaky can you issue a PR?

Sujithaky commented 9 years ago

hi, unable to push the changes to my Fork branch ,getting the following error $ git push origin remote Username for 'https://github.com': sujithaky Password for 'https://sujithaky@github.com': error: src refspec remote does not match any. error: failed to push some refs to 'https://github.com/Sujithaky/JaxConf2012-Spr ingMVC_BackboneJS-Demo.git'

Please advise if you want I can e-mail code zip file