I have a form submission to a servlet with a doGet() method. What I need is to pass an id to the servlet via doGet() and retrieve it in that method.
What I tried so far: adding an id as a query string and using request.getParameter() in the doGet. I am using this same method in doPost() and its working.
client side code
downloadPanel = new FormPanel();
downloadPanel.setEncoding(FormPanel.ENCODING_MULTIPART);
downloadPanel.setMethod(FormPanel.METHOD_GET);
downloadPanel.setAction(GWT.getModuleBaseURL()+"downloadfile" + "?entityId="+ 101);
downloadPanel.submit();
server side servlet
public class FileDownload extends HttpServlet {
private String entityId;
public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
entityId = request.getParameter("entityId");
entityId is null. How can i pass an Id to the doGet() request? As for looking at examples online this should work as it works for the doPost() as is. Thanks as i am stumped