You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by bo...@serviceinformation.ws on 2003/09/12 14:42:42 UTC

Invalid ComponentAddress encoding

The following component successfully returns a value to its page class
 
         <input jwcid="serviceTypeInput@Hidden" 
value="ognl:serviceTypeInput"  encode="false">

The following component in the same form returns an "Invalid 
ComponentAddress encoding " error:

        <input jwcid="categoryInput@Hidden" value="ognl:categoryInput" 
encode="false"/>

Here is excerpt from the error message:

org.apache.tapestry.ApplicationRuntimeException    Invalid 
ComponentAddress encoding -- separator not present   component:  
org.apache.tapestry.form.Hidden$Enhance_8@b83be0[RatingsRequest/categoryInput]  
location:  classpath:/t2/RatingsRequest.html, line 121          
java.io.IOException    Invalid ComponentAddress encoding -- separator 
not present    Stack Trace:

    * 
org.apache.tapestry.util.io.ComponentAddressAdaptor.unsqueeze(ComponentAddressAdaptor.java:93)
    * 
org.apache.tapestry.util.io.DataSqueezer.unsqueeze(DataSqueezer.java:268)
    * org.apache.tapestry.form.Hidden.renderComponent(Hidden.java:128)
 
Here is the html generated by Tapestry for the form:

    <form method="post" name="Form0" action="/t2" class="SubmitForm">

    <input type="hidden" name="service" 
value="direct/1/RatingsRequest/$Form"/>
    <input type="hidden" name="sp" value="S0"/>
    <input type="hidden" name="Form0" 
value="categoryInput,serviceTypeInput"/>
    <input type="hidden" name="categoryInput" value="SCategory 
plaecholder"/>
    <input type="hidden" name="serviceTypeInput" value="SService Type 
placeholder"/>
     <input type="submit" value="Submit Ratings Request">
      </input>



Java script on the page generated by the web app successfully displays 
the hidden values for each component::  

      document.Form0.categoryInput.value= category;
    ..
    alert("categoryInput value =" + document.Form0.categoryInput.value);
    ..
    document.Form0.serviceTypeInput.value= serviceType;
    alert("HiddenInput = " + document.Form0.serviceTypeInput.value);
    ..

Here is the relevant code from the page component class:
    private String categoryInput;
    private String serviceTypeInput;

     public String getServiceTypeInput() {return serviceTypeInput;}
        public void  setServiceTypeInput(String value) {
            devOut("setting serviceTypeInput to " + value);
            serviceTypeInput=value;
        }

 
       public String getCategoryInput() {return categoryInput;}
      public void setCategoryInput(String value) {
            devOut("settiing categoryInput to " + value);
            categoryInput=value;
        }

      public void requestSubmitAction(IRequestCycle cycle) {
            devOut("submit action; serviceType= " + getServiceTypeInput());
            devOut("submit action; category= " + getCategoryInput());
            visit.newRatingFilters();
            visit.getRatingFilters().put("serviceType", 
getServiceTypeInput());
            visit.getRatingFilters().put("category", getCategoryInput());
            cycle.setPage("RatingResults");
        }

       public void pageBeginRender(PageEvent event) {
          devOut("start begin Render2");
          this.visit = (Visit)getEngine().getVisit();
             this.categoryList=visit.getSfData().getCategoryList();
            this.setServiceTypeInput("Service Type placeholder");
            this.setCategoryInput("Category plaecholder");
            if (getCategoryList()==null) {
                devOut("no category list");
                return;
            }    
            devOut("begin render done, category list size= ;" + 
this.categoryList.size());
     }

Commenting out the categoryInput component and related java script in 
the template returns the following lines from the devOut() calls in the 
requestSubmitActon method above:

    submit action; serviceType= Brakes
    submit action; category= Category plaecholder
This demonstrates that the hidden input works as intended for the 
seviceTypeInput component.


Commenting out the serviceTypeInput component and related java script 
and leaving the categroyInput component results in the "Invalid 
ComponentAddress encoding " error:

Can someone advise me on how to track down this error?

Thanks,
Bob Newsome




---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


RE: Invalid ComponentAddress encoding

Posted by "Howard M. Lewis Ship" <hl...@comcast.net>.
encode="false" should be encode="ognl:false".  

"false" is a string, not an OGNL expression.  When evaluated as a boolean, all non-null strings
evaluate to true.

This turns up often enough that perhaps we should make a special case for the string "false".
Please add a suggestion.

The client side stuffs some data into the hidden field, and the hidden component tries to decode it.
The first character of an encoded value is used to identify its type.

--
Howard M. Lewis Ship
Creator, Tapestry: Java Web Components
http://jakarta.apache.org/tapestry
http://jakarta.apache.org/commons/sandbox/hivemind/
http://javatapestry.blogspot.com

