1. 程式人生 > >Servlet知識點總結

Servlet知識點總結

@WebServlet( name = "UserServlet", //servlet名稱

urlPatterns = { "/user" }, //url

loadOnStartup = 1, //啟動項

initParams = { @WebInitParam(name = "username", value = "張三") }

)

(2)在web.xml中配置

<init-param> <param-name>user</param-name> <param-value>db2admin</param-value> </
init-param>