You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Sean Brookes <sb...@saba.com> on 2008/11/07 00:25:32 UTC

Absolute URL problem with HeaderContributor (1.3.4)

I know the recommeded approach is to use relative context URLs for CSS and
Javascript but our application places static assets on a separate server for
performance reasons so relative paths are not an option.  From what I
understand if my path starts with "http://" or "https://" wicket should
respect that but it doesn't seem to be working that way for me.

My code:

		String fullyQualifiedPath = getAssetHost() +
"/tinymce-3-2/jscripts/tiny_mce/tiny_mce.js";
		add(HeaderContributor.forJavaScript(fullyQualifiedPath));

Where 'getAssetHost()'  returns "http://<asset server host>/assets"  so
fullyQalifiedPath = "http://<asset server
host>/assets/tinymce-3-2/jscripts/tiny_mce/tiny_mce.js" 

The problem is that Wicket seems to be prepending the application context to
that value so on the client I get:
"http://<web app server host>/web/app/http://<asset server
host>/assets/tinymce-3-2/jscripts/tiny_mce/tiny_mce.js"

Can someone shed some light on this for me?

cheers,
Sean
-- 
View this message in context: http://www.nabble.com/Absolute-URL-problem-with-HeaderContributor-%281.3.4%29-tp20371914p20371914.html
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Absolute URL problem with HeaderContributor (1.3.4)

Posted by Maarten Bosteels <mb...@gmail.com>.
see also http://wicket.apache.org/quickstart.html

Maarten

On Fri, Nov 7, 2008 at 8:43 AM, Martin Funk <ma...@googlemail.com> wrote:
> 2008/11/7 Sean Brookes <sb...@saba.com>
>
>>
>> Thank you for your quick response igor but I don't think I understand your
>> response.  We are currently using version 1.3.4, although we are assessing
>> the impact of moving to 1.3.5 and I will certainly test it there when we
>> do.
>>
>> I'm afraid I don't know what you mean when you suggest I 'create a
>> quckstart'
>
> create the smallest possible wicket-webapp that reprocuces your issue.
> As a starter you can use wicket-quickstart:
> http://svn.apache.org/repos/asf/wicket/releases/wicket-1.3.4/jdk-1.4/wicket-quickstart/
>
> So when you post the diff, people can reproduce your issue and analyze it.
>
> mf
>
>>
>>
>> While looking into this a little further I discovered that this seems to
>> work in a file that extends WebPage but the file I am working on extends
>> Panel. I don't know if this should affect how HeaderContributor generates
>> it's path value or not but thought I would mention it.
>>
>> Sean
>>
>>
>>
>>
>>
>> igor.vaynberg wrote:
>> >
>> > can you make sure its still broken in 1.3.x branch and if it is create
>> > a quickstart.
>> >
>> > -igor
>> >
>> > On Thu, Nov 6, 2008 at 3:25 PM, Sean Brookes <sb...@saba.com> wrote:
>> >>
>> >> I know the recommeded approach is to use relative context URLs for CSS
>> >> and
>> >> Javascript but our application places static assets on a separate server
>> >> for
>> >> performance reasons so relative paths are not an option.  From what I
>> >> understand if my path starts with "http://" or "https://" wicket should
>> >> respect that but it doesn't seem to be working that way for me.
>> >>
>> >> My code:
>> >>
>> >>                String fullyQualifiedPath = getAssetHost() +
>> >> "/tinymce-3-2/jscripts/tiny_mce/tiny_mce.js";
>> >>                add(HeaderContributor.forJavaScript(fullyQualifiedPath));
>> >>
>> >> Where 'getAssetHost()'  returns "http://<asset server host>/assets"  so
>> >> fullyQalifiedPath = "http://<asset server
>> >> host>/assets/tinymce-3-2/jscripts/tiny_mce/tiny_mce.js"
>> >>
>> >> The problem is that Wicket seems to be prepending the application
>> context
>> >> to
>> >> that value so on the client I get:
>> >> "http://<web app server host>/web/app/http://<asset server
>> >> host>/assets/tinymce-3-2/jscripts/tiny_mce/tiny_mce.js"
>> >>
>> >> Can someone shed some light on this for me?
>> >>
>> >> cheers,
>> >> Sean
>> >> --
>> >> View this message in context:
>> >>
>> http://www.nabble.com/Absolute-URL-problem-with-HeaderContributor-%281.3.4%29-tp20371914p20371914.html
>> >> Sent from the Wicket - User mailing list archive at Nabble.com.
>> >>
>> >>
>> >> ---------------------------------------------------------------------
>> >> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> >> For additional commands, e-mail: users-help@wicket.apache.org
>> >>
>> >>
>> >
>> > ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> > For additional commands, e-mail: users-help@wicket.apache.org
>> >
>> >
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Absolute-URL-problem-with-HeaderContributor-%281.3.4%29-tp20371914p20372681.html
>> Sent from the Wicket - User mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Absolute URL problem with HeaderContributor (1.3.4)

