On the method where you would normally process the submission you place this code at the top of the procedure: These are imported into the main control file SpringBootAppNameCtrl.java: Once your Spring Boot is now no longer headless it is able to accept the import and use of AWT libraries. This requires you to use the SpringApplicationBuilder.class instead of SpringApplication.class. To make the change necessary you need to edit the auto-generated SpringBootAppNameApplication.java file to set the headless property to false. ![]() Fortunately, there was this blog post to help show the way: I've read some literature on why headless apps are better but I need those functions so I have to set my app as a non-headless. This means it does not need a GUI to run the app. Seems legit but one thing if you set up the code to do what you want it will (: null at) fail because Spring Boot by default is set to run as a "headless app". At first I thought (with revulsion) I would have to write some Javascript that is executed when the submission occurs but the more obvious solution is to import Java AWT (Abstract Window Toolkit), a library of classes you can utilize for "creating user interfaces and for painting graphics and images." I wanted to have pop-up messages to appear in the browser window to add a second opportunity for the user to cancel out of their submission.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |