I would like to ask where and how I can create an auto-generated item code (similar to primary key with auto-increment) for my form in JSP. As seen in this image >
I need to display the item codes on the screen even before inputting them into mySQL database (e.g. IGA01, IGA02, IGA03). Every time the user clicks the 'add row' button, a row is added and the item code should increment by 1. I'm using MVC to create my java web application...I'm somewhat lost where and how I should create this function (Should the generation function be done in JSP,servlet, or at the model classes?)