So I'm trying to do a simple web-app using the default stuff (Tomcat, no framework).
What I want is after I start server, I want my application to create a "Sample.txt" file in my server using a "SetUpDataService.class". Is there a way to do that?
Im thinking creating a "SetUpServlet" without mapping and just call the "SetUpDataService.class" in the init method, but it looks so dirty and feels wrong.
What is the best way for that using the default stuff? And is there a library exists for that purpose? Currently im not using any 3rd party library to strengthen my core understanding of JavaEE.
PS. I dont know if this question exists.I just cant find the right keyword so I posted this question.
EDIT: How about creating initial data on database? Is the approach OK?
Aucun commentaire:
Enregistrer un commentaire