在WEB.XML文件中设置参数:
下面的程序无法取出在WEB.XML中定义的参数firstparam的值firstparamvalue
My init parameter is <%= application.getInitParameter("firstparam") %>
下面的程序就可以取出在WEB.XML中定义的参数firstparam的值firstparamvalue
<%
String Str1;
Str1=config.getInitParameter("firstparam");
Out.println(Str1);
%>
因为config是类javax.servlet.ServletConfig的对象,而application 是类 javax.servlet.ServletContext的对象.
如果指定WebLogic SERVER的侦听端口为80,那么在IE中就不用输入端口
http://hostname/myfile.html取代http://hostname:portnumber/myfile.html.
以上就是JSP取得在WEB.XML中定义的参数的详细内容,更多请关注0133技术站其它相关文章!