Since all form tags confirm the binding, a binding error will occur if there is no link with the Model data (in the path attribute).
Most classes use the resolveId method, and when converted to HTML, the value associated with path is automatically set in the id attribute.
If you do not want to set id (such as not wanting to use it in JavaScript etc.), you can avoid automatic setting by overriding resolveId and returning null if it is not set.
We cannot recommend it, but if you have no choice but to output it as it is, do not use TagWriter.
When extending by inheriting Spring tag, use this because it has PageContext in the field of parent class.
this.pageContext.getOut().print("letter")
You can output as it is by writing directly from JspWriter.
If you want to get the request, you can get it from pageContext.
After creating the extension tag, specify the target class with the full path including the package in the tld file. (When creating a new tld file, place it under WEB-INF.)
By specifying the tld declaration (taglib) in the JSP to be used, the extension tag can be used in that JSP.
I am currently participating in a project for migration from struts to spring (finished this month), but I had a lot of FW differences, so I summarized it. This may stop writing Java for the time being
Have a good coding life!
Recommended Posts