I want to debug a program by using system.out.println() and what to
check the flow and variables value in eclipse while running a JIRA
plugin which is a Servlet .
When I make some changes to the code in eclipse it reflects on the
browser but when I use system.out.println where should i see the
output ?
Example Code :
@RequiresXsrfCheck
protected String doExecute()
{
LOG.info("BulkCloneDetails doExecute start...");
filterUrl = null;
cloneSubTasks = false;
cloneAttachments = false;
deleteAfterClone = false;
requestId = null;
issues = null;
getServerInfoFromPage();
**System.out.println("Print something here");**
errorsCollection.put("filterPath", i18n.getText("Remote login failed"));
addErrors(errorsCollection);
return SUCCESS;
}
You can put a tail on a file in Terminal so that you can see how it is interacted with. On a webapp I am working on I use the below method.
Then type
This will then print to your Terminal window. I have had to use this method on a few projects. I advise you to use
system.out.println("Name of the File I am printing from")so that if you have several of such then you will know where they are coming from and in what order.