java - Spring mvc request handling error (404) -


i new spring , try catch request using handler method. problem can not reach handler method.

@requestmapping(value = "/gsafeedrun", method = requestmethod.get) public modelandview handlerequest(@modelattribute baseformbean formbean, bindingresult result, httpservletrequest request) throws exception {     system.out.println("request grabbed!\n");     getcontext().getuserprofile().setlanguage(projectconstants.getlanguage_tr());     createsessiondata(request);     final java.io.file myfile = new java.io.file("c:\\devel\\xmlcollections.txt");     readcollectionofroots(myfile); //read list of desired root's lists file     return null; }  

i've checked servlet.xml file , seems ok. request localhost:8080/abc/gsafeedrun never answered , displays on console:

 

***error... page-not-found.jsp - 404 - /abc/gsafeedrun 

i need clarify there no need return model view user. controller supposed calculations.

 

what reason of problem?

is not possible send null.

the following return types supported handler methods:

a modelandview object (servlet mvc or portlet mvc), model implicitly enriched command objects , results of @modelattribute annotated reference data accessor methods.

a model object, view name implicitly determined through requesttoviewnametranslator , model implicitly enriched command objects , results of @modelattribute annotated reference data accessor methods.

a map object exposing model, view name implicitly determined through requesttoviewnametranslator , model implicitly enriched command objects , results of @modelattribute annotated reference data accessor methods.

a view object, model implicitly determined through command objects , @modelattribute annotated reference data accessor methods. handler method may programmatically enrich model declaring model argument (see above).

a string value interpreted view name, model implicitly determined through command objects , @modelattribute annotated reference data accessor methods. handler method may programmatically enrich model declaring modelmap argument (see above).

@responsebody annotated methods (servlet-only) access servlet response http contents. return value converted response stream using message converters.

an httpentity or responseentity object (servlet-only) access servlet response http headers , contents. entity body converted response stream using message converters.

an httpheaders object return response no body.

a callable used spring mvc obtain return value asynchronously in separate thread transparently managed spring mvc on behalf of application.

a deferredresult application uses produce return value in separate thread of own choosing, alternative returning callable.

a listenablefuture application uses produce return value in separate thread of own choosing, alternative returning callable. void if method handles response (by writing response content directly, declaring argument of type servletresponse / httpservletresponse / renderresponse purpose) or if view name supposed implicitly determined through requesttoviewnametranslator (not declaring response argument in handler method signature; applicable in servlet environment).

any other return type considered single model attribute exposed view, using attribute name specified through @modelattribute @ method level (or default attribute name based on return type's class name otherwise). model implicitly enriched command objects , results of @modelattribute annotated reference data accessor methods.

from documentation: requestmapping


Comments