I have a servlet that is trying to get inititalization parameters. I
have done all the doc says, but it doesn't get them. It gets null.
I am using tomcat 3.2.1 and jdk1.3.
My servlet is under
jakarta/webapps/DashboardDIG/Web-inf/classes/package.servlet.class
/web.xml
my web.xml has the following in it:
myServlet
package.myServlet
tcpip
127.0.0.1
port
5
1
myServlet
/myServlet
I have a context entry in the /conf/server.xml file:
My servlet has the following code to get the parameters:
public void init(ServletConfig config) throws ServletException
{
super.init(config);
log ( "Initializing AppletToDigServlet..." );
dbrdAddr = config.getServletContext().getInitParameter("tcpip");
temp = config.getInitParameter("port");
if (dbrdAddr == null)
{
log("error tcpip :" + dbrdAddr);
log("using default tcpip");
dbrdAddr = new String("127.0.0.1");
}
if (temp == null)
{
log("error port :" + temp);
log("using default port");
temp = new String("5");
}
dbrdPort = new Integer(temp);
}
I don't get any of the parameters. Please anyone, what am I doing
wrong?
I am calling the servlet from an applet with the following call:
URL url = new
URL(http://localhost:8080/DashboardDIG/servlet/package.myServlet);
URLConnection con = url.openConnection();
con.setUseCaches(false);
con.setRequestProperty("CONTENT_TYPE","application/octect-stream");
con.setDoInput(true);
I have tried calling it with
http://localhost:8080/DashboardDIG/myServlet but I get 404, not found.
http://localhost:8080/DashboardDIG/package.myServlet but I get 404.
I don't think the mapping is working, and that's maybe the problem.
Please help,
Karina
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]