Ahh, yes, now it works.
Thanks a lot!
And, sorry about the wrong list ...


Stephan

-------Original-Nachricht-------

Von: Struts Developers List
Datum: Donnerstag, 4. April 2002 18:39:49
An: 'Struts Developers List'
Betreff: RE: Betreff: RE: Use of ActionForm:

Hi, Stephen:

No, you do not need to write more than one getter/setter. Using your
example, the only getter/setter you would write is to access the book. Using
the dot-delimted notation in your JSP, you can access the Book and use its
getters/setters to access properties. For example:

public class BookForm extends ActionForm
{
private Book book;

public Book getBook() {...}
public void setBook(Book book) {...}
}

Now, in your JSP, you make calls to the Book properties via the getBook()
method. Again, using your example, if you wanted to have an input field for
the Book title, it would look like the following:

<html:text name="BookForm" property="book.title" size="20" />

This tag directs Struts to call getBook().getTitle() to populate the page
when the JSP is being prepared for the browser, and Struts uses
getBook().setTitle() to populate your bean with values written to the input
field when the user submits the form.

BTW, you might want to post these type of questions to the
[EMAIL PROTECTED] lists instead of the dev list.

Chris


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


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

Reply via email to