Questions tagged [gsp]

Groovy Server Pages (GSP) is a presentation language for web applications, similar to JSP. GSP allows static and dynamic content to be mixed in the same document. The result is a dynamically generated HTML, XML or other type of document in response to a Web client request.

Groovy Server Pages (GSP) is a view technology which can be used for designing web application using Grails Framework. Developing GSP are very much similar to that of designing web pages with Active Server Pages (ASP) and Java Server Pages (JSP) but coding is very much simpler and easier than both of them. Users are provided with facility of having static, dynamic as well as mix of both contents at a time in a single application.

The output can be dynamically rendered to different forms like : HTML, XML, text and any other format based on Web client request object.If you are beginner in learning groovy, please read Introduction to Groovy – Scripting Language.

Advantages of using GSP using Grails

  1. A GSP uses Groovy GString for evaluation of expression generally using ${….} but whereas in JSP EL expressions are used for the same purpose but they are restricted only to object navigation to overcome this disadvantage JSTL functions can to be written for creating static helper methods, registering them through a taglib descriptor, adding a taglib declaration and finally implementing them using the function.
  2. A developer has been provided with Logical and Iterative tags in GSP with safe navigation operator and Elvis operator which can be implemented easily to fetch the needed results according to their requirement. For example these operators can be implemented in this manner: Safe navigation operator :${book.pages?.no()}
  3. Elvis operator : ${totalpages ?: 100}
  4. A GSPhas ability for invoking methods through Grails dynamic tags which makes it easier to produce well-formed markup:
<!-- With a regular tag -->
<a href="<g:createLink action="list" />">Click here</a>
<!-- As a method call -->
<a href="${createLink(action:'list')}">Click here</a>
  1. Creating and testing custom tag libraries using GSP are very easier then JSP since there is no need for developer to code tld files and taglib declarations.
1323 questions
-2
votes
2 answers

Grails: Why is not emitting links?

I have: Dashboard Hello The result is: Dashboard Hello
Alexander Suraphel
  • 10,103
  • 10
  • 55
  • 90
-2
votes
2 answers

The current user in Grails

I want to show the profile of the current user. I have this Link: Profile how I do it
-3
votes
4 answers

Multiple text box with same name

I have multiple text boxes which are created dynamically , these text boxes have the same name different id's. I need to get values of all those text boxes via ajax but did not have any clue, please suggest how can I achieve this. Edit I had tried…
ABC
  • 4,263
  • 10
  • 45
  • 72
1 2 3
88
89