I had made a simple project on some person records, where I have to make a login page, and after that other things like add, delete, update operation and all. I have made, 2 to 3 form tag in a JSP. When my senior comes to review my code, he said, using more form tag is a bad idea. But I didn't get why and neither he told me. So pleas开发者_如何学Ce anyone can explain that. Specially what are the harms it may create.
There is nothing intrinsically wrong with using multiple forms in a single document.
It might be that, in your specific case, it would make more sense to use a single form to reduce duplication, but we can't say for sure as we don't know the specifics of what you did.
Nope, nothing wrong with them from an HTML perspective, and there are quite a few examples out there on how to do it:
JSP With Multiple Forms
Using Multiple Forms
In ASP.NET there is a potential problem in ASP.NET, which will only allow you to have one server-side form tag (with runat:server as attribute). Not sure if something similar/equivalent would hold for JSP.
精彩评论