java - render the param-value of the web.xml in the initpage.jps file -
i trying render para-value using configuration in web.xml file in web-inf directory getting the default user servlet config is:
rendered (without parm value of web.xml file). can explain me error is?
initpage.jps
<%@ page language="java" contenttype="text/html; charset=iso-8859-1" pageencoding="iso-8859-1"%> <!doctype html public "-//w3c//dtd html 4.01 transitional//en" "http://www.w3.org/tr/html4/loose.dtd"> <html> <head> <meta http-equiv="content-type" content="text/html; charset=iso-8859-1"> <title>insert title here</title> </head> <body> default user servlet config is: <%getservletconfig().getinitparameter("defaultuser");%> </body> </html>
web.xml
<?xml version="1.0" encoding="utf-8"?> <web-app xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemalocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="webapp_id" version="3.0"> <display-name>simpleservletproject</display-name> <welcome-file-list> <welcome-file>index.html</welcome-file> </welcome-file-list> <servlet> <servlet-name>initjsp</servlet-name> <jsp-file>/initpage.jsp</jsp-file> <init-param> <param-name>defaultuser</param-name> <param-value>default user name</param-value> </init-param> </servlet> <servlet-mapping> <servlet-name>initjsp</servlet-name> <url-pattern>initpage.jsp</url-pattern> </servlet-mapping> </web-app>
Comments
Post a Comment