Girish Wadhwani wrote:
> Hi,
> I am using servletrunner (on NT) to run my servlet and my servlet
> can't seem to access extenal resourcs.I am trying to open a file which
> is in the same default directory .\examples\ as my servlet and for some
> reason it cannot open the file,I get an exception.
>
Use a complete path to the file. The servlet engine's current working
directory is not where your servlets are, so relative references are not going
to work.
> I am also not able to pass any init parameters to my servlet. I
> have pasted my servlet.properties file below. My servlet- MainServlet
> does not recieve any parameters when I call config.getInitParameter().
> Your help is very much appreciated.
>
> - GIrish Wadhwani
>
> # @(#)servlets.properties 1.86 97/11/14
> #
> # Servlets Properties
> #
> # servlet.<name>.code=class name (foo or foo.class)
> # servlet.<name>.initArgs=comma-delimited list of {name, value} pairs
> # that can be accessed by the servlet using the
> # servlet API calls
> #
>
> # session servlet
> servlet.session.code=SessionServlet
>
> # simple servlet
> servlet.simpleservlet.code=SimpleServlet
>
> # snoop servlet
> servlet.snoop.code=SnoopServlet
>
> # survey servlet
> servlet.survey.code=SurveyServlet
> servlet.survey.initArgs=\
> resultsDir=\tmp
>
> #Mainservlet
> servlet.main.code=MainServlet
> servlet.main.initArgs=\
> passwordFile=group.names\
> sessionFile=group.session
>
You need a comma after "group.names" and before the backslash in the next to
last line.
Use config.getInitParameterNames() to make sure that you got no entries at
all.
Craig McClanahan
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html