0

I have bootstrap tabs which are working well while running it in development environment. But when I make a war and deploy it in tomcat server it is not working. The tabs are all shown in correct manner but the switching between tabs are not functional. There is no other problem with bootstrap(Responsive design is working fine).

I am using bootstrap, jquery-ui.

My Grails version is 2.4.4

Tomcat version is 7.0.64

I have added(for you to understanding the version):

runtime ":jquery:1.11.1"
runtime ":twitter-bootstrap:3.3.5"

My chrome console is showing(when running in tomcat):

->Uncaught ReferenceError: jQuery is not defined
    (anonymous function)    @   application-5db5bde….js:1
    (anonymous function)    @   application-5db5bde….js:1

My chrome console is showing(when running in developement enviornment;in eclipse or using run-app):

->Uncaught ReferenceError: jQuery is not defined
    (anonymous function) @ jquery-ui.js?compile=false:15
    (anonymous function) @ jquery-ui.js?compile=false:17

Another change i found is in developement env url is:

http://localhost:8080/appname/controller/function?param1=&param2=value2&param3=&param4=&format=

In production(app deployed in tomcat)url is like:

http://localhost:8080/appname/controller/function?param1=&param2=value2&param3=&param4=&format=#tabs-1

tabs-1, tabs-2, tabs-3,....... are the id's of div's representing the tabs; when i switch between tags the id in url changes

What could be the problem?

padippist
  • 1,178
  • 1
  • 16
  • 30
  • use the dolar notation in your code `$('div')` not `jQuery('div')` – madalinivascu Apr 06 '16 at 07:02
  • @madalinivascu I did not understand. Could you please elaborate. – padippist Apr 06 '16 at 07:16
  • change all jQuery to $ – madalinivascu Apr 06 '16 at 07:20
  • @madalinivascu I am using $ notation, and every thing is working fine in development environment. That is what is puzzling me. – padippist Apr 06 '16 at 07:21
  • The errors say it all ? zoooom goes the ferrari :) Uncaught ReferenceError: jQuery is not defined (anonymous function) @ jquery-ui.js?compile=false:15 (anonymous function) @ jquery-ui.js?compile=false:17 It is failing to load in jquery-ui ? the production url variation i.e. #tabs-1 is when you have aa that #tabs-1 is the internal reference for jquery-ui to act or go to that tab - so nothing wrong in that. In your view source. The links to the css/js files are provided click them see if chrome will open the files or not- if not there is your issue – V H Apr 06 '16 at 09:38
  • From the above I think I would say it is probably security related but then the question doesn't even mention that have or have not enabled any form of security on your app. if you have enabled spring security disable this then test in production : grails.plugin.springsecurity.active = false add that to your application.groovy and try prod again. – V H Apr 06 '16 at 09:45
  • @vahid The thing is tab interface is working in development environment, but not in production. The difference I find in development and production is the url and the js files specified in the console errors. I am not using spring security. Also I can't find an application.groovy file in my project folder. – padippist Apr 06 '16 at 10:26
  • google it http://stackoverflow.com/questions/2075337/uncaught-referenceerror-is-not-defined this the first link back and in one case it was the order of js scripts – V H Apr 06 '16 at 13:52

0 Answers0