----------------------------------------------------------------
BEFORE YOU POST, search the faq at <http://java.apache.org/faq/>
WHEN YOU POST, include all relevant version numbers, log files,
and configuration files. Don't make us guess your problem!!!
----------------------------------------------------------------
Hello
I got a problem with the initargs mechanism too. I use
Win95
Apache 1.3.9
JServ 1.1
My test servlet looks like this:
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class InitTest extends HttpServlet {
static String strInit;
public void init (ServletConfig conf) throws ServletException {
super.init(conf);
try {
strInit = conf.getInitParameter("init");
}
catch (Exception e) {
strInit = e.toString();
}
}
public void doGet(HttpServletRequest req, HttpServletResponse res) throws
ServletException, IOException {
// prepare output writer
res.setContentType("text/html");
PrintWriter out = res.getWriter();
out.println("<HTML>");
out.println("<HEAD><TITLE>InitTest</TITLE></HEAD>");
out.println("<BODY>");
out.println("Value of strInit:" + strInit);
out.println("</BODY>");
out.println("</HTML>");
}
}
and along with the servlet I put a file called InitTest.initArgs in the
same directory. It's contents look like:
[EMAIL PROTECTED]
The problem is, I never get the value of that parameter "init", I always
get null. Any suggestions ?
Martin
--
--------------------------------------------------------------
Please read the FAQ! <http://java.apache.org/faq/>
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Archives and Other: <http://java.apache.org/main/mail.html>
Problems?: [EMAIL PROTECTED]