If the bean "error" doesn't exist in the request or the session then this is 
the error you 
get.

1. either generate the "error" form bean and add it to the scope (any scope 
will do)
or
2. add logic code to test for the presence of the bean before you try using it.

<logic:present name="error">
 ...do the error here.
</logic:present>

Kind regards
mc

On 17 Sep 2005 at 16:23, Laurie Harper wrote:

> R. Markham wrote:
> > I get following error if I push the submit button. I get following error
> > message
> > 
> > javax.servlet.ServletException: Cannot find bean error in any scope
> >  
> > I have following in my JSP File
> > 
> >       <tr>
> >             <td>Lastname</td>
> >             <td><struts-html:text property="lastname"/></td>
> >             <td>
> >                    <struts-html:messages id="error" property="lastname">
> >                   <struts-bean:write name="error"/>
> >              </struts-html:messages>
> >         </td>
> >     </tr>
> > 
> > I want to produce an error message beside the input field if the input field
> > is empty. If I delete the line <struts-bean:write name="error"/> the program
> > works but there is no error message
> 
> Looks right to me... Is that the only place in your JSP that references 
> a bean named 'error'? Is deleting that one line the only difference 
> between getting the error and not?
> 
> What version of Struts are you using? AFAIK, the body of the messages 
> tag should only be evaluated if there are messages to display, and the 
> scripting variable named by 'id' should always be defined. You could try 
> explicitly telling bean:write to look in page scope, though that 
> shouldn't be necessary.
> 
> L.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 
> -- 
> No virus found in this incoming message.
> Checked by AVG Anti-Virus.
> Version: 7.0.344 / Virus Database: 267.10.25/102 - Release Date: 14/09/2005
> 



FOCUS Computing
Mob: 0415 24 26 24
[EMAIL PROTECTED]
http://www.focus-computing.com.au



-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.344 / Virus Database: 267.10.25/102 - Release Date: 14/09/2005


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to