You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Brice Ruth <br...@fiskars.com> on 2003/11/06 17:58:46 UTC

Question on storing bean in request context

Good morning (again)

I have an Action that is retrieving a javabean object from my database 
(via iBATIS, thank you very much :)) and I need to store that bean 
somewhere where a Tile can access it. What I'm doing, is storing it in 
the request context (request.setAttribute("item",item)) and then my 
Action returns a forward that is mapped to a tile definition. That tile 
definition assembles a collection of tiles (which is all working) - the 
tile that needs to access the information in the bean, then does this:

jsp:useBean id="item" scope="request" type="com.fiskars.webpdb.ItemBean"

But, when I try to output something, like c:out 
value="${item.productName}" - I get nothing, no errors, no exceptions, 
nothing.

Any ideas?

-- 
Brice D. Ruth
Sr. IT Analyst
Fiskars Brands, Inc.



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


Re: Question on storing bean in request context

Posted by Brice Ruth <br...@fiskars.com>.
Um (embarrassed) ... I forgot to import the JSTL core taglib ... (/me 
hides head)

Kris Schneider wrote:

>You shouldn't need <jsp:useBean>. What happens with just:
>
><c:out value="${requestScope.item.productName}"/>
>
>Quoting Brice Ruth <br...@fiskars.com>:
>
>  
>
>>Good morning (again)
>>
>>I have an Action that is retrieving a javabean object from my database 
>>(via iBATIS, thank you very much :)) and I need to store that bean 
>>somewhere where a Tile can access it. What I'm doing, is storing it in 
>>the request context (request.setAttribute("item",item)) and then my 
>>Action returns a forward that is mapped to a tile definition. That tile 
>>definition assembles a collection of tiles (which is all working) - the 
>>tile that needs to access the information in the bean, then does this:
>>
>>jsp:useBean id="item" scope="request" type="com.fiskars.webpdb.ItemBean"
>>
>>But, when I try to output something, like c:out 
>>value="${item.productName}" - I get nothing, no errors, no exceptions, 
>>nothing.
>>
>>Any ideas?
>>
>>-- 
>>Brice D. Ruth
>>Sr. IT Analyst
>>Fiskars Brands, Inc.
>>    
>>
>
>  
>

-- 
Brice D. Ruth
Sr. IT Analyst
Fiskars Brands, Inc.



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


Re: Question on storing bean in request context

Posted by Kris Schneider <kr...@dotech.com>.
You shouldn't need <jsp:useBean>. What happens with just:

<c:out value="${requestScope.item.productName}"/>

Quoting Brice Ruth <br...@fiskars.com>:

> Good morning (again)
> 
> I have an Action that is retrieving a javabean object from my database 
> (via iBATIS, thank you very much :)) and I need to store that bean 
> somewhere where a Tile can access it. What I'm doing, is storing it in 
> the request context (request.setAttribute("item",item)) and then my 
> Action returns a forward that is mapped to a tile definition. That tile 
> definition assembles a collection of tiles (which is all working) - the 
> tile that needs to access the information in the bean, then does this:
> 
> jsp:useBean id="item" scope="request" type="com.fiskars.webpdb.ItemBean"
> 
> But, when I try to output something, like c:out 
> value="${item.productName}" - I get nothing, no errors, no exceptions, 
> nothing.
> 
> Any ideas?
> 
> -- 
> Brice D. Ruth
> Sr. IT Analyst
> Fiskars Brands, Inc.

-- 
Kris Schneider <ma...@dotech.com>
D.O.Tech       <http://www.dotech.com/>

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