How load servlet on index.jsp
问题 Is there is any way to call a servlet on index.jsp ? My welcome file is index.jsp . I need to populate dropdown list values by a servlet when index.jsp is opened. I tried to set <load-on-startup> in web.xml , but it didn't have any effect. How do I get the welcome file index.jsp to call the servlet? 回答1: Just change the welcome file URL to be the one of the servlet. Given this servlet mapping, <servlet-mapping> <servlet-name>indexServlet</servlet-name> <url-pattern>/index</url-pattern> <