Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    After Upload Excelfile cant go back?

    Hi,
    The task is to upload an excelfile and perform some operation with it. It is not necessary to store the file in DB, just use POI to read cells and do logic.

    I followed the sample for upload files and yes, i can save the exelfile in DB.

    Next I tried to create a Servlet and define an action to the form. With submitform i can call the servlet and do my logic. BUT: How can I go back to my app?? the creen went just blank. Is this way preferable or is any other solution path available?

    Thx again

    #2
    Hello family.labrador@outlook.com,

    I call my (Logout-)Servlet like this:
    Code:
    public static void logUserOut() {
    	RPCRequest logUserOutRequest = new RPCRequest();
    	logUserOutRequest.setActionURL("ServletLogout");
    	RPCManager.sendRequest(logUserOutRequest, new RPCCallback() {
    		public void execute(RPCResponse response, Object rawData, RPCRequest request) {
    			// Window.Location.reload();
    			Location.assign(GWT.getHostPageBaseURL() + Location.getQueryString());
    		}
    	});
    }
    You should be able to do anything in the servlet as well as in the CallBack. No page change should occur (if you do not do it in the CallBack as I do).

    Best regards,
    Blama

    Comment


      #3
      After Upload Excelfile cant go back?

      Hello Blama again,

      thx for your advice. However how can I pass the file? When I use your way I got
      Code:
       ... the request doesn't contain a multipart/form-data or multipart/mixed stream, content type header is application/x-www-form-urlencoded; charset=UTF-8 ...
      Thx and have a nice day

      EDIT:
      After setting the contenttype manually like
      Code:
      importRequest.setContentType("multipart/form-data");
      i can go further and I got
      Code:
      the request was rejected because no multipart boundary was found
      Something must be wrong with the request. Any ideas?


      Originally posted by Blama View Post
      Hello family.labrador@outlook.com,

      I call my (Logout-)Servlet like this:
      Code:
      public static void logUserOut() {
      	RPCRequest logUserOutRequest = new RPCRequest();
      	logUserOutRequest.setActionURL("ServletLogout");
      	RPCManager.sendRequest(logUserOutRequest, new RPCCallback() {
      		public void execute(RPCResponse response, Object rawData, RPCRequest request) {
      			// Window.Location.reload();
      			Location.assign(GWT.getHostPageBaseURL() + Location.getQueryString());
      		}
      	});
      }
      You should be able to do anything in the servlet as well as in the CallBack. No page change should occur (if you do not do it in the CallBack as I do).

      Best regards,
      Blama
      Last edited by family.labrador@outlook.com; 16 Oct 2014, 05:50.

      Comment

      Working...
      X