diff --git a/thymeleaf-spring5/src/main/java/org/thymeleaf/spring5/processor/SpringValueTagProcessor.java b/thymeleaf-spring5/src/main/java/org/thymeleaf/spring5/processor/SpringValueTagProcessor.java index 7e779fa5..3759e95d 100644 --- a/thymeleaf-spring5/src/main/java/org/thymeleaf/spring5/processor/SpringValueTagProcessor.java +++ b/thymeleaf-spring5/src/main/java/org/thymeleaf/spring5/processor/SpringValueTagProcessor.java @@ -100,7 +100,10 @@ protected final void doProcess( // We will need to know the 'name' and 'type' attribute values in order to (potentially) modify the 'value' final String nameValue = tag.getAttributeValue(this.nameAttributeDefinition.getAttributeName()); - final String typeValue = tag.getAttributeValue(this.typeAttributeDefinition.getAttributeName()); + String typeValue = tag.getAttributeValue(this.typeAttributeDefinition.getAttributeName()); + if (typeValue == null) { + typeValue = tag.getElementCompleteName(); + } newAttributeValue = RequestDataValueProcessorUtils.processFormFieldValue(context, nameValue, newAttributeValue, typeValue); diff --git a/thymeleaf-spring6/src/main/java/org/thymeleaf/spring6/processor/SpringValueTagProcessor.java b/thymeleaf-spring6/src/main/java/org/thymeleaf/spring6/processor/SpringValueTagProcessor.java index 1b77fae8..55f4d73f 100644 --- a/thymeleaf-spring6/src/main/java/org/thymeleaf/spring6/processor/SpringValueTagProcessor.java +++ b/thymeleaf-spring6/src/main/java/org/thymeleaf/spring6/processor/SpringValueTagProcessor.java @@ -100,7 +100,10 @@ protected final void doProcess( // We will need to know the 'name' and 'type' attribute values in order to (potentially) modify the 'value' final String nameValue = tag.getAttributeValue(this.nameAttributeDefinition.getAttributeName()); - final String typeValue = tag.getAttributeValue(this.typeAttributeDefinition.getAttributeName()); + String typeValue = tag.getAttributeValue(this.typeAttributeDefinition.getAttributeName()); + if (typeValue == null) { + typeValue = tag.getElementCompleteName(); + } newAttributeValue = RequestDataValueProcessorUtils.processFormFieldValue(context, nameValue, newAttributeValue, typeValue);