SoFunction
Updated on 2025-04-07

JSP obtains the parameters defined in


Set parameters in the file:
<?xml version="1.0" encoding="ISO-8859-1"?> 
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "/dtd/web-app_2_3.dtd"> 
<web-app> 



<servlet> 
<servlet-name> myjsp </servlet-name> 
<jsp-file> / </jsp-file> 
<init-param> 
<param-name>firstparam</param-name> 
<param-value>firstparamvalue</param-value> 
</init-param> 
</servlet> 



<servlet-mapping> 
<servlet-name> myjsp </servlet-name> 
<url-pattern> /myurl/* </url-pattern> 
</servlet-mapping> 



</web-app> 



The following program cannot retrieve the value of the firstparam parameter defined in the firstparam value
<html> 
<HEAD><TITLE>my jsp page .jsp</TITLE></HEAD> 
My init parameter is <%= ("firstparam") %> 
</html> 



The following program can extract the value of the firstparam parameter defined in the firstparam value
<% 
String Str1; 
Str1=("firstparam"); 
(Str1); 
%> 



Because config is an object of the class, and application is an object of the class.
If the listening port of WebLogic SERVER is specified to be 80, then there is no need to enter the port in IE.
http://hostname/replace http://hostname:portnumber/.