Java diary

⭕️Spring⭕️ A little summary of what I learned today!

Form tags that are common in JSP (view)! What is the model Attribute on the first line? .. ..

1<form:form modelAttribute="□□□">
2
3<p><form:input path="id" /></p>
4<p><form:input path="name" /></p>
5
6<input type="submit" value="Registration" />
7
8</form:form>

In the □□□ part, specify the Model name (the one with many setters and getters) that has the id and name sent in the 3rd and 4th lines! (It seems that the first letter should be lowercase)

Q: Isn't it different from the Model name if the first letter is lowercase?

A: For example, if the above Model name is MemberModel With the controller's doGET method

model.addAttribute("memberModel",new MemberModel());

Described as. (I can't explain it well, but it seems necessary because it has the id and name I want to use ...)

Because it uses the memberModel of the first argument of this

The value of modelAttribute of the form tag seems to have the same name as Model but the first letter is lowercase!

If you write something wrong, I would appreciate it if you could tell me.

Recommended Posts

Java diary
Java
Java
Java learning (0)
Studying Java ―― 3
[Java] array
Java protected
[Java] Annotation
Java array
Studying Java ―― 9
Java scratch scratch
java (constructor)
[Java] ArrayDeque
java (override)
java (method)
Java Day 2018
Java string
java (array)
Java static
java beginner 4
Studying Java ―― 4
Java (set)
java shellsort
[Java] compareTo
Studying Java -5
java reflexes
Java memorandum
☾ Java / Collection
Java array
Studying Java ―― 1
[Java] Array
[Java] Polymorphism
Studying Java # 0
Java review
java framework
[Java] Inheritance
FastScanner Java
java beginner 3
java (encapsulation)
Java inheritance
[Java] Overload
Java basics
Decompile Java
[Java] Annotation
java notes
java beginner
Java (add2)
JAVA (Map)
[java] interface
Java9 collection
Java basics
Java methods
Java inheritance
[Java] enum
[Java] FizzBuzzCounter
Studying Java ―― 8
Java array
Java (add)
Java method
Java (remove)
java serializable