This is not the document you are looking for? Use the search form below to find more!

Report home > Technology

source code

0.00 (0 votes)
Document Description
1-Parent/list.gsp 2-ParentController.groovy 3-NullPointerException output
File Details
  • Added: December, 29th 2010
  • Reads: 176
  • Downloads: 1
  • File size: 136.97kb
  • Pages: 5
  • Tags: grails, groovy, data
  • content preview
Submitter
  • Name: romi
Embed Code:

Add New Comment




Related Documents

PUTTING A VALUE ON OPENNESS: THE EFFECT OF PRODUCT SOURCE CODE RELEASES ON THE MARKET VALUE OF FIRMS

by: samanta, 38 pages

This study examines the effect of releasing the source code of commercial software products as open source software on the market value of firms. Using a sample of 30 software companies in the time ...

My First Progrmme source code MIN-MAX

by: Tony, 2 pages

My First Progrmme source code MIN-MAX

Absolute C++, 4th Edition, Walter Savitch, ADDISON-WESLEY(PEARSON), INSTRUCTOR MANUAL with SOLUTIONS+TEST BANK+SOURCE CODE

by: bestsmtb, 34 pages

Absolute C++, 4th Edition, Walter Savitch, ADDISON-WESLEY(PEARSON), INSTRUCTOR MANUAL with SOLUTIONS+TEST BANK+SOURCE CODE --------------------------------------------------------- My email is: ...

Minix - Source Code

by: Multimakae, 389 pages

Minix - Source Code

Minix - Source Code

by: Tanenmbaum, 389 pages

Minix - Source Code

Starting Out with Programming Logic and Design, 1st Edition, Tony Gaddis, ADDISON WESLEY, SM+SOURCE CODE+TB

by: mysmandtb, 9 pages

Solution Manuals and Test Banks I have huge collection of solution manuals and test banks. I strive to provide you unbeatable prices with excellent support. So, I assure you that you won’t be ...

You Can Make Millions By Giving Away Free Open Source Software

by: benito, 17 pages

You Can Make Millions By Giving Away Free Open Source Software

wvs manual

by: omnipresent, 77 pages

Its a full manual of making a crypter and many things more

Real Estate Script, Real Estate Software, PHP Script for Real Estate

by: peoplesinnovation, 1 pages

Our professional real estate php script offer a complete real estate solutions for agents, brokers and property managers, assisting them with their day-to-day management, marketing, analysis and ...

Real Estate Portal Script

by: peoplesinnovation, 2 pages

Real Estate Enterprise Edition is a complete power packed script with tons of powerful features that will save your money, time and effort. And most importantly, it will boost your online real ...

Content Preview
list.gsp
1
2 <%@ page import="de.test.Parent" %>
3 <html>
4 <head>
5 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
6 <meta name="layout" content="main" />
7 <g:set var="entityName" value="${message(code: 'parent.label', default:
'Parent')}" />
8 <title><g:message code="default.list.label" args="[entityName]" /></title>
9 <resource:treeView/>
10 </head>
11 <body>
12 <div class="nav">
13 <span class="menuButton"><a class="home" href="${createLink(uri:
'/')}"><g:message code="default.home.label"/></a></span>
14 <span class="menuButton"><g:link class="create"
action="create"><g:message code="default.new.label" args="[entityName]"
/></g:link></span>
15 </div>
16 <div class="body">
17 <h1><g:message code="default.list.label" args="[entityName]" /></h1>
18 <g:if test="${flash.message}">
19 <div class="message">${flash.message}</div>
20 </g:if>
21 <g:form method="post" action="update" >
22 <div class="list">
23 <table>
24 <thead>
25 <tr>
26 <g:sortableColumn property="id" title="${message(code:
'parent.id.label', default: 'Id')}" />
27 <g:sortableColumn property="name" title="${message(code:
'parent.name.label', default: 'Name')}" />
28 <g:sortableColumn property="tree" title="${message(code:
'parent.isvalid.label', default: 'tree')}" />
29 </tr>
30 </thead>
31 <tbody>
32 <g:hiddenField name="parentInstanceList"
value="${parentInstanceList }"/>
33 <g:each in="${parentInstanceList}" status="i"
var="parentInstance">
34
35 <tr class="${(i % 2) == 0 ? 'odd' : 'even'}">
36
37 <td><g:link action="show"
id="${parentInstance.id}">${fieldValue(bean: parentInstance, field:
"id")}</g:link></td>
38
39 <td>${fieldValue(bean: parentInstance, field:
"name")}</td>
40 <td>
41
<richui:treeView
xml="${createLink(controller:'parent',action:'listParentNode', id: parentInstance.id
)}" />
42
</td>
43 </tr>
44 </g:each>
45 </tbody>
46 </table>
47 </div>
48 <div class="paginateButtons">
49 <g:paginate total="${parentInstanceTotal}" />
50 </div>
Page 1