> -----Original Message-----
> From: bobn@serviceinformation.ws [mailto:bobn@serviceinformation.ws] 
> Sent: Friday, September 12, 2003 8:43 AM
> To: tapestry-user@jakarta.apache.org
> Subject: Invalid ComponentAddress encoding
> 
> 
> The following component successfully returns a value to its page class
>  
>          <input jwcid="serviceTypeInput@Hidden" 
> value="ognl:serviceTypeInput"  encode="false">
> 
> The following component in the same form returns an "Invalid 
> ComponentAddress encoding " error:
> 
>         <input jwcid="categoryInput@Hidden" 
> value="ognl:categoryInput" 
> encode="false"/>
> 
> Here is excerpt from the error message:
> 
> org.apache.tapestry.ApplicationRuntimeException    Invalid 
> ComponentAddress encoding -- separator not present   component:  
> org.apache.tapestry.form.Hidden$Enhance_8@b83be0[RatingsReques
> t/categoryInput]  
> location:  classpath:/t2/RatingsRequest.html, line 121          
> java.io.IOException    Invalid ComponentAddress encoding -- separator 
> not present    Stack Trace:
> 
>     * 
> org.apache.tapestry.util.io.ComponentAddressAdaptor.unsqueeze(
> ComponentAddressAdaptor.java:93)
>     * 
> org.apache.tapestry.util.io.DataSqueezer.unsqueeze(DataSqueeze
> r.java:268)
>     * org.apache.tapestry.form.Hidden.renderComponent(Hidden.java:128)
>  
> Here is the html generated by Tapestry for the form:
> 
>     <form method="post" name="Form0" action="/t2" class="SubmitForm">
> 
>     <input type="hidden" name="service" 
> value="direct/1/RatingsRequest/$Form"/>
>     <input type="hidden" name="sp" value="S0"/>
>     <input type="hidden" name="Form0" 
> value="categoryInput,serviceTypeInput"/>
>     <input type="hidden" name="categoryInput" value="SCategory 
> plaecholder"/>
>     <input type="hidden" name="serviceTypeInput" value="SService Type 
> placeholder"/>
>      <input type="submit" value="Submit Ratings Request">
>       </input>
> 
> 
> 
> Java script on the page generated by the web app successfully 
> displays 
> the hidden values for each component::  
> 
>       document.Form0.categoryInput.value= category;
>     ..
>     alert("categoryInput value =" + 
> document.Form0.categoryInput.value);
>     ..
>     document.Form0.serviceTypeInput.value= serviceType;
>     alert("HiddenInput = " + document.Form0.serviceTypeInput.value);
>     ..
> 
> Here is the relevant code from the page component class:
>     private String categoryInput;
>     private String serviceTypeInput;
> 
>      public String getServiceTypeInput() {return serviceTypeInput;}
>         public void  setServiceTypeInput(String value) {
>             devOut("setting serviceTypeInput to " + value);
>             serviceTypeInput=value;
>         }
> 
>  
>        public String getCategoryInput() {return categoryInput;}
>       public void setCategoryInput(String value) {
>             devOut("settiing categoryInput to " + value);
>             categoryInput=value;
>         }
> 
>       public void requestSubmitAction(IRequestCycle cycle) {
>             devOut("submit action; serviceType= " + 
> getServiceTypeInput());
>             devOut("submit action; category= " + getCategoryInput());
>             visit.newRatingFilters();
>             visit.getRatingFilters().put("serviceType", 
> getServiceTypeInput());
>             visit.getRatingFilters().put("category", 
> getCategoryInput());
>             cycle.setPage("RatingResults");
>         }
> 
>        public void pageBeginRender(PageEvent event) {
>           devOut("start begin Render2");
>           this.visit = (Visit)getEngine().getVisit();
>              this.categoryList=visit.getSfData().getCategoryList();
>             this.setServiceTypeInput("Service Type placeholder");
>             this.setCategoryInput("Category plaecholder");
>             if (getCategoryList()==null) {
>                 devOut("no category list");
>                 return;
>             }    
>             devOut("begin render done, category list size= ;" + 
> this.categoryList.size());
>      }
> 
> Commenting out the categoryInput component and related java script in 
> the template returns the following lines from the devOut() 
> calls in the 
> requestSubmitActon method above:
> 
>     submit action; serviceType= Brakes
>     submit action; category= Category plaecholder
> This demonstrates that the hidden input works as intended for the 
> seviceTypeInput component.
> 
> 
> Commenting out the serviceTypeInput component and related java script 
> and leaving the categroyInput component results in the "Invalid 
> ComponentAddress encoding " error:
> 
> Can someone advise me on how to track down this error?
> 
> Thanks,
> Bob Newsome
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org