This week's book giveaway is in the OCMJEA forum. We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line! See this thread for details.
I'm new to DWR, having used it for the first time just last week. I'm curious about what effect using DWR to validate a field on a form would have for a controller validator (Spring MVC). If I know that DWR has validated a field's value before being submitted, do you think there is still a need to use a validator class? I'm thinking if a form's values are validated by DWR before a form is submitted, there's no need for the validator.
Well, DWR in and of itself can't validate anything, so I'd say the implications of Spring make that assumption is, well, pretty bad for security! LOL
Also, since DWR makes calls through it's own servlet, I don't even think they would coexist in the sense that you couldn't use DWR to call through to Spring MVC because, as I recall, Spring MVC has it's own servlet, so it'd be like two competing controllers, which usually doesn't work.
Brian E Smith
Joined: Mar 29, 2002
I added the DWR entries to my web.xml, in addition to the entries for my DispatcherServlet. In dwr.xml, I described the object (which I named DWRLogonValidator) that I wanted my JSP to use to validate the individual fields on the form. In the JSP, I added the .js includes that DWR generates. It "works" as I think it should, and this mean that the data has to pass my DWR validator before I actually submit the form to the controller. So I guess my DWR validator doesn't necessarily have to supercede or make obsolete my Spring validator; I suppose they could complement each other.