----------------------------------------------------------------
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!!!
----------------------------------------------------------------

I've also seen problems using the proscribed syntax for passing initArgs to
servlets, which I can only assume are bugs.  (which version of JServ are you
using?).  If possible, you might try this syntax, which I've had better luck
with:

servlets.default.initArgs=initArgs=testing=Success!

note that that's servlets not servlet.

Obviously, this doesn't work if you need different values for different
servlets...

jae

> -----Original Message-----
> From: Matthew Smith [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, August 03, 2000 3:57 PM
> To: Jserv List (E-mail)
> Subject: initargs not being passed
> 
>     I can't get any servlet to recieve an initarg.  I'm 
> almost positive the
> problem is not in the servlets or the lines passing the 
> initargs in the
> zone.properties files, but I'll include a copy of that stuff 
> anyways.  This
> is really haulting my work, and I'd really appretiate anyone 
> who could clear
> it up.
> 
> Thanks,
> Matt
> 
>       This is for testing.  The output from the InitHello 
> class is "Here's the
> initarg: null".
> 
> # A line from my zone.properties file:
> servlet.InitHello.initArgs=testing=Success!
> 
> // And here's my InitHello.java
> import java.io.*;
> import java.util.*;
> import javax.servlet.*;
> import javax.servlet.http.*;
> 
> public class InitHello extends HttpServlet
> {
>     String initpass;
> 
>     public void init(ServletConfig config)
>         throws ServletException
>     {
>         super.init(config);
>         initpass = getInitParameter("testing");
>     }
> 
>     public void doGet (HttpServletRequest request,
>                        HttpServletResponse response)
>         throws ServletException, IOException
>         {
>             PrintWriter out;
>             // set content type and other response header fields first
>             response.setContentType("text/html");
>             // then write the data of the response
>             out = response.getWriter();
>             out.println("<HTML><HEAD><TITLE>");
>             out.println("Servlet InitArg Test");
>             out.println("</TITLE></HEAD><BODY bgcolor=\"#FFFFFF\">");
>             out.println("<H1>Here's the initarg: " + initpass 
> + "</H1>");
>             out.println("</BODY></HTML>");
>             out.close();
>         }
> }
> 
> // End of InitHello.java
> 
> 
> 
> --



--
--------------------------------------------------------------
Please read the FAQ! <http://java.apache.org/faq/>
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Search Archives: 
<http://www.mail-archive.com/java-apache-users%40list.working-dogs.com/>
Problems?:           [EMAIL PROTECTED]

Reply via email to