www-apache-bugdb mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Enrique Ortiz <enrique.ortiz.torr...@europe.eds.com>
Subject mod_jserv/7507: when i call getInitParameter in the Httpservlet init method, always returns null
Date Tue, 03 Apr 2001 16:12:04 GMT

>Number:         7507
>Category:       mod_jserv
>Synopsis:       when i call getInitParameter in the Httpservlet init method, always returns
null
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    jserv
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   apache
>Arrival-Date:   Tue Apr 03 09:20:01 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     enrique.ortiz.torrent@europe.eds.com
>Release:        1.3.14
>Organization:
apache
>Environment:
linux mandrake 7.2
Linux tc75050.tecno.es 2.2.17-21mdk #1 Thu Oct 5 13:16:08 CEST 2000 i686 unknown
apache + jserv 1.1.2 using IBM jdk 1.1.8 
>Description:
import java.io.*;
import java.lang.*;
import javax.servlet.*;
import javax.servlet.http.*;
import java.sql.*;
import oracle.jdbc.driver.*;

public class listArgs extends HttpServlet
{
  java.lang.String OracleUser = null;
  java.lang.String OraclePsw = null;
  	
public void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException,
IOException
{
	try {   
	res.setContentType("text/html");
	PrintWriter os = res.getWriter();
	os.println("<html>");
	os.println("<head><title>Error</title></head>");
	os.println("<body>");
	os.println("<hr>");
	os.println("<h2> "+ OracleUser+"</h2>");  // ---> null
	os.println("<h2> "+ OraclePsw+"</h2>");   // ---> null 
	os.println("<hr>");
	os.println("<h2> "+getInitParameter("OracleUser") +"</h2>"); // ---> value

	os.println("<h2> "+getInitParameter("OraclePsw") +"</h2>"); // ---> value
	os.println("<hr>");
	os.println("</body></html>");
	os.flush();

	} catch (Exception e)
	{
		System.out.println(e.getMessage());
	}
}


public void init(ServletConfig config) throws ServletException
{
	super.init(config);
	java.lang.String OracleUser = getServletConfig().getInitParameter("OracleUser"); 
	java.lang.String OraclePswd = getServletConfig().getInitParameter("OraclePsw");
}

>How-To-Repeat:
import java.io.*;
import java.lang.*;
import javax.servlet.*;
import javax.servlet.http.*;
import java.sql.*;
import oracle.jdbc.driver.*;

public class listArgs extends HttpServlet
{
  java.lang.String OracleUser = null;
  java.lang.String OraclePsw = null;
  	
public void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException,
IOException
{
	try {   
	res.setContentType("text/html");
	PrintWriter os = res.getWriter();
	os.println("<html>");
	os.println("<head><title>Error</title></head>");
	os.println("<body>");
	os.println("<hr>");
	os.println("<h2> "+ OracleUser+"</h2>");  // ---> null
	os.println("<h2> "+ OraclePsw+"</h2>");   // ---> null 
	os.println("<hr>");
	os.println("<h2> "+getInitParameter("OracleUser") +"</h2>"); // ---> value

	os.println("<h2> "+getInitParameter("OraclePsw") +"</h2>"); // ---> value
	os.println("<hr>");
	os.println("</body></html>");
	os.flush();

	} catch (Exception e)
	{
		System.out.println(e.getMessage());
	}
}


public void init(ServletConfig config) throws ServletException
{
	super.init(config);
	java.lang.String OracleUser = getServletConfig().getInitParameter("OracleUser"); 
	java.lang.String OraclePswd = getServletConfig().getInitParameter("OraclePsw");
}

>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:
 [In order for any reply to be added to the PR database, you need]
 [to include <apbugs@Apache.Org> in the Cc line and make sure the]
 [subject line starts with the report component and number, with ]
 [or without any 'Re:' prefixes (such as "general/1098:" or      ]
 ["Re: general/1098:").  If the subject doesn't match this       ]
 [pattern, your message will be misfiled and ignored.  The       ]
 ["apbugs" address is not added to the Cc line of messages from  ]
 [the database automatically because of the potential for mail   ]
 [loops.  If you do not include this Cc, your reply may be ig-   ]
 [nored unless you are responding to an explicit request from a  ]
 [developer.  Reply only with text; DO NOT SEND ATTACHMENTS!     ]
 
 


Mime
View raw message