tomcat - sendRedirect not working -
i'm trying redirect different page. i've tried locally on machine using jetty , redirect works correctly. if deploy war file tomcat , try redirect page error.
http status 500 - file "/web-inf/jsp/.jsp" not found javax.servlet.servletexception: file "/web-inf/jsp/.jsp" not found org.apache.jasper.servlet.jspservlet.handlemissingresource(jspservlet.java:412) org.apache.jasper.servlet.jspservlet.servicejspfile(jspservlet.java:379) org.apache.jasper.servlet.jspservlet.service(jspservlet.java:334) javax.servlet.http.httpservlet.service(httpservlet.java:728) org.springframework.web.servlet.view.internalresourceview.rendermergedoutputmodel(internalresourceview.java:229) org.springframework.web.servlet.view.abstractview.render(abstractview.java:250) org.springframework.web.servlet.dispatcherservlet.render(dispatcherservlet.java:1047) org.springframework.web.servlet.dispatcherservlet.dodispatch(dispatcherservlet.java:817) org.springframework.web.servlet.dispatcherservlet.doservice(dispatcherservlet.java:719) org.springframework.web.servlet.frameworkservlet.processrequest(frameworkservlet.java:669) org.springframework.web.servlet.frameworkservlet.dopost(frameworkservlet.java:585) javax.servlet.http.httpservlet.service(httpservlet.java:647) javax.servlet.http.httpservlet.service(httpservlet.java:728)
i'm not sure why not putting file name in "web-inf/jsp/.jsp".
here java code sends redirect.
@requestmapping(value="/surescriptstart", method=requestmethod.post) public modelandview surescripttes2t(surescripts pro,httpservletresponse response , httpservletrequest request) throws ioexception, servletexception{ if(verifysurescripts){ .... message = "you done!"; response.sendredirect("done.html"); }else{ response.sendredirect("surescriptstart.html"); } ....
here part of servlet.xml
<bean id="viewresolver" class="org.springframework.web.servlet.view.urlbasedviewresolver"> <property name="viewclass" value="org.springframework.web.servlet.view.jstlview" /> <property name="prefix" value="/web-inf/jsp/" /> <property name="suffix" value=".jsp" /> </bean>
what return method surescripttes2t? must have returned empty view name, spring mvc try resolve jsp @ /web-inf/jsp/.jsp instead of sending 302 redirect.
if need redirection, try make void:
public void surescripttes2t
Comments
Post a Comment