struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Esbrook, Scott" <>
Subject referring to a formBean property in a scriptlet
Date Fri, 24 Aug 2001 14:58:03 GMT

I'm new to Struts, and really like what I see. I didn't see this in the
docs, so maybe someone can answer this. 

I'm working on a small sample app that displays an Employee Id on a form for
maintenance. I need to display the ID as static text if the Employee record
already exists, or in a textfield if the Employee record does not yet exist.
So I put a boolean flag 'isNew' in the formBean. What's the best way to
refer to that flag within a scriptlet? That is, 

<% if ( ??FORMBEAN??.getIsNew() ) { %>
   <html:text property="employeeId" size="30" maxlength="30"/>
<% } else { %>
   <%= ??FORMBEAN??.getEmployeeId() %>
<% } %>

Does Struts provide a standard id I can use to refer to my formBean? Or do I
have to put in a 'useBean' directive and access the bean directly?


Scott Esbrook
Software Developer
Compuware Corporation

View raw message