grails

Grails application context in javascript library

十年热恋 提交于 2020-01-03 15:57:37
问题 Is it possible to access grails.app.context from within a javascript library? --That is, not javascript inserted in a GSP file. I have som javascripts that are context dependent, why I need to be able to access this from javascript. I include the javascript in my gsp-files with: <r:require modules="myModule" /> 回答1: You can pass it to Javascript as global JS variable, put this inside <head> tag: <g:javascript> window.appContext = '${request.contextPath}'; </g:javascript> and use it anywhere

Grails application context in javascript library

让人想犯罪 __ 提交于 2020-01-03 15:57:08
问题 Is it possible to access grails.app.context from within a javascript library? --That is, not javascript inserted in a GSP file. I have som javascripts that are context dependent, why I need to be able to access this from javascript. I include the javascript in my gsp-files with: <r:require modules="myModule" /> 回答1: You can pass it to Javascript as global JS variable, put this inside <head> tag: <g:javascript> window.appContext = '${request.contextPath}'; </g:javascript> and use it anywhere

Force Grails/Weblogic To Only Redirect Using HTTPS protocol

£可爱£侵袭症+ 提交于 2020-01-03 15:54:31
问题 I'm using Grails (2.2.2) on a project and my application issues undesirable http redirects instead of https redirects. We currently have an F5 load balancer in front of Oracle Weblogic. The F5 is offloading our SSL from Weblogic. The F5 only accepts https requests and Weblogic only accepts http requests. My Grails project uses the Spring Security and Spring Security CAS plugin. The problem typically occurs on a successful CAS login. Grails seems to always issue an HTTP redirect. My serverURL

Force Grails/Weblogic To Only Redirect Using HTTPS protocol

走远了吗. 提交于 2020-01-03 15:54:13
问题 I'm using Grails (2.2.2) on a project and my application issues undesirable http redirects instead of https redirects. We currently have an F5 load balancer in front of Oracle Weblogic. The F5 is offloading our SSL from Weblogic. The F5 only accepts https requests and Weblogic only accepts http requests. My Grails project uses the Spring Security and Spring Security CAS plugin. The problem typically occurs on a successful CAS login. Grails seems to always issue an HTTP redirect. My serverURL

Grails: Best approach to dealing with an existing database

倾然丶 夕夏残阳落幕 提交于 2020-01-03 13:57:09
问题 I'm writing a Grails application that will be pulling data from an existing Oracle database. If I were designing this from scratch I could hold all the information in two or three domain models because logically that's how the data should be arranged. However, this is a pre-existing database that has the data I need spread across approximately 25-30 tables. So I am wondering which of the following approaches would be considered best. I don't want to do tons of extra work to take advantage of

Grails: Best approach to dealing with an existing database

故事扮演 提交于 2020-01-03 13:56:28
问题 I'm writing a Grails application that will be pulling data from an existing Oracle database. If I were designing this from scratch I could hold all the information in two or three domain models because logically that's how the data should be arranged. However, this is a pre-existing database that has the data I need spread across approximately 25-30 tables. So I am wondering which of the following approaches would be considered best. I don't want to do tons of extra work to take advantage of

Grails 1.0.3 console reports 'premature end of file'

不羁的心 提交于 2020-01-03 13:50:26
问题 Browsing to a dynamic web page built using Grails version 1.0.3 the console log shows the following errors for each page request: [Fatal Error] :-1:-1: Premature end of file. How do I stop this error from appearing for each request? 回答1: This bug was already fixed: http://jira.codehaus.org/browse/GRAILS-3088 Premature end of file Affects Version/s: 1.0.3 Fix Version/s: 1.0.4 ...Just a few implementation notes. We were defaulting to a q value of 0, which is incorrect according to the spec. So

IntelliJ IDEA building incomplete Grails war

£可爱£侵袭症+ 提交于 2020-01-03 13:33:15
问题 I'm beginning grails development with IntelliJ but just cannot make and deploy a newly created grails app to a local or external Tomcat following the procedure described in this answer The manager app in Tomcat shows that the application is up and running but I always get http 404 when opening the index page. I noticed that it's possible to download the index.gsp file - it just seems that grails isn't initialized correctly: These are the versions I tried: IntelliJ IDEA 12.1.6 Ultimate Grails

Grails 3.0.1 - how and where to configure grails.gorm.default.mapping

点点圈 提交于 2020-01-03 13:29:32
问题 I had in the old Config.groovy: grails.gorm.default.mapping = { id generator = 'identity' // send only the dirty fields to the database for updating dynamicUpdate = true dynamicInsert = true } So I put this in the additionally application.groovy, but it won't be respected any more. All updates are full, sending all fields to the database, even the not changed ones. I tried to translate this in application.yml: grails: gorm: default: mapping: id generator: "identity" dynamicUpdate: true

Grails send request as JSON and parse it in controller

痴心易碎 提交于 2020-01-03 10:17:22
问题 I want to send a request as JSON and in my controller I want to parse this JSON and get the parameters I want. for example this is the request: {"param1":"val1"} I want to parse this request and get "param1" value. I used request.JSON but still I got null. Is there any other way to solve this? Thanks, 回答1: Set it in your UrlMappings like this: static mappings = { "/rest/myAction" (controller: "myController", action: "myAction", parseRequest: true) } Search for parseRequest in latest Grails