On Tue, Sep 20, 2022 at 4:16 PM vahid ghasemi <vahidghasemi...@gmail.com>
wrote:

> I don't want to be available always. so I don't want to add to webapp.
> I think exactly my problem is in the (...).
> I don't know how should add my file
> I write this code in renderHead, before
> """response.render(OnDomReadyHeaderItem.forScript("$('table').DataTable({"
> + ... + "});"));""" :
>

You need to use RequestCycle.get().urlFor(new
PackageResourceReference(Some.class, "dataTables.persian.json"))



> WebApplication.get().mountResource("/", new
> PackageResourceReference("dataTables.persian.json"));
>

I guess you don't want it on the root ("/").
But this will make it "available always" too!



> But I got 404 for the file
> [image: image.png]
>
> On Tue, Sep 20, 2022 at 5:31 PM Martin Grigorov <mgrigo...@apache.org>
> wrote:
>
>> Hi,
>>
>> You can put the JSON file in your webapp /static folder.
>> Or you could use application.mountResource(...) if you want it to be
>> served
>> and/or generated by Wicket.
>>
>> Also please check
>> https://github.com/wicketstuff/core/tree/master/datatables-parent
>>
>>
>> On Tue, Sep 20, 2022 at 3:31 PM vahid ghasemi <vahidghasemi...@gmail.com>
>> wrote:
>>
>> > Hello,
>> > I want to use datatables library: https://datatables.net/
>> > I created a behavior and override renderHead method :
>> > response.render(OnDomReadyHeaderItem.forScript("$('table').DataTable({"
>> +
>> > ... + "});"));
>> >
>> > according to this link :
>> > https://datatables.net/reference/option/language.url
>> > I can pass the JSON file for internationalization, my JSON file should
>> be
>> > after http://localhost:8080/wicket/bookmarkable/
>> > I don't know how can I add my JSON file.
>> >
>> > Thanks. Regards
>> >
>>
>

Reply via email to