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 <anpie...@gmail.com> 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 <jo...@jordeu.net> 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
>> general@lists.ops4j.org
>> http://lists.ops4j.org/mailman/listinfo/general
>>
>>
>
> _______________________________________________
> general mailing list
> general@lists.ops4j.org
> http://lists.ops4j.org/mailman/listinfo/general
>
>


-- 
a10! i fins aviat.
J:-Deu
_______________________________________________
general mailing list
general@lists.ops4j.org
http://lists.ops4j.org/mailman/listinfo/general

Reply via email to