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]

Reply via email to