list.gsp
51
52 <div class="buttons">
53
<span class="button">
54
<g:actionSubmit class="update" action="update"
value="${message(code: 'default.button.update.label', default: 'update')}" />
55
</span>
56
</div>
57 </g:form>
58 </div>
59
60 </body>
61 </html>
62
Page 2

ParentController.groovy
1 package de.test
2
3 import groovy.xml.MarkupBuilder
4 class ParentController {
5
6
static allowedMethods = [save: "POST", delete: "POST"]
7
8
def index = {
9
redirect(action: "list", params: params)
10
}
11
12
def list = {
13
14
if(!params.max)params.max=10
15
[parentInstanceList: Parent.list(params), parentInstanceTotal:
Parent.count()]
16
}
17
def listParentNode = {
18
println(params)
19
def parentId = params.id
20
def writer = new StringWriter()
21
MarkupBuilder xml = new MarkupBuilder(writer)
22
xml.parents(name: "Parents"){
23
Parent.findAllById(parentId).each {
24
Parent parentt = it
25
Parent( id:parentt.id,name:parentt.name) {
26
Children(name:'Children'){
27
parentt.children.each {
28
Child childd = it
29
child(name:childd.name,id:childd.id)
30
}
31
}
32
}
33
}
34
}
35
["data":writer.toString()]
36
//or render "data" as XML // depending on what the richui tag is expecting.
37
}
38
def create = {
39
def parentInstance = new Parent()
40
parentInstance.properties = params
41
return [parentInstance: parentInstance]
42
}
43
44
def save = {
45
def parentInstance = new Parent(params)
46
if (parentInstance.save(flush: true)) {
47
flash.message = "${message(code: 'default.created.message', args:
[message(code: 'parent.label', default: 'Parent'), parentInstance.id])}"
48
redirect(action: "show", id: parentInstance.id)
49
}
50
else {
51
render(view: "create", model: [parentInstance: parentInstance])
52
}
53
}
54
55
def show = {
56
def parentInstance = Parent.get(params.id)
57
if (!parentInstance) {
58
flash.message = "${message(code: 'default.not.found.message', args:
[message(code: 'parent.label', default: 'Parent'), params.id])}"
59
redirect(action: "list")
60
}
61
else {
Page 1

ParentController.groovy
62
[parentInstance: parentInstance]
63
}
64
}
65
66
def edit = {
67
def parentInstance = Parent.get(params.id)
68
if (!parentInstance) {
69
flash.message = "${message(code: 'default.not.found.message', args:
[message(code: 'parent.label', default: 'Parent'), params.id])}"
70
redirect(action: "list")
71
}
72
else {
73
return [parentInstance: parentInstance]
74
}
75
}
76
77
78
def delete = {
79
def parentInstance = Parent.get(params.id)
80
if (parentInstance) {
81
try {
82
parentInstance.delete(flush: true)
83
flash.message = "${message(code: 'default.deleted.message', args:
[message(code: 'parent.label', default: 'Parent'), params.id])}"
84
redirect(action: "list")
85
}
86
catch (org.springframework.dao.DataIntegrityViolationException e) {
87
flash.message = "${message(code: 'default.not.deleted.message',
args: [message(code: 'parent.label', default: 'Parent'), params.id])}"
88
redirect(action: "show", id: params.id)
89
}
90
}
91
else {
92
flash.message = "${message(code: 'default.not.found.message', args:
[message(code: 'parent.label', default: 'Parent'), params.id])}"
93
redirect(action: "list")
94
}
95
}
96 }
97
Page 2

new 2
Mittwoch, 29. Dezember 2010 08:38
010-12-29 08:37:30,115 [http-8080-1] ERROR richui.TreeViewTagLib - Error parsing xml
groovy.lang.MissingMethodException: No signature of method:
groovy.util.XmlSlurper.parseText() is applicable for argument types:
(org.codehaus.groovy.grails.web.util.StreamCharBuffer) values:
[/PluginTest/parent/listParentNode/1]
Possible solutions: parseText(java.lang.String), parse(java.io.File),
parse(java.io.InputStream), parse(java.io.Reader), parse(java.lang.String),
parse(org.xml.sax.InputSource)
at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:54)
at org.codehaus.groovy.runtime.callsite.PojoMetaClassSite.call(PojoMetaClassSite.java:46)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:40)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:124)
at de.andreasschmitt.richui.TreeViewTagLib$_closure1.doCall(TreeViewTagLib.groovy:18)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:88)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1058)
at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:1070)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:886)
at groovy.lang.Closure.call(Closure.java:276)
at org.codehaus.groovy.grails.web.pages.GroovyPage.invokeTag(GroovyPage.java:357)
at sun.reflect.GeneratedMethodAccessor336.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:88)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)
-1-

Download
source code

 

 

Your download will begin in a moment.
If it doesn't, click here to try again.

Share source code to:

Insert your wordpress URL:

example:

http://myblog.wordpress.com/
or
http://myblog.com/

Share source code as:

From:

To:

Share source code.

Enter two words as shown below. If you cannot read the words, click the refresh icon.

loading

Share source code as:

Copy html code above and paste to your web page.

loading