jsp - URL pattern mapping -


i have jsp url pattern /data/viewableimage.jsp

is there way in url pattern have jsp called if user not include .jsp part of url?

so if navigate /data/viewableimage page still called?

thanks

if put jsp pages in common path /web-inf users won't able request jsp pages , can use servlet add jsp extension.

<servlet>     <servlet-name>data</servlet-name>     <servlet-class>com.mypackage.jspaggregationservlet</servlet-class> </servlet> <servlet-mapping>     <servlet-name>data</servlet-name>     <url-pattern>/data/*</url-pattern> </servlet-mapping> 

the jspaggregationservlet servlet have forward request jsp page including en .jsp extension.

request.getrequestdispatcher("/web-inf" + request.getpathinfo() + ".jsp").forward(request, response); 

example:

request /data/car/search response: /data/car/search.jsp 

Comments

Popular posts from this blog

c# - Unity IoC Lifetime per HttpRequest for UserStore -

Change the color of an oval at click in Java AWT -

I am trying to solve the error message 'incompatible ranks 0 and 1 in assignment' in a fortran 95 program. -