Posted by Martin Funk <ma...@googlemail.com>.
2008/11/7 Sean Brookes <sb...@saba.com>

>
> Thank you for your quick response igor but I don't think I understand your
> response.  We are currently using version 1.3.4, although we are assessing
> the impact of moving to 1.3.5 and I will certainly test it there when we
> do.
>
> I'm afraid I don't know what you mean when you suggest I 'create a
> quckstart'

create the smallest possible wicket-webapp that reprocuces your issue.
As a starter you can use wicket-quickstart:
http://svn.apache.org/repos/asf/wicket/releases/wicket-1.3.4/jdk-1.4/wicket-quickstart/

So when you post the diff, people can reproduce your issue and analyze it.

mf

>
>
> While looking into this a little further I discovered that this seems to
> work in a file that extends WebPage but the file I am working on extends
> Panel. I don't know if this should affect how HeaderContributor generates
> it's path value or not but thought I would mention it.
>
> Sean
>
>
>
>
>
> igor.vaynberg wrote:
> >
> > can you make sure its still broken in 1.3.x branch and if it is create
> > a quickstart.
> >
> > -igor
> >
> > On Thu, Nov 6, 2008 at 3:25 PM, Sean Brookes <sb...@saba.com> wrote:
> >>
> >> I know the recommeded approach is to use relative context URLs for CSS
> >> and
> >> Javascript but our application places static assets on a separate server
> >> for
> >> performance reasons so relative paths are not an option.  From what I
> >> understand if my path starts with "http://" or "https://" wicket should
> >> respect that but it doesn't seem to be working that way for me.
> >>
> >> My code:
> >>
> >>                String fullyQualifiedPath = getAssetHost() +
> >> "/tinymce-3-2/jscripts/tiny_mce/tiny_mce.js";
> >>                add(HeaderContributor.forJavaScript(fullyQualifiedPath));
> >>
> >> Where 'getAssetHost()'  returns "http://<asset server host>/assets"  so
> >> fullyQalifiedPath = "http://<asset server
> >> host>/assets/tinymce-3-2/jscripts/tiny_mce/tiny_mce.js"
> >>
> >> The problem is that Wicket seems to be prepending the application
> context
> >> to
> >> that value so on the client I get:
> >> "http://<web app server host>/web/app/http://<asset server
> >> host>/assets/tinymce-3-2/jscripts/tiny_mce/tiny_mce.js"
> >>
> >> Can someone shed some light on this for me?
> >>
> >> cheers,
> >> Sean
> >> --
> >> View this message in context:
> >>
> http://www.nabble.com/Absolute-URL-problem-with-HeaderContributor-%281.3.4%29-tp20371914p20371914.html
> >> Sent from the Wicket - User mailing list archive at Nabble.com.
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> >> For additional commands, e-mail: users-help@wicket.apache.org
> >>
> >>
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > For additional commands, e-mail: users-help@wicket.apache.org
> >
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/Absolute-URL-problem-with-HeaderContributor-%281.3.4%29-tp20371914p20372681.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: Absolute URL problem with HeaderContributor (1.3.4)

Posted by Sean Brookes <sb...@saba.com>.
Thank you for your quick response igor but I don't think I understand your
response.  We are currently using version 1.3.4, although we are assessing
the impact of moving to 1.3.5 and I will certainly test it there when we do.

I'm afraid I don't know what you mean when you suggest I 'create a
quckstart'

While looking into this a little further I discovered that this seems to
work in a file that extends WebPage but the file I am working on extends
Panel. I don't know if this should affect how HeaderContributor generates
it's path value or not but thought I would mention it.

Sean





igor.vaynberg wrote:
> 
> can you make sure its still broken in 1.3.x branch and if it is create
> a quickstart.
> 
> -igor
> 
> On Thu, Nov 6, 2008 at 3:25 PM, Sean Brookes <sb...@saba.com> wrote:
>>
>> I know the recommeded approach is to use relative context URLs for CSS
>> and
>> Javascript but our application places static assets on a separate server
>> for
>> performance reasons so relative paths are not an option.  From what I
>> understand if my path starts with "http://" or "https://" wicket should
>> respect that but it doesn't seem to be working that way for me.
>>
>> My code:
>>
>>                String fullyQualifiedPath = getAssetHost() +
>> "/tinymce-3-2/jscripts/tiny_mce/tiny_mce.js";
>>                add(HeaderContributor.forJavaScript(fullyQualifiedPath));
>>
>> Where 'getAssetHost()'  returns "http://<asset server host>/assets"  so
>> fullyQalifiedPath = "http://<asset server
>> host>/assets/tinymce-3-2/jscripts/tiny_mce/tiny_mce.js"
>>
>> The problem is that Wicket seems to be prepending the application context
>> to
>> that value so on the client I get:
>> "http://<web app server host>/web/app/http://<asset server
>> host>/assets/tinymce-3-2/jscripts/tiny_mce/tiny_mce.js"
>>
>> Can someone shed some light on this for me?
>>
>> cheers,
>> Sean
>> --
>> View this message in context:
>> http://www.nabble.com/Absolute-URL-problem-with-HeaderContributor-%281.3.4%29-tp20371914p20371914.html
>> Sent from the Wicket - User mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Absolute-URL-problem-with-HeaderContributor-%281.3.4%29-tp20371914p20372681.html
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Absolute URL problem with HeaderContributor (1.3.4)

Posted by Igor Vaynberg <ig...@gmail.com>.
can you make sure its still broken in 1.3.x branch and if it is create
a quickstart.

-igor

On Thu, Nov 6, 2008 at 3:25 PM, Sean Brookes <sb...@saba.com> wrote:
>
> I know the recommeded approach is to use relative context URLs for CSS and
> Javascript but our application places static assets on a separate server for
> performance reasons so relative paths are not an option.  From what I
> understand if my path starts with "http://" or "https://" wicket should
> respect that but it doesn't seem to be working that way for me.
>
> My code:
>
>                String fullyQualifiedPath = getAssetHost() +
> "/tinymce-3-2/jscripts/tiny_mce/tiny_mce.js";
>                add(HeaderContributor.forJavaScript(fullyQualifiedPath));
>
> Where 'getAssetHost()'  returns "http://<asset server host>/assets"  so
> fullyQalifiedPath = "http://<asset server
> host>/assets/tinymce-3-2/jscripts/tiny_mce/tiny_mce.js"
>
> The problem is that Wicket seems to be prepending the application context to
> that value so on the client I get:
> "http://<web app server host>/web/app/http://<asset server
> host>/assets/tinymce-3-2/jscripts/tiny_mce/tiny_mce.js"
>
> Can someone shed some light on this for me?
>
> cheers,
> Sean
> --
> View this message in context: http://www.nabble.com/Absolute-URL-problem-with-HeaderContributor-%281.3.4%29-tp20371914p20371914.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org