I thought that as well but stripes normally does a great job at creating
objects for you. Other wise I would think the form tag would have thrown a
NPE.
On Wed, Sep 17, 2008 at 11:50 PM, Leonard Gestrin <
[EMAIL PROTECTED]> wrote:
> Could it because you did not create instance of the class Person?
>
>
> ------------------------------
>
> *From:* [EMAIL PROTECTED] [mailto:
> [EMAIL PROTECTED] *On Behalf Of *Nathan Maves
> *Sent:* Wednesday, September 17, 2008 10:42 PM
> *To:* Stripes Users List
> *Subject:* [Stripes-users] Default values in domain object not being use
> inform fields
>
>
>
> based on the jsp and class below why does the form field not get defaulted
> by the value in the domain model?
>
> *jsp*
> <[EMAIL PROTECTED] prefix="s"
> uri="http://stripes.sourceforge.net/stripes.tld"%>
>
> <[EMAIL PROTECTED] prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
>
> <[EMAIL PROTECTED] contentType="text/html" pageEncoding="UTF-8"%>
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
> "http://www.w3.org/TR/html4/loose.dtd">
>
> <html>
> <head>
> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
> <title>JSP Page</title>
> </head>
> <body>
> <h2>Hello World!</h2>
>
> <s:form beanclass="com.mwt.oclc.stripes.TestAction">
> Name <s:text name="person.name"/>
> </s:form>
> </body>
> </html>
>
>
> *class*
> @UrlBinding("/test")
> public class TestAction implements ActionBean {
> private ActionBeanContext context;
>
> public ActionBeanContext getContext() {
> return context;
> }
>
> public void setContext(ActionBeanContext context) {
> this.context = context;
> }
>
> private Person person;
>
> public Person getPerson() {
> return person;
> }
>
> public void setPerson(Person person) {
> this.person = person;
> }
>
> public Resolution view() {
> return new ForwardResolution("test.jsp");
> }
>
> class Person {
> private String name = "nathan";
>
> public String getName() {
> return name;
> }
>
> public void setName(String name) {
> this.name = name;
> }
> }
> }
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's
> challenge
> Build the coolest Linux based applications with Moblin SDK & win great
> prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> Stripes-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/stripes-users
>
>
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Stripes-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-users