anjlab / eclipse-tapestry5-plugin

Eclipse Plugin for Tapestry5
Apache License 2.0
21 stars 9 forks source link

Page template file not found. #2

Closed antalk closed 11 years ago

antalk commented 11 years ago

When you have the page template (tml) files in /src/main/webapp the plugin is not able to map to the corresponding java file.

dmitrygusev commented 11 years ago

This is expected behavior: plugin only searches *.tml/*.java files in source folders, which is where you should put these files. Everything you put to src/main/webapp becomes available by URL to users, so anybody could view your sources, so this is sort of security issue. Is tapestry able to find these *.tml files there at all? If it is -- then this is a tapestry bug.

antalk commented 11 years ago

Yes, Tapestry has no problem whatsoever to find these files, we use it for several years now without any problems on tomcat and jetty containers (for test). Even if i try to access the TML directly :

http://localhost:8080/webapp/index.tml

I'll get a HTTP ERROR 403

Problem accessing /document/index.tml. Reason:

URI /index.tml may not be accessed remotely.

This is out preferred way of developing since Tapestry 5.0.x and it would be nice if the plugin could search this structure. Also this url: http://tapestryjava.blogspot.nl/2007/10/tapestry-506-is-available.html speaks about TML files in the context root, which is src/main/webapp

dmitrygusev commented 11 years ago

Are you only store *.tml files in src/main/webapp or your *.properties files are also in there?

dmitrygusev commented 11 years ago

Also what will be if you put your templates both to src/main/webapp and to classpath -- what will happen? Which one will be picked or will there be any exception?

dmitrygusev commented 11 years ago

Should be fixed in version 1.1.0

antalk commented 11 years ago

We are only storing *.tml files in /src/main/webapp, property files will not be picked up by Tapestry. I cannot answer the second question because if i try to install the latest version i get a message dialog in Eclipse where i have to provide a login for: dl.bintray.com ?

dmitrygusev commented 11 years ago

You're not the only one who got this error, not sure why this is happening, probably some issue with bintray. Maybe you were trying to update when I did publishing of new version. Can you try it one more time now?

Also what will be if you put your templates both to src/main/webapp and to classpath -- what will happen? Which one will be picked or will there be any exception?

I implemented it the way that this plugin will try to look this resource in source folders first.

dmitrygusev commented 11 years ago

There was a problem with update site, as you may seen in mailing list. I just updated it to: https://dl.bintray.com/anjlab/eclipse-tapestry5-plugin Can you try with this URL?

antalk commented 11 years ago

Just installed the latest version 1.1.2 but still no cigar. Templates located in src/main/webapp are not found.

dmitrygusev commented 11 years ago

Can you post your project structure here? Just a minimum so I can reproduce.

antalk commented 11 years ago

It's very simple, just start a new Tapestry project using the archetype. Then move the About.tml template from src/main/resources to src/main/webapp

At this point the plugin cannot find the TML anymore. Moving it back to its original location makes the problem go away.

dmitrygusev commented 11 years ago

Ok, I found what's wrong with this.

I expect that file structure would be like this:

.
├── build.gradle
├── src
│   ├── main
│   │   ├── java
│   │   │   └── com
│   │   │       └── anjlab
│   │   │           ├── pages
│   │   │           │   ├── About.java
│   │   └── webapp
│   │       ├── com
│   │       │   └── anjlab
│   │       │       └── pages
│   │       │           └── About.tml

And you are talking about this:

.
├── build.gradle
├── src
│   ├── main
│   │   ├── java
│   │   │   └── com
│   │   │       └── anjlab
│   │   │           ├── pages
│   │   │           │   ├── About.java
│   │   └── webapp
│   │           └── About.tml

And tapestry can work with both.

I will add support for the second case in next release.

antalk commented 11 years ago

cool. thanks!

dmitrygusev commented 11 years ago

@antalk Is it works for you now?

antalk commented 11 years ago

Just tested the latest version and it works, thanks!