gsp

How to create GSP taglib without Grails

邮差的信 提交于 2019-12-06 02:27:48
We can use GSP without Grails, just mapping servlet groovy.servlet.TemplateServlet . And what about TagLibs? Here are docs about using TagLibs with Grails - we should just add class to grails-app/taglib folder. Is it possible to create custom GSP tag without Grails? And if it possible, even more important question, how exactly can it be done? UPDATE: it looks like there is a separate Grails Plugin for it - https://github.com/houbie/gsp-taglib . So the question actually boils down to how we can use code from this plugin I guess. According to http://jira.grails.org/browse/GRAILS-5657 full GSPs

Grails using grails var in GSP Site inside javascript

安稳与你 提交于 2019-12-06 02:03:44
问题 I have a question using grails variable values in javascript code in a GSP file. For Example: I have a session value session.getAttribute("selectedValue") and I want to use this value inside javascript code part. My solution is now (inside a GSP): <% def js = new String("<script type=\"text/javascript\">") js += "var jsSelectedValue = " + session.getAttribute("selectedValue") + ";" js += "</script>" out << js %> and then I have javascript block inside my GSP with jQuery Stuff and so on, there

医药行业GSP注册流程

谁说胖子不能爱 提交于 2019-12-05 23:23:42
1、 打完 GSP 行业最新补丁包,如果公有云请通过注册软件管理员,运维单提单 -- 二开补丁部署交由总部打补丁 2、为了便于项目实施过程中进行临时许可或者正式许可申请及快速审核, 后续请有许可申请的同学进行线上申请,许可申请入口 : http://kingdeeamoy.cn:8011/CustomerApply 备注 : 申请机构请一定要填写公司的全称! 邮箱收到注册邮件下载引入就可开始 GSP 之旅 来源: https://www.cnblogs.com/xmjintang/p/11950161.html

Grails: use controller from index.gsp

梦想与她 提交于 2019-12-05 21:38:21
问题 i am new to grails and i want to use a method from a specific controller in my index.gsp In Index.gsp i tried <g:each in="${MyController.myList}" var="c"> <p>${c.name}</p> </g:each> but it says that the property is not available. MyController contains a property like: def myList = { return [My.findAll() ] } What am i doing wrong? Is there a good tutorial about the communication between the grails-parts? Or is there a better way to get information printed via gsp? Thanks 回答1: Generally, when

Why use <g:textField /> in Grails?

五迷三道 提交于 2019-12-05 16:30:09
问题 What is the reason to use g:textField in Grails if you're already familiar with standard HTML form tags? If I understand correctly the following two markup alternatives are equivalent: <input type="text" name="name" value="${params.name}" id="name" /> <g:textField name="name" value="${params.name}" /> Are there any circumstances under which using g:textField would add value? Am I missing something? 回答1: The textField tag is provided as a convenience (slightly shorter than writing the HTML

Defining default sort-order in Grails/GORM

∥☆過路亽.° 提交于 2019-12-05 14:17:38
问题 Let's say I have definied a User object using GORM. Each user can have zero or more Login:s. Each Login has a timestamp. When retrieving user.logins I want the logins to be sorted based on the value of login.date. What is the correct Grails way to achieve this? Example: I want the following code to list all the user's logins in ascending order. <g:each var="login" in="${user.logins}"> <tr> <td>${login.date}</td> </tr> </g:each> These are the referenced classes: class User { ... def hasMany =

how to debug a gsp page? (no grails, just gsp)

為{幸葍}努か 提交于 2019-12-05 11:31:09
I've tried with netbeans and eclipse, with no luck... (coudn't try IntelliJ idea) I gave a quick look ant the code http://kickjava.com/src/groovy/servlet/TemplateServlet.java.htm and it gives me the impression that .gsp pages are translated to .groovy servlets (groovlets) in memory (I might be wrong)... so perhaps it's not so easy to debug gsp as I though... so, can anybody tell me how to do it? pd: By debugging I mean things like browsing the code step-by-step, inspecting variables, adding watches, and all those sort of things, obviously. Not the (not so) good old printf approach... Most of

Difference between view and template in Grails

為{幸葍}努か 提交于 2019-12-05 08:58:16
In a Grails app, I am trying to figure out when to use a view and when to use a template for a gsp. Are there any obvious reasons? Or does it just come down to reuse? Basically Template is a (reusable) part of a View. Useful for splitting View into logical parts and/or for reusing same code from different views. So, if you're rendering a whole page - use View. If you need just a small part - use Template. See docs for Views and Templates - http://grails.org/doc/latest/guide/theWebLayer.html#viewsAndTemplates 来源: https://stackoverflow.com/questions/18272250/difference-between-view-and-template

How to call a Grails service in a view?

浪尽此生 提交于 2019-12-05 06:08:57
Simple question : I have a service class (let's say helpersService ) and a method def constructURI(params) . How can I call this method from a template view. I have tried the following code without success <% def helpersService = new HelpersService() // or def helpersService %> <img src="${helpersService. constructURI(params)}"/> But I get the following result: No signature of method: com.HelpersService. constructURI() is applicable for argument types... or (in case I use def helpersService ) Cannot invoke method constructURI() on null object Any ideas? Services are not intended to be used

using value of enum in g:select when enum is attribute of selection object

不问归期 提交于 2019-12-05 01:48:12
Example: batchTag is an enumerated type attribute of a batchRange, with values like so: JAN1 "January Biweekly 1", JAN2 "January Biweekly 2", etc. I want to display the VALUE of the batchTag in the select, IOW, the select should contain "January Biweekly 1" "January Biweekly 2" ... not JAN1 JAN2 FEB1 FEB2 FEB3 ... I have tried several things in the g:select to do this, but without any success. I thought perhaps "it" would be available as part of the g:select (as it is clearly an iteration) and tried to reference it.batchTag.name for the optionValue, but that did not work. Any suggestions?