java - Accesing spring boot REST service in glasfish -


did following tutorial https://spring.io/guides/gs/uploading-files/ want able deploy glassfish 4.1. problem cannot exposed rest service

my application class:

package de.awinta.kti.cms;  import org.springframework.boot.springapplication; import org.springframework.boot.autoconfigure.springbootapplication; import org.springframework.boot.builder.springapplicationbuilder; import org.springframework.boot.web.support.springbootservletinitializer;  @springbootapplication public class application extends springbootservletinitializer {      public static void main(string[] args) {         springapplication.run(application.class, args);     }      @override     protected springapplicationbuilder configure(springapplicationbuilder application) {         return application.sources(application.class);     }   } 

my restcontroller:

@restcontroller @requestmapping("/files") public class fileuploadcontroller {      //private final storageservice storageservice;      @autowired     public fileuploadcontroller() {        // this.storageservice = storageservice;     }      @requestmapping("/upload")     public string handlefileupload(@requestparam("file") multipartfile file,                                    redirectattributes redirectattributes) {          //storageservice.store(file);         //redirectattributes.addflashattribute("message",           //      "you uploaded " + file.getoriginalfilename() + "!");          system.out.println("file uplaoded succesfully");          return "asda";     }      @exceptionhandler(exception.class)     public responseentity handlestoragefilenotfound(exception exc) {         return responseentity.notfound().build();     }  } 

any ideas?


Comments

Popular posts from this blog

php - How to add and update images or image url in Volusion using Volusion API -

javascript - jQuery UI Splitter/Resizable for unlimited amount of columns -

javascript - IE9 error '$'is not defined -