August 2018
Intermediate to advanced
314 pages
8h 9m
English
Here, we have the implementation of DownloadApplicationController, which is responsible for deciding the correct command to send the request. The process for deciding the correct command can be carried out in several ways, with reflections and annotations, using switch cases and maps, among others. In our example, we use a map to help us:
import com.rhuan.action.Command.AbstractCommand;import com.rhuan.action.Command.PdfCommand;import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;import javax.servlet.ServletException;import javax.servlet.http.HttpServletRequest;import javax.servlet.http.HttpServletResponse;import java.io.IOException;import java.util.HashMap;import java.util.Map ...
Read now
Unlock full access