I've no problem with such a change. Thats what we're having 2.0 for; and in
an OSGi environment such a feature definitely makes sense.

Would you like to provide an pull request for this idea? Would definitely
increase it's time to master. 2.0.0 should be released soon anyhow. For me
personally there is only one thing missing before we can get out with it.
So I would be ready once you are :-)

Thanks and kind regards,
Andreas


On Wed, Nov 7, 2012 at 7:30 AM, Jordi Deu-Pons <[email protected]> wrote:

> Thanks Andreas,
>
>  I've found another workaround that consists of using a servlet attribute
> to share this parameters with my application.
>
> Like this:
>
>  @Override
>  public WebApplication createApplication(WicketFilter filter) {
>
> filter.getFilterConfig().getServletContext().setAttribute("myparameter",
> some_value);
>         return new MyApplication();
>  }
>
> I've tried without luck to patch pax-wicket to create the cglib proxy
> using the instance returned by the IWebApplicationFactory. But maybe it
> would be better to add a onInstantiation method to the
> IWebApplicationFactory to let the factory initialize the application after
> the instantiation. And also to return a Class<? extends WebApplication>
> instead of a WebApplication. I known that this is an important change to
> the API, but I think that it's affordable on the new version 2.0.0
>
> Best regards,
>
>  Jordi
>
>
>
>
>
> On Wed, Nov 7, 2012 at 5:20 AM, Andreas Pieber <[email protected]> wrote:
>
>> well... yes there is, BUT it's kind of a mess (but maybe it does it's job
>> for you). You can configure context params if you're using the blueprint or
>> the spring method to configure your application factory there's also the
>> option to add context params:
>>
>> <xsd:element name="application">
>>     <xsd:complexType>
>>       <xsd:complexContent>
>>         <xsd:extension base="identifiedType">
>>           <xsd:sequence>
>>             <xsd:element ref="context-param" minOccurs="0"
>> maxOccurs="unbounded" />
>>           </xsd:sequence>
>>           <xsd:attribute name="class" type="xsd:string" use="required" />
>>           <xsd:attribute name="applicationName" type="xsd:string"
>> use="required" />
>>           <xsd:attribute name="mountPoint" type="xsd:string"
>> use="required" />
>>           <xsd:attribute name="injectionSource" type="xsd:string"
>>  use="optional"/>
>>         </xsd:extension>
>>       </xsd:complexContent>
>>     </xsd:complexType>
>>   </xsd:element>
>>
>>   <xsd:element name="context-param">
>>     <xsd:complexType>
>>       <xsd:sequence>
>>         <xsd:element minOccurs="1" maxOccurs="1" ref="param-name" />
>>         <xsd:element minOccurs="1" maxOccurs="1" ref="param-value" />
>>       </xsd:sequence>
>>     </xsd:complexType>
>>   </xsd:element>
>>
>> from there you can retrieve the init params via your servlet. Not the
>> most elegant solution but might do the job?
>>
>> Kind regards,
>> Andreas
>>
>>
>> On Wed, Nov 7, 2012 at 2:53 AM, Jordi Deu-Pons <[email protected]> wrote:
>>
>>> Hi,
>>>
>>>  I need to mount multiple instances of the same WebApplication in
>>> different mount points. I want to initialize each instance with a specific
>>> parameter.
>>>  I've tried to pass this parameter throw the constructor and then the
>>> IWebApplicationFactory returns the initialized instance. But I've realized
>>> that PaxWicketApplicationFactory instances it again using the class and the
>>> default constructor (see [PAXWICKET-230]).
>>>
>>>  So is there any other way to pass a parameter to the application when
>>> you are registering the IWebApplicationFactory?
>>>
>>>  Thanks!
>>>
>>> --
>>> a10! i fins aviat.
>>> J:-Deu
>>>
>>> _______________________________________________
>>> general mailing list
>>> [email protected]
>>> http://lists.ops4j.org/mailman/listinfo/general
>>>
>>>
>>
>> _______________________________________________
>> general mailing list
>> [email protected]
>> http://lists.ops4j.org/mailman/listinfo/general
>>
>>
>
>
> --
> a10! i fins aviat.
> J:-Deu
>
> _______________________________________________
> general mailing list
> [email protected]
> http://lists.ops4j.org/mailman/listinfo/general
>
>
_______________________________________________
general mailing list
[email protected]
http://lists.ops4j.org/mailman/listinfo/general

Reply via email to