How to handle Java URL mappings that are too many to write by hand -
for example, have many city bus lines in database. , wrote page called citybus.jsp display city has bus line. must write url mappings many cities. see below:
<servlet> <servlet-name>citybusservlet</servlet-name> <servlet-class>com.jiaotong.loginservlet</servlet-class> </servlet> <servlet-mapping> <servlet-name>citybusservlet</servlet-name> <url-pattern>/chicago</url-pattern> </servlet-mapping> ------------------------------------------------------------------------- <servlet> <servlet-name>citybusservlet</servlet-name> <servlet-class>com.jiaotong.citybusservlet</servlet-class> </servlet> <servlet-mapping> <servlet-name>citybusservlet</servlet-name> <url-pattern>/paris</url-pattern> </servlet-mapping>
and on ...
if write every cities mappings hand not beyond tether, write page having information of every city bus lines , write url mapping impossible. because bus lines of different cities many.
so want know if these method avoid writing url mapping hand.
try using use jax-rs implemention or spring.
you won;t need map specific urls java classes in servlet mapping file.
you include in class itself.
Comments
Post a Comment