RESTFul with ~46k!!!
FrontController
Use the annotation '@WebServlet(value = "/fc/*")' to indicate how your FrontController will be called by the browser, informing your reference parameter "value".
You need to extend the class HorusFrontController.
Your FrontController can be accessed by the url "http://localhost:8080/yourProject/fc/*"
If you have the desire to prepare a ExcelController to generate xls spreadsheets, use the template below, where the classes are in package "service.excel": In the example above, call our service layer through the url ""http://localhost:8080/yourProject/ec/*
MySQL
To connect to the MySQL database for example, use the notation "@HorusConnectionParameters" informing the authentication data.
See an example of connection below where getConnection() returns a valid connection and singleton.
You will request connection "HorusMySQLConnection".
Oracle
To connect to the Oracle database for example, use the notation "@HorusConnectionParameters" informing the authentication data.
See an example of connection below where getConnection() returns a valid connection and singleton.
You will request connection "HorusOracleConnection".
Service Layer
This layer will be accessed as indicated in our "FrontController" in this case the name of your package was created as a "service".
As an example implement a class called "ActorJSON", which extends the "ActorBO" class that holds all the business rule this screen.
The annotation "@HorusAccessId("33")" contains the key to access the service in question, and may be recovered in the Business layer, in this case the class ActorBO.
When we made a call to the GET, POST, PUT or DELETE type the url "http://localhost:8080/API/fc/Actor" their methods of this class are triggered
To generate an excel spreadsheet instead of json, use the method "HorusToXLS.getWriter.write" as the example of service below:
Business Layer
Here you put your entire business rule, and can count on the recovery annotation "@HorusAccessId" if it has been created in the service layer, as shown in the example below on line 15.
If you want to print a ResultSet or a string in JSON format, use the "HorusToJSON.getWriter.write()" method.