-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
More robust solution for form validation #179
Comments
Hey @hantsy, thanks for filing this issue and sorry for my delayed response. Regarding (1): I wonder if this is more a spec issues. I agree that MVC is more explicit about storing data in the model. I agree that the Spring MVC example is simpler. However, I'm not completely sure how something like this could work in the MVC 1.0 world. Regarding (2): Currently there are no plans for such enhancements. Perhaps you could have a look at MVC Toolbox which I created some time ago. It contains JSP tags for common functionality. Feedback welcome. :-) |
|
Hi, I wonder if we can just store the |
@erdlet Interesting idea. Or maybe |
This would be a possibility too. But it would need an API change, whereas the simple "put the binding result into the model" can be implemented relatively fast without it. Nevertheless, I think we should specifiy the behavior of this mechanism better, because at the moment it is relatively loose. @chkal When do you think are we able to extend the spec again? I'm afraid this has to wait until the migration to the EF? |
Yeah, I agree. Although AFAIK we could simply add
Which mechanism to you refer to exactly?
Good question. We already sent the initial contribution of the spec and TCK to the EF (see here and here). After getting the approval by the legal team, we can directly push the code to the GitHub repo. And actually we could start to work on the spec directly after that. Although we still have to decide how we want to continue. I guess it would make sense to first release MVC 2.0 with only the javax -> jakarta namespace update and without any additional changes. But all this is up to discussion. |
It would work, but I don't think a bypass of the spec is really good. It'd be more a hack than a good solution :/
The
+1 |
I could argue that this is simply extending the API provided by the spec. But as mentioned earlier, I'm not really sure if this is the way to go. :-)
OK, got it. TBH, I'm not sure if this is really required. IMO the binding result is primarily meant to be consumed by the controller which then can prepare the model in a way, that corresponding error messages can be displayed in the view. However, I agree that this requires some boilerplate code. But I guess we should discuss this on the new spec mailing list after the migration to EF has completed. |
I think that is the best idea :) |
In the Spring Web MVC there are some helpers to improve the form data binding and validation.
hasErrors(), getErrors()
inMvcContext
.The text was updated successfully, but these errors were encountered: