[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
Re: New update: User authentication, DB connection pool functionalities.
>> + */
>> +
>> +void UuServlet::init()
>> +{
>> +
>> + string strDsn = getServletConfig().getInitParameter("DSN");
>> + string strUid = getServletConfig().getInitParameter("UID");
>> + string strPwd = getServletConfig().getInitParameter("PWD");
>> + string strDb = getServletConfig().getInitParameter("DB");
>> + string strNumCon =
>> getServletConfig().getInitParameter("num_connections");
>> + string strTimeout = getServletConfig().getInitParameter("timeout");
>>
> Do you expect to provide these parameters for _each_ servlet?
> Do you plan to actually instantiate UuServlet? This is wrong.
> What you should do is
> 1. Use App-level parameters (these can be retrieved from ServletContext)
The problem is with saving those app-level parameters in context.
I tried to do it this way:
<app name="">
<parameter name="UID" value="sergey"/>
.....
</app>
but getInitParameter("UID") returns null in UuServlet::init().
Looks like it can be parsed only if it's under <servlet...> tag.
If it's not a bug, what's the appropriate syntax for app-level parameters
which are independent from servlets?
> 2. provide virtual uuInit() method, for derived servlets to override
> 3. call it from UuServlet::init()
> 4. Derived servlets should not override init(). (Not sure if there is a
> syntactic
> way of making sure of that)
>