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
Post a Comment