title: Displaying values from database to gsp (view page) using grails
body: <p>Am a very beginner to this grails
  Here is my domain class</p>
  
  <pre><code>class Business {
  
      Integer id
      String company_name 
      String contact_person   
      Integer phone_no
      String status
      String place
  
  
      static constraints = {
              id(blank:false,uinque:true)
              company_name(blank:false)
              contact_person(blank:false)
              phone_no(blank:false,uinque:true)
              status(blank:false)
              place(blank:false)
      }
  }
  </code></pre>
  
  <p>This is my view page:</p>
  
  <pre><code>&lt;g:each in="${business}" status="i" var="BusinessInstance"  &gt;
  &lt;tr class="${(i % 2) == 0 ? 'odd' : 'even' }"&gt;
  &lt;td&gt;${feildValue(bean: BusinessInstance,feild:"id") }&lt;/td&gt;
  &lt;td&gt;${feildValue(bean: BusinessInstance,feild:"company_name") }&lt;/td&gt;
  &lt;td&gt;${feildValue(bean: BusinessInstance,feild:"contact_person") }&lt;/td&gt;
  </code></pre>
  
  <p>I just want to display data in my view page am using MySQL Database but am unable to get through please give me some ideas.</p>
  
  <p>Thanks in advance
  Have a good day.</p>
  
  <p>Error
      Unable to use direct char[] access of java.lang.String
      java.lang.NoSuchFieldException: count
      at java.lang.Class.getDeclaredField(Class.java:1899)
      at org.codehaus.groovy.grails.web.util.StringCharArrayAccessor.       (StringCharArrayAccessor.java:53)
      at org.codehaus.groovy.grails.web.util.StreamCharBuffer.readAsString(StreamCharBuffer.java:531)
      at org.codehaus.groovy.grails.web.util.StreamCharBuffer.toString(StreamCharBuffer.java:552)
      at org.codehaus.groovy.grails.web.pages.FastStringWriter.getValue(FastStringWriter.java:59)
      at org.codehaus.groovy.grails.web.pages.FastStringWriter.toString(FastStringWriter.java:55)
      at org.codehaus.groovy.grails.web.pages.GroovyPageParser.startTag(GroovyPageParser.java:1119)
      at org.codehaus.groovy.grails.web.pages.GroovyPageParser.page(GroovyPageParser.java:801)
      at org.codehaus.groovy.grails.web.pages.GroovyPageParser.generateGsp(GroovyPageParser.java:380)
      at org.codehaus.groovy.grails.web.pages.GroovyPageParser.parse(GroovyPageParser.java:326)
      at org.codehaus.groovy.grails.web.pages.GroovyPagesTemplateEngine.buildPageMetaInfo(GroovyPagesTemplateEngine.java:584)
      at org.codehaus.groovy.grails.web.pages.GroovyPagesTemplateEngine.createTemplate(GroovyPagesTemplateEngine.java:493)
      at org.codehaus.groovy.grails.web.pages.GroovyPagesTemplateEngine.createTemplateWithResource(GroovyPagesTemplateEngine.java:473)
      at org.codehaus.groovy.grails.web.pages.GroovyPagesTemplateEngine.createTemplate(GroovyPagesTemplateEngine.java:246)
      at org.codehaus.groovy.grails.web.pages.GroovyPagesTemplateEngine.createTemplateForUri(GroovyPagesTemplateEngine.java:373)
      at org.codehaus.groovy.grails.web.pages.GroovyPagesTemplateEngine.createTemplateForUri(GroovyPagesTemplateEngine.java:345)
      at org.codehaus.groovy.grails.web.pages.GroovyPagesTemplateEngine.createTemplate(GroovyPagesTemplateEngine.java:262)
      at org.codehaus.groovy.grails.web.servlet.view.GroovyPageView.renderWithTemplateEngine(GroovyPageView.java:146)
      at org.codehaus.groovy.grails.web.servlet.view.GroovyPageView.renderMergedOutputModel(GroovyPageView.java:81)
      at org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:250)
      at org.codehaus.groovy.grails.web.mapping.filter.UrlMappingsFilter.renderViewForUrlMappingInfo(UrlMappingsFilter.java:260)
      at org.codehaus.groovy.grails.web.mapping.filter.UrlMappingsFilter.doFilterInternal(UrlMappingsFilter.java:189)
      at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at org.codehaus.groovy.grails.web.sitemesh.GrailsPageFilter.obtainContent(GrailsPageFilter.java:245)
      at org.codehaus.groovy.grails.web.sitemesh.GrailsPageFilter.doFilter(GrailsPageFilter.java:134)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at org.codehaus.groovy.grails.web.servlet.filter.GrailsReloadServletFilter.doFilterInternal(GrailsReloadServletFilter.java:104)
      at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at org.codehaus.groovy.grails.web.servlet.mvc.GrailsWebRequestFilter.doFilterInternal(GrailsWebRequestFilter.java:69)
      at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at org.codehaus.groovy.grails.web.filters.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:69)
      at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
      at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
      at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:237)
      at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)
      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
      at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)
      at java.lang.Thread.run(Thread.java:722)</p>