Modules not found by Tapestry 5.4.1; serving 'index' instead

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Modules not found by Tapestry 5.4.1; serving 'index' instead

Claude Andrew-2
I just upgraded to 5.4.1 from 5.3.  I am switching my js libraries to
requirejs modules.  Following the guide at
http://tapestry.apache.org/javascript-modules.html, I placed my module
files in 'src/main/resources/META-INF/modules' and included one in a page's
java class:
@Import(module = { "mymodule.js",})

When I load the page and look at mymodule.js in the browser it shows me the
html of my index page instead of the javascript in my mymodule.js file.
This looks as though Tapestry has no idea that it has a resource called
mymodule.js.

Where have I gone wrong?

I am using Tynamo's Tomcat/Eclipse plugin (
http://www.tynamo.org/Developing+with+Tomcat+and+Eclipse/)

I have a feeling that perhaps my build or deployment are losing the new
META-INF directory and Tapestry never sees it but I have no idea where to
go to test or fix that (shame on me).

More details if useful:
The path the browser shows for the resource is "
http://localhost:8080/mymodule.js" which seems appropriate as my app is
deployed as ROOT.
The tail of my page requires my module like this:
<script type="text/javascript">require(["t5/core/pageinit"], function(pi) {
pi([], [
  "mymodule.js",
]); });</script>

here's my directory structure:

src/main/
src/main/resources
src/main/resources/META-INF
src/main/resources/META-INF/modules
src/main/resources/META-INF/modules/mymodule.js
src/main/java
src/main/webapp
src/site
src/test
etc


Thanks in advance,

Claude
Reply | Threaded
Open this post in threaded view
|

Re: Modules not found by Tapestry 5.4.1; serving 'index' instead

Chris Poulsen
change @Import(module = { "mymodule.js",}) to @Import(module = {
"mymodule"})

--
Chris

On Fri, Jul 1, 2016 at 4:31 AM, Claude Andrew <[hidden email]> wrote:

> I just upgraded to 5.4.1 from 5.3.  I am switching my js libraries to
> requirejs modules.  Following the guide at
> http://tapestry.apache.org/javascript-modules.html, I placed my module
> files in 'src/main/resources/META-INF/modules' and included one in a page's
> java class:
> @Import(module = { "mymodule.js",})
>
> When I load the page and look at mymodule.js in the browser it shows me the
> html of my index page instead of the javascript in my mymodule.js file.
> This looks as though Tapestry has no idea that it has a resource called
> mymodule.js.
>
> Where have I gone wrong?
>
> I am using Tynamo's Tomcat/Eclipse plugin (
> http://www.tynamo.org/Developing+with+Tomcat+and+Eclipse/)
>
> I have a feeling that perhaps my build or deployment are losing the new
> META-INF directory and Tapestry never sees it but I have no idea where to
> go to test or fix that (shame on me).
>
> More details if useful:
> The path the browser shows for the resource is "
> http://localhost:8080/mymodule.js" which seems appropriate as my app is
> deployed as ROOT.
> The tail of my page requires my module like this:
> <script type="text/javascript">require(["t5/core/pageinit"], function(pi) {
> pi([], [
>   "mymodule.js",
> ]); });</script>
>
> here's my directory structure:
>
> src/main/
> src/main/resources
> src/main/resources/META-INF
> src/main/resources/META-INF/modules
> src/main/resources/META-INF/modules/mymodule.js
> src/main/java
> src/main/webapp
> src/site
> src/test
> etc
>
>
> Thanks in advance,
>
> Claude
>
Reply | Threaded
Open this post in threaded view
|

Re: Modules not found by Tapestry 5.4.1; serving 'index' instead

Claude Andrew-2
Fantastic!  Thank you, that's exactly it.

On Thu, Jun 30, 2016 at 11:18 PM Chris Poulsen <[hidden email]>
wrote:

> change @Import(module = { "mymodule.js",}) to @Import(module = {
> "mymodule"})
>
> --
> Chris
>
> On Fri, Jul 1, 2016 at 4:31 AM, Claude Andrew <[hidden email]>
> wrote:
>
> > I just upgraded to 5.4.1 from 5.3.  I am switching my js libraries to
> > requirejs modules.  Following the guide at
> > http://tapestry.apache.org/javascript-modules.html, I placed my module
> > files in 'src/main/resources/META-INF/modules' and included one in a
> page's
> > java class:
> > @Import(module = { "mymodule.js",})
> >
> > When I load the page and look at mymodule.js in the browser it shows me
> the
> > html of my index page instead of the javascript in my mymodule.js file.
> > This looks as though Tapestry has no idea that it has a resource called
> > mymodule.js.
> >
> > Where have I gone wrong?
> >
> > I am using Tynamo's Tomcat/Eclipse plugin (
> > http://www.tynamo.org/Developing+with+Tomcat+and+Eclipse/)
> >
> > I have a feeling that perhaps my build or deployment are losing the new
> > META-INF directory and Tapestry never sees it but I have no idea where to
> > go to test or fix that (shame on me).
> >
> > More details if useful:
> > The path the browser shows for the resource is "
> > http://localhost:8080/mymodule.js" which seems appropriate as my app is
> > deployed as ROOT.
> > The tail of my page requires my module like this:
> > <script type="text/javascript">require(["t5/core/pageinit"],
> function(pi) {
> > pi([], [
> >   "mymodule.js",
> > ]); });</script>
> >
> > here's my directory structure:
> >
> > src/main/
> > src/main/resources
> > src/main/resources/META-INF
> > src/main/resources/META-INF/modules
> > src/main/resources/META-INF/modules/mymodule.js
> > src/main/java
> > src/main/webapp
> > src/site
> > src/test
> > etc
> >
> >
> > Thanks in advance,
> >
> > Claude
> >
>