Wicket
  1. Wicket
  2. WICKET-1346

Generated HTML page contains incorrect content when "WicketMessage: No get method defined for class"

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Cannot Reproduce
    • Affects Version/s: 1.3.1
    • Fix Version/s: 1.3.5
    • Component/s: wicket
    • Labels:
      None

      Description

      The html page contains:

      <select wicket:id="miejscowosci">
      <option>Warszawa</option>
      </select>

      and the java class:

      Osoba osoba = new Osoba();
      CompoundPropertyModel model = new CompoundPropertyModel(osoba);
      Form loginForm = new Form("daneOsobowe", model)

      { .... }

      DropDownChoice miejscowosci = new DropDownChoice("miejscowosci",
      Arrays.asList(new String[]

      { "Warszawa", "Kraków", "Wrocław", "Poznań", "Szczecin", "Gdańsk" }

      ));
      loginForm.add(miejscowosci);

      and the Osoba class has no get method for miejscowosci the generated page contains incorrect content (noticed doubled html element and the ASL 2.0 header):

      <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
      <html>
      <head>
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
      <title>Wicket Demo App</title>
      </head>
      <body>
      <strong>Wicket Demo App</strong>
      <span wicket:id="komunikaty"><wicket:panel>

      </wicket:panel></span>
      <form action="?wicket:interface=:1:daneOsobowe::IFormSubmitListener::" wicket:id="daneOsobowe" method="post" id="daneOsobowe1"><div style="display:none"><input type="hidden" name="daneOsobowe1_hf_0" id="daneOsobowe1_hf_0" /></div>
      ImiÄ™: <input value="" type="text" wicket:id="imie" name="imie"/> <br>
      Nazwisko: <input value="" type="text" wicket:id="nazwisko" name="nazwisko"/> <br>
      Login: <input value="" type="text" wicket:id="login" name="login"/> <br>
      Miejscowość:
      <select wicket:id="miejscowosci" name="miejscowosci"><!--
      Licensed to the Apache Software Foundation (ASF) under one or more
      contributor license agreements. See the NOTICE file distributed with
      this work for additional information regarding copyright ownership.
      The ASF licenses this file to You under the Apache License, Version 2.0
      (the "License"); you may not use this file except in compliance with
      the License. You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

      Unless required by applicable law or agreed to in writing, software
      distributed under the License is distributed on an "AS IS" BASIS,
      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
      See the License for the specific language governing permissions and
      limitations under the License.
      -->

      <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
      "http://www.w3.org/TR/html4/loose.dtd">
      <html>
      <head>
      <title>Unexpected RuntimeException</title>
      <style type="text/css">
      body

      {margin-left : 2em;font-family: 'Lucida Sans', 'Helvetica', 'Sans-serif', 'sans', sans-serif;font-size: 9pt;line-height: 1.8em;}

      h1,h2,h3,h4,h5,h6

      color: Color value is invalid

      h1

      {font-size : 1.5em;}

      h2

      {font-size : 1.2em;}

      pre, table, td

      { font-family : 'MS Trebuchet', 'Verdana', Arial, Helvetica, serif; font-size : 10pt; line-height:1.2em;}

      pre

      { border : 1px solid #ddd; margin-left : 2em; }

      .resource

      { color : blue; }

      .componenttree

      { margin-left : 2em; border : 1px solid #ddd; }

      .componenttree

      { padding : 10px; }


      .componenttree th

      { border-bottom : 1px solid #ddd; }

      td > pre

      { padding : 10px; }

      </style>
      </head>
      <body>
      <h1>Unexpected RuntimeException</h1>
      <table ><tr><td><pre><span wicket:id="exception"><p>WicketMessage: No get method defined for class: class pl.jaceklaskowski.wicket.entities.Osoba expression: miejscowosci</p><p>Root cause:</p><p>org.apache.wicket.WicketRuntimeException: No get method defined for class: class pl.jaceklaskowski.wicket.entities.Osoba expression: miejscowosci<br/> at org.apache.wicket.util.lang.PropertyResolver.getGetAndSetter(PropertyResolver.java:433)<br/> at org.apache.wicket.util.lang.PropertyResolver.getObjectAndGetSetter(PropertyResolver.java:275)<br/> at org.apache.wicket.util.lang.PropertyResolver.getValue(PropertyResolver.java:84)<br/> at org.apache.wicket.model.AbstractPropertyModel.getObject(AbstractPropertyModel.java:113)<br/> at org.apache.wicket.Component.getModelObject(Component.java:1539)<br/> at org.apache.wicket.markup.html.form.AbstractSingleSelectChoice.getModelValue(AbstractSingleSelectChoice.java:140)<br/> at org.apache.wicket.markup.html.form.FormComponent.getValue(FormComponent.java:744)<br/> at org.apache.wicket.markup.html.form.AbstractChoice.onComponentTagBody(AbstractChoice.java:344)<br/> at org.apache.wicket.Component.renderComponent(Component.java:2459)<br/> at org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1354)<br/> at org.apache.wicket.Component.render(Component.java:2296)<br/> at org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1240)<br/> at org.apache.wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:1407)<br/> at org.apache.wicket.MarkupContainer.onComponentTagBody(MarkupContainer.java:1344)<br/> at org.apache.wicket.markup.html.form.Form.onComponentTagBody(Form.java:1648)<br/> at org.apache.wicket.Component.renderComponent(Component.java:2459)<br/> at org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1354)<br/> at org.apache.wicket.markup.html.form.Form.onRender(Form.java:1687)<br/> at org.apache.wicket.Component.render(Component.java:2296)<br/> at org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1240)<br/> at org.apache.wicket.MarkupContainer.renderAll(MarkupContainer.java:1370)<br/> at org.apache.wicket.Page.onRender(Page.java:1446)<br/> at org.apache.wicket.Component.render(Component.java:2296)<br/> at org.apache.wicket.Page.renderPage(Page.java:891)<br/> at org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.respond(BookmarkablePageRequestTarget.java:231)<br/> at org.apache.wicket.request.AbstractRequestCycleProcessor.respond(AbstractRequestCycleProcessor.java:103)<br/> at org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1172)<br/> at org.apache.wicket.RequestCycle.step(RequestCycle.java:1241)<br/> at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1316)<br/> at org.apache.wicket.RequestCycle.request(RequestCycle.java:493)<br/> at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:354)<br/> at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:194)<br/> at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)<br/> at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:360)<br/> at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)<br/> at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)<br/> at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:726)<br/> at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405)<br/> at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:206)<br/> at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)<br/> at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139)<br/> at org.mortbay.jetty.Server.handle(Server.java:324)<br/> at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:505)<br/> at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:828)<br/> at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:514)<br/> at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211)<br/> at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:380)<br/> at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:395)<br/> at org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:450)<br/></p></span></pre></td></tr></table>

      <p>
      <a href="?wicket:interface=:2:displayPageViewLink::ILinkListener::" wicket:id="displayPageViewLink">display page view</a>
      </p>
      <p>
      <span wicket:id="componentTree"></span>
      </p>
      </body>
      </html>

        Activity

        Hide
        Martijn Dashorst added a comment -

        I tried to recreate this problem but am unable to reproduce the error.

        Show
        Martijn Dashorst added a comment - I tried to recreate this problem but am unable to reproduce the error.
        Hide
        Jacek Laskowski added a comment -

        To be honest, I don't really know what to answer. I'm Wicket-newbie and during my simple tests I run across this issue where no getter method for a property used in a page class generated completely messed-up HTML response. Have you been able to reproduce it?

        Show
        Jacek Laskowski added a comment - To be honest, I don't really know what to answer. I'm Wicket-newbie and during my simple tests I run across this issue where no getter method for a property used in a page class generated completely messed-up HTML response. Have you been able to reproduce it?
        Hide
        Igor Vaynberg added a comment -

        for some reason your response was already output, what render strategy are you using? if you do not use the default render_to_buffer i am not sure there is much we can do as part of the output has already been written to the response.

        Show
        Igor Vaynberg added a comment - for some reason your response was already output, what render strategy are you using? if you do not use the default render_to_buffer i am not sure there is much we can do as part of the output has already been written to the response.

          People

          • Assignee:
            Johan Compagner
            Reporter:
            Jacek Laskowski
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development