You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Claude Andrew <cl...@bronzenose.com> on 2016/07/01 02:31:07 UTC

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

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

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

Posted by Claude Andrew <cl...@bronzenose.com>.
Fantastic!  Thank you, that's exactly it.

On Thu, Jun 30, 2016 at 11:18 PM Chris Poulsen <ma...@nesluop.dk>
wrote:

> change @Import(module = { "mymodule.js",}) to @Import(module = {
> "mymodule"})
>
> --
> Chris
>
> On Fri, Jul 1, 2016 at 4:31 AM, Claude Andrew <cl...@bronzenose.com>
> 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
> >
>

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

Posted by Chris Poulsen <ma...@nesluop.dk>.
change @Import(module = { "mymodule.js",}) to @Import(module = {
"mymodule"})

-- 
Chris

On Fri, Jul 1, 2016 at 4:31 AM, Claude Andrew <cl...@bronzenose.com> 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
>