Re: Play Framework form data

31 views
Skip to first unread message
Message has been deleted

Greg Methvin

unread,
May 2, 2016, 12:40:33 PM5/2/16
to Monic, play-framework
Hi Monica,

This should probably be posted to the play-framework mailing list (added here). The play-framework-dev list is for discussing the development of the framework itself.

Also I'm not really clear on what the problem is. The forms library is for parsing form data. What are you using to produce the JSON there?

Greg

On Mon, May 2, 2016 at 4:30 AM, Monic <monica.ra...@minjar.com> wrote:
I have a form : 
public class Schedule{
public Long desiredInstances;

public Long desiredCapacity;

public TimeParam startTime;

public TimeParam stopTime;
}

TimeParam is another class:
public class TimeParam {
public List<String> minute = new ArrayList<String>();

public List<String> hour = new ArrayList<String>();

public List<String> month = new ArrayList<String>();

public String expression;
}


'Schedule' is a play form which accepts the values in entered in the form. When the other values are null, they are not the part of form data while sending. 
While if TimeParam.expression is null, then it is sending it in the data as:
 data: {
     "desiredInstances" :10,
     "startTime": {
"minute": ["55"], "hour": ["5"], "month": ["*"], "expression": null },
        "stopTime": {
		"minute": ["55"],
		"hour": ["5"],
		"month": ["*"],
		"expression": null
	}
    }

I am not getting why it is happening. All the my validation checks are in Schedule class.
Please help me to find the solution. 
Thanks


--
You received this message because you are subscribed to the Google Groups "Play framework dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to play-framework-...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Greg Methvin
Senior Software Engineer

Reply all
Reply to author
Forward
0 new messages