OK, lame-brain is back again. Here's the example I was looking for. 

--

<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<HTML>
<logic:present name="guava"><bean:define id="cool"
name="guava"/></logic:present>
<BODY>
<P>
<logic:present name="cool"><bean:write name="cool"
property="name"/></logic:present>
<logic:notPresent name="cool">Ooops</logic:notPresent>
</P>
</BODY>
</HTML>

--

Also note that logic:present / notPresent can be told which scope to
check, if that's important.

*********** REPLY SEPARATOR  ***********

On 2/2/2001 at 11:46 AM John Hunt wrote:

Hi
If we use struts-bean:define tag and if the variable
is not found, does it raise exception. If yes how can
I catch it and handle it.
Normally if A is in Sesion scope and a property B
then we would do 
<bean:define id="m" name="A" scope="session"
type="typeA" />
<bean:define id="B" name="m" scope="page" type="typeB"
/>

Now if for some reason we cant find A in the session
or say A is null, we cant put a series of if
conditions in the jsp. How are we supposed to handle
such scenarios
Thanks
Hunt


-- Ted Husted, Husted dot Com, Fairport NY USA.
-- Custom Software ~ Technical Services.
-- Tel 716 425-0252; Fax 716 223-2506.
-- http://www.husted.com/about/struts/


Reply via email to