Try dropping the parentheses from ognl:coursePages().  By adding them
you're telling ognl to call a method named precisely coursePages() which
doesn't exist.  This is something you'd do only when your method name
didn't follow the usual naming conventions.  The expression
ognl:coursePages will call getCoursePages().



Hacer Soran wrote:

>    Hi there,
>  
>  I am trying to tidy my code up using a Border component - with no joy. Your  
> help would be much appreciated if you could. I have already spent 2 days on  
> this - as you can see I am not good at it - and my boss is not happy :(
>  
>  Thanks in advance
>  
>  Ok here it is:
>  
>  The aim is to display a list of courses according to the logged in user, and 
>  this is used at least on 5 pages.
>  The error is:
>    org.apache.hivemind.ApplicationRuntimeException                 Unable  to 
> read OGNL expression '<parsed OGNL expression>' of  [EMAIL 
> PROTECTED]/$Border]: Method "coursePages" failed for  object [EMAIL 
> PROTECTED]/$Border]
>  
>  Border.jwc has:
>    
>    <component-specification>
>      <property name="cPage"/>
>      <property name="idx"/>
>      <component id="courseSelect" type="DirectLink">
>        <binding name="listener" value="listener:doSelectCourse"/>
>        <binding name="parameters" value="ognl:idx"/>
>      </component>     
>    </component-specification>
>  
>  
>  Border class has the following:
>      // constant for now
>      private String[] coursePages = {"Course1","Course2","Course3" };
>  
>      public String[] getCoursePages() {
>          return coursePages;
>      }
>     
>      public String doSelectCourse(final int index) {
>          int idx = index;
>          if (idx <0 || idx > 2) {
>              idx = 0;
>          }
>          return coursePages[idx];
>      }
>  
>  Border.html has the following line
>  
>        <tr jwcid="@For"  source="ognl:coursePages()" value="ognl:cPage" 
> index="ognl:idx"  element="tr"><a jwcid="courseSelect"><span jwcid="@Insert"  
> value="ognl:cPage"/></a><br/></tr>
>  
>  So what is wrong? Why do I get a runtime error?
>  
>  Thanks a lot
>  HS 
>  
>  
>               
>---------------------------------
>To help you stay safe and secure online, we've developed the all new Yahoo! 
>Security Centre.
>  
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to