You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@beehive.apache.org by Yongqin Xu <yo...@bea.com> on 2005/11/09 19:57:17 UTC
beehive pageInput id
I need to embed third party custom jsp tags inside netui tags as
following pattern:
<netui-data:declarePageInput name="pageViews" type="MyPageViewType"/>
<3rdpartytags id="pageViews">
goes here....
....
</3rdpartytags>
In my Controller.java, I create a new object of the page input type,
then forward it the
above jsp page, when I use ${pageInput.pageViews.someAttribute}, it will
output correct value
for the attribute.
But the problem is: inside the 3rd party tags where using "id" to
reference the page input
variable object, it could not find the object under name "pageViews".
The underneath call in custom
tag impl is pageContext.findAttribute(getId()) in the custom tag. If I
use <jsp:useBean id="pageViews"...>
it will work well.
So the question is how do I pass the bean object through page input
netui tag to 3rd party custom jsp tag
which is looking for the object in pageContext with the string value of
"id" attribute?
thanks
Re: beehive pageInput id
Posted by Eddie O'Neil <ek...@gmail.com>.
Yongqin--
In NetUI, page inputs are passed along in an implicit object that is
called "pageInput", so something like this:
${pageInput.pageViews}
basically executes this code:
pageContext.findAttribute("pageInput");
rather than:
pageContext.findAttribute("pageViews");
The latter expects that the pageViews is directly present in a Servlet
attribute map (page context, request, session, servlet context), but
that's not exactly what happens. :)
In the 3rd party tag you're using, can you use a runtime expression
to reference some variable in the page? If so, you can just use the
JSP 2.0 EL expression above to refer to the specific variable in the
page input map:
${pageInput.pageViews}
Hope that helps.
Eddie
On 11/9/05, Yongqin Xu <yo...@bea.com> wrote:
> I need to embed third party custom jsp tags inside netui tags as
> following pattern:
>
>
>
> <netui-data:declarePageInput name="pageViews" type="MyPageViewType"/>
>
> <3rdpartytags id="pageViews">
>
> goes here....
>
> ....
>
> </3rdpartytags>
>
>
>
> In my Controller.java, I create a new object of the page input type,
> then forward it the
>
> above jsp page, when I use ${pageInput.pageViews.someAttribute}, it will
> output correct value
>
> for the attribute.
>
>
>
> But the problem is: inside the 3rd party tags where using "id" to
> reference the page input
>
> variable object, it could not find the object under name "pageViews".
> The underneath call in custom
>
> tag impl is pageContext.findAttribute(getId()) in the custom tag. If I
> use <jsp:useBean id="pageViews"...>
>
> it will work well.
>
>
>
> So the question is how do I pass the bean object through page input
> netui tag to 3rd party custom jsp tag
>
> which is looking for the object in pageContext with the string value of
> "id" attribute?
>
>
>
> thanks
>
>
>