Michael Lee wrote:
> I can't seem to retrieve the data from the alias request initargs
> parameter....
>
> ie.
> # Setting servlet alias
> servlet.start.code=Hello
> # setting servlet alias init args (ie. query String)
> servlet.start.initArgs=message="I say hello world to
> everyone"
>
> how do I collect the query string ..... I try request.getQueryString()
>
> It only returned a null...
>
> Am I doing something wrong.....
>
The servlet initialization arguments are not passed with each request ...
they are passed to the init() method of your servlet the very first time
it is loaded. To retrieve them, you could do something like this in your
service() or doGet() method:
String message = getServletConfig().getInitParameter("message");
If you override the init() method yourself, be sure to call
super.init(config) so that the base class stuff gets initialized as well.
It sounds like you might also want to review a tutorial on how servlets
work. A good place to go is the Java Language Tutorial on JavaSoft's web
site (www.javasoft.com), which includes a very nice trail on using
servlets.
>
> mike
>
Craig
----------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Archives and Other: <http://java.apache.org/main/mail.html/>
Problems?: [EMAIL PROTECTED]