You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Pierre Thibaudeau <pi...@gmail.com> on 2008/07/01 04:01:24 UTC

[S2] and the scripts paths

I am playing with Struts 2.1.2.   (I have seen several other related topics
on this mailing list but nothing quite explicitely about what follows.)

I add the following tag inside the <head>:

<sx:head baseRelativePath="../scripts/dojo" debug="true" cache="false"
compressed="false" />

Unsurprisingly, this yields the following in the html:

<script language="JavaScript" type="text/javascript">
// Dojo configuration
djConfig = { isDebug: true, bindEncoding: "UTF-8", baseRelativePath:
"../scripts/dojo", baseScriptUri: "../scripts/dojo", parseWidgets : false };
</script>
<script language="JavaScript" type="text/javascript"
src="../scripts/dojo/dojo.js.uncompressed.js"></script>

So far so good.  The problem is what follows:

<script language="JavaScript" type="text/javascript"
src="/myapp/struts/ajax/dojoRequire.js"></script>
<link rel="stylesheet" href="/myapp/struts/xhtml/styles.css"
type="text/css"/>
<script language="JavaScript" src="/myapp/struts/utils.js"
type="text/javascript"></script>
<script language="JavaScript" src="/myapp/struts/xhtml/validation.js"
type="text/javascript"></script>
<script language="JavaScript" src="/myapp/struts/css_xhtml/validation.js"
type="text/javascript"></script>

Where do these paths come from?  I certainly don't have a struts/ folder
inside my WebRoot...  Wasn't the "baseRelativePath" parameter of the
<sx:head> tag supposed to deal with that kind of issues?  Is there a way of
customizing this?

Re: [S2] and the scripts paths

Posted by Musachy Barroso <mu...@gmail.com>.
That's a good catch. That statement is intended for debugging and
won't break anything though.

musachy

On Mon, Jun 30, 2008 at 10:25 PM, Pierre Thibaudeau
<pi...@gmail.com> wrote:
> 2008/6/30 Musachy Barroso <mu...@gmail.com>:
>
>> "struts" maps to a folder inside the struts-core jar. Those files are
>> used for validation and are not related to dojo (nothing to do with
>> "head" tag)
>>
>
> Thank you, Musachy, for the "head's up"!
>
> Though I must add that, within that setup, javascript throws a "dojo not
> defined" error on the following line:
>
> <script language="JavaScript"
> type="text/javascript">dojo.hostenv.writeIncludes(true);</script>
>
> Maybe I should add that ../scripts/dojo (as refered to by baseRelativePath)
> contains the latest release of dojo.  Is that a problem?
>



-- 
"Hey you! Would you help me to carry the stone?" Pink Floyd

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: [S2] and the scripts paths

Posted by Pierre Thibaudeau <pi...@gmail.com>.
2008/6/30 Musachy Barroso <mu...@gmail.com>:

> "struts" maps to a folder inside the struts-core jar. Those files are
> used for validation and are not related to dojo (nothing to do with
> "head" tag)
>

Thank you, Musachy, for the "head's up"!

Though I must add that, within that setup, javascript throws a "dojo not
defined" error on the following line:

<script language="JavaScript"
type="text/javascript">dojo.hostenv.writeIncludes(true);</script>

Maybe I should add that ../scripts/dojo (as refered to by baseRelativePath)
contains the latest release of dojo.  Is that a problem?

Re: [S2] and the scripts paths

Posted by Musachy Barroso <mu...@gmail.com>.
"struts" maps to a folder inside the struts-core jar. Those files are
used for validation and are not related to dojo (nothing to do with
"head" tag)

musachy

On Mon, Jun 30, 2008 at 10:01 PM, Pierre Thibaudeau
<pi...@gmail.com> wrote:
> I am playing with Struts 2.1.2.   (I have seen several other related topics
> on this mailing list but nothing quite explicitely about what follows.)
>
> I add the following tag inside the <head>:
>
> <sx:head baseRelativePath="../scripts/dojo" debug="true" cache="false"
> compressed="false" />
>
> Unsurprisingly, this yields the following in the html:
>
> <script language="JavaScript" type="text/javascript">
> // Dojo configuration
> djConfig = { isDebug: true, bindEncoding: "UTF-8", baseRelativePath:
> "../scripts/dojo", baseScriptUri: "../scripts/dojo", parseWidgets : false };
> </script>
> <script language="JavaScript" type="text/javascript"
> src="../scripts/dojo/dojo.js.uncompressed.js"></script>
>
> So far so good.  The problem is what follows:
>
> <script language="JavaScript" type="text/javascript"
> src="/myapp/struts/ajax/dojoRequire.js"></script>
> <link rel="stylesheet" href="/myapp/struts/xhtml/styles.css"
> type="text/css"/>
> <script language="JavaScript" src="/myapp/struts/utils.js"
> type="text/javascript"></script>
> <script language="JavaScript" src="/myapp/struts/xhtml/validation.js"
> type="text/javascript"></script>
> <script language="JavaScript" src="/myapp/struts/css_xhtml/validation.js"
> type="text/javascript"></script>
>
> Where do these paths come from?  I certainly don't have a struts/ folder
> inside my WebRoot...  Wasn't the "baseRelativePath" parameter of the
> <sx:head> tag supposed to deal with that kind of issues?  Is there a way of
> customizing this?
>



-- 
"Hey you! Would you help me to carry the stone?" Pink Floyd

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org