You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Alan Chandler <al...@chandlerfamily.org.uk> on 2005/08/14 23:06:22 UTC

Strange OGNL error binding.

I have hit an error which seems strange, since its the second occurance of the 
same sort of thing in the component template.  Any ideas where I should look 
for the source of this error?

The error is

Unable to read OGNL expression '<parsed OGNL expression>' of 
$Border_1@19238ad[Home/$Border]: pageMenuNames


This is from my border component with Border.html having the following line

<span jwcid="sidemenu@Foreach" source="ognl:pageMenuNames" 
value="ognl:pageName">

getPageMenuNames is declared in my Border.java file thusly

    public String[] getPageMenuNames()
    {
    	return getAppPropertySource().getPropertyValue("menu-items").split(" 
",0);
    }	


What makes this more strange is that earlier in the template I have almost the 
same thing :-

<span jwcid="mainmenu@Foreach" source="ognl:appMenuNames" 
value="ognl:appName">

with getAppMenuNames defined in the Border.java file in almost the same way 
thusly

   public String[] getAppMenuNames()
    {
        return _appNames;
    }

-- 
Alan Chandler
http://www.chandlerfamily.org.uk

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


Re: Strange OGNL error binding.

Posted by Alan Chandler <al...@chandlerfamily.org.uk>.
On Monday 15 August 2005 06:39, Alan Chandler wrote:
...
>
> I assume this probably means that although I have created a properties
> file, sitting in the WEB-INF directory the framework hasn't found it and
> initialise the property holder for the application.
>

I *THINK* I understand now - can't do it at application level.  .properties 
files only work for components and pages?

I guess I have to think about some alternative mechanism to get application 
level messages



-- 
Alan Chandler
http://www.chandlerfamily.org.uk

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


Re: Strange OGNL error binding.

Posted by Alan Chandler <al...@chandlerfamily.org.uk>.
On Monday 15 August 2005 00:31, Howard Lewis Ship wrote:
> I'd bet if you dug down through the exception stack, you'd find the
> true culprit, somewhere inside getPageMenuNames().  Probably an NPE.

Yes - it is.

What I am trying to do is read the .properties file of the application that is 
using my component.  I am trying to create a method to access it via the 
following @InjectObject annotation.

	@InjectObject("infrastructure:applicationPropertySource")
	public abstract IPropertySource getAppPropertySource();
  
I then call 

	getAppPropertySource().getPropertyValue("menu-items");

Using debug, I can see that I get the correct property source for the 
application, but that the pointer to its properties map is Null.

I assume this probably means that although I have created a properties file, 
sitting in the WEB-INF directory the framework hasn't found it and initialise 
the property holder for the application.

How do I do that?


-- 
Alan Chandler
http://www.chandlerfamily.org.uk

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


Re: Strange OGNL error binding.

Posted by Howard Lewis Ship <hl...@gmail.com>.
I'd bet if you dug down through the exception stack, you'd find the
true culprit, somewhere inside getPageMenuNames().  Probably an NPE.

On 8/14/05, Alan Chandler <al...@chandlerfamily.org.uk> wrote:
> I have hit an error which seems strange, since its the second occurance of the
> same sort of thing in the component template.  Any ideas where I should look
> for the source of this error?
> 
> The error is
> 
> Unable to read OGNL expression '<parsed OGNL expression>' of
> $Border_1@19238ad[Home/$Border]: pageMenuNames
> 
> 
> This is from my border component with Border.html having the following line
> 
> <span jwcid="sidemenu@Foreach" source="ognl:pageMenuNames"
> value="ognl:pageName">
> 
> getPageMenuNames is declared in my Border.java file thusly
> 
>     public String[] getPageMenuNames()
>     {
>         return getAppPropertySource().getPropertyValue("menu-items").split("
> ",0);
>     }
> 
> 
> What makes this more strange is that earlier in the template I have almost the
> same thing :-
> 
> <span jwcid="mainmenu@Foreach" source="ognl:appMenuNames"
> value="ognl:appName">
> 
> with getAppMenuNames defined in the Border.java file in almost the same way
> thusly
> 
>    public String[] getAppMenuNames()
>     {
>         return _appNames;
>     }
> 
> --
> Alan Chandler
> http://www.chandlerfamily.org.uk
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> 
> 


-- 
Howard M. Lewis Ship
Independent J2EE / Open-Source Java Consultant
Creator, Jakarta Tapestry
Creator, Jakarta HiveMind

Professional Tapestry training, mentoring, support
and project work.  http://howardlewisship.com

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