== HVP pilot add functionality (build servlet in molgenis) ==
In order to proper present your data from a javascript call (in a plugin) you need a servlet :
1. Add in model the function :
* * public String getCustomHtmlHeaders()
* {
* return "\n" +
* "\n" ;
*
* }
1. Place the javascript file in the referred location. In the ftl file call the function as onclick="!RestJsonDatafromOntocat(InputTerm)" not as onclick="!__action.value='SubmitTerm' . The second is used for function inside the model.
* Arguments from the .ftl file can be reached through arguments
1. Add in web.xml the declaration of the servlet
*
* AddEventMenuServlet
* servlets.[wiki:AddEventMenuServlet]
*
* AddEventMenuServlet
* /AddEventMenuServlet
*
1. Create directory & file for servlet ( /hvp_pilot/handwritten/java/servlets/SearchJsonServlet.java )
1. Incude the necessary :
* * package servlets;
*
* import java.io.IOException;
* import java.io.!PrintWriter;
*
* import javax.servlet.!ServletException;
* import javax.servlet.http.!HttpServletRequest;
* import javax.servlet.http.!HttpServletResponse;
*
* import org.apache.log4j.Logger;
* import org.molgenis.util.!HttpServletRequestTuple;
* import org.molgenis.util.Tuple;
* '''__IS this the minimum/optimal set???__'''
1. What about throws !ServletException, IOException....?
1. What about doGet & doPost? http://www.molgenis.org/browser/molgenis2_test/src/handwritten/RESTServlet.java?rev=1473