Phase 3b: Registration controller migration (Spring Boot)#12
Merged
cogjack merged 1 commit intodevin/1771291744-spring-boot-migration-phase1-2from Feb 17, 2026
Conversation
- RegistrationForm POJO with Bean Validation (@notblank, @Email) - @PasswordMatch custom annotation and PasswordMatchValidator for cross-field password validation - RegistrationController with GET /editRegistration and POST /saveRegistration - Handles Create (new user) and Edit (existing user) actions - Minimal registration.html Thymeleaf template - Comprehensive tests: RegistrationFormTest, PasswordMatchValidatorTest, RegistrationControllerTest - All 110 tests pass Co-Authored-By: Jack Meigel <jack.meigel@cognition.ai>
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Phase 3b: Registration Controller Migration
Summary
Migrates
EditRegistrationActionandSaveRegistrationActionfrom Struts 1.x to a Spring MVCRegistrationController, as part of thestruts-faces-example2Spring Boot migration. ConvertsRegistrationFormfrom aValidatorFormsubclass to a plain POJO with JSR-380 Bean Validation, and introduces a custom@PasswordMatchcross-field constraint.New files:
form/RegistrationForm.java— POJO with@NotBlank,@Email,@PasswordMatchvalidation/PasswordMatch.java+PasswordMatchValidator.java— custom class-level constraint for password confirmationcontroller/RegistrationController.java—GET /editRegistration(form prep) +POST /saveRegistration(validate & persist)templates/registration.html— minimal Thymeleaf template (unblocks controller tests; full UI is Phase 4)RegistrationFormTest.java,PasswordMatchValidatorTest.java,RegistrationControllerTest.javaAll 110 tests pass (13 form + 7 validator + 13 controller + existing 77).
Review & Testing Checklist for Human
RegistrationControllerTestmutates the shared in-memoryUserDatabase(e.g.,createNewUserWithValidDatacreates "newuser",editExistingUserWithValidDatachanges the "user" object's fields). There is no@DirtiesContextor per-test reset, so test ordering could cause flaky failures. Verify this doesn't bite in CI or when new tests are added.SaveRegistrationActionhadisTokenValid/resetToken/saveToken(CSRF-like) andisCancelledchecks. These are absent from the new controller. Spring's built-in CSRF support may cover the token case, but confirm this is acceptable for the migration.saveRegistration, password-required checks only run foraction="Create". Foraction="Edit", the@PasswordMatchvalidator allows both-null or both-empty, and the controller preserves the old password if the new one is empty. Verify this matches the original Struts behavior and handles edge cases (e.g., one password field empty, the other not).@Validruns. If other fields have validation errors, the duplicate check still fires and adds another error. This is probably fine but differs slightly from Struts' ordering.Notes
devin/1771291744-spring-boot-migration-phase1-2(Phase 1 & 2 base).registration.htmltemplate is a minimal placeholder to unblock tests. Full Thymeleaf UI work is Phase 4.