branaway / Japid

A Java-based statically-typed fast template engine that can be used in any Java code. It has special adapter for use with the Play! Framework.
113 stars 18 forks source link

compile error when _layouts or _tags has no java class defined #39

Open greenlaw110 opened 12 years ago

greenlaw110 commented 12 years ago

When using Japid in the standonline mode, call japid gen will generate default directory structure including an empty _layouts and _tags folder. The generated java code has the following 2 import statements:

import japidviews .tags.; import japidviews .layouts.;

if I don't have anything put into the _layouts and _tags folder, the compiler will complaint that

compile: [javac] Compiling 1 source file to T:\tmp\template-engine-benchmarks\java\classes [javac] T:\tmp\template-engine-benchmarks\java\src\japidviews\stocks.java:6: package japidviews._tags does not exist [javac] import japidviews.tags.; [javac] ^ [javac] T:\tmp\template-engine-benchmarks\java\src\japidviews\stocks.java:7: package japidviews._layouts does not exist [javac] import japidviews.layouts.; [javac] ^ [javac] 2 errors

greenlaw110 commented 12 years ago

A workaround might generate a dump class something like T.java in _layouts and _tags folder always when you type japid gen:

package japidviews._layouts; public class T {}

and package japidviews._tags; public class T {}

branaway commented 12 years ago

Hi,

Thanks for input. Let me think a bit for the best strategy. In the interim, put some dummy files there to work around it.

Bing

2011/11/18 Green Luo < reply@reply.github.com

When using Japid in the standonline mode, call japid gen will generate default directory structure including an empty _layouts and _tags folder. The generated java code has the following 2 import statements:

import japidviews .tags.; import japidviews .layouts.;

if I don't have anything put into the _layouts and _tags folder, the compiler will complaint that

compile: [javac] Compiling 1 source file to T:\tmp\template-engine-benchmarks\java\classes [javac] T:\tmp\template-engine-benchmarks\java\src\japidviews\stocks.java:6: package japidviews._tags does not exist [javac] import japidviews.tags.; [javac] ^ [javac] T:\tmp\template-engine-benchmarks\java\src\japidviews\stocks.java:7: package japidviews._layouts does not exist [javac] import japidviews.layouts.; [javac] ^ [javac] 2 errors


Reply to this email directly or view it on GitHub: https://github.com/branaway/Japid/issues/39

pgeez commented 11 years ago

Bing:

Any updates on this issue? Can you please more fully explain the "dummy files" workaround? It seems that creating a class called "japidviews._tags.Dummy.java" isn't sustainable because it gets overwritten upon every recompile.

Thanks.

-P

branaway commented 11 years ago

I meant putting foo.html in both folders.

I might have smart importing ported to standalone Japid soon.

bing ran, en route

在 2012-8-6,0:25,pgeezreply@reply.github.com 写道:

Bing:

Any updates on this issue? Can you please more fully explain the "dummy files" workaround? It seems that creating a class called "japidviews._tags.Dummy.java" isn't sustainable because it gets overwritten upon every recompile.

Thanks.

-P


Reply to this email directly or view it on GitHub: https://github.com/branaway/Japid/issues/39#issuecomment-7511038

branaway commented 11 years ago

I believe I have implemented smart importing from a few version back in the Japid, both for Play and standalone. Can you download the latest version and verify that?

2012/8/6 Bing Ran bing.ran@gmail.com

I meant putting foo.html in both folders.

I might have smart importing ported to standalone Japid soon.

bing ran, en route

ÔÚ 2012-8-6£¬0:25£¬pgeez< reply@reply.github.com> дµÀ£º

Bing:

Any updates on this issue? Can you please more fully explain the "dummy files" workaround? It seems that creating a class called "japidviews._tags.Dummy.java" isn't sustainable because it gets overwritten upon every recompile.

Thanks.

-P


Reply to this email directly or view it on GitHub: https://github.com/branaway/Japid/issues/39#issuecomment-7511038

pgeez commented 11 years ago

Bing:

I'm on Play 2.0.2 and the most recent version of Japid42 (last commit #d3e79e11 was 9 days ago).

"smart importing" means that you don't include unused or unnecessary imports?

Btw, do you have any specific benchmarks that compare the perf of Japid42 to the Play2.0 Scala template framework? I've seen lots of comments on Japid vs. Play 1.2, but those are less relevant (I think).

Thanks!

-P-

branaway commented 11 years ago

o, sorry, Japid42 does not have it yet. It's coming soon. I hope a dummy html file in the folders will help in the interim.

No I don't have a benchmark. My wild guess is Japid42 should be faster and smaller in footprint.

2012/8/7 pgeez < reply@reply.github.com

Bing:

I'm on Play 2.0.2 and the most recent version of Japid42 (last commit

d3e79e11 was 9 days ago).

"smart importing" means that you don't include unused or unnecessary imports?

Btw, do you have any specific benchmarks that compare the perf of Japid42 to the Play2.0 Scala template framework? I've seen lots of comments on Japid vs. Play 1.2, but those are less relevant (I think).

Thanks!

-P-


Reply to this email directly or view it on GitHub: https://github.com/branaway/Japid/issues/39#issuecomment-7528756

branaway commented 11 years ago

I have made a few changes and pushed the version to 0.3. Can you verify that it works with play 2.0.3?

Thanks

2012/8/7 Bing Ran bing.ran@gmail.com

o, sorry, Japid42 does not have it yet. It's coming soon. I hope a dummy html file in the folders will help in the interim.

No I don't have a benchmark. My wild guess is Japid42 should be faster and smaller in footprint.

2012/8/7 pgeez < reply@reply.github.com

Bing:

I'm on Play 2.0.2 and the most recent version of Japid42 (last commit

d3e79e11 was 9 days ago).

"smart importing" means that you don't include unused or unnecessary imports?

Btw, do you have any specific benchmarks that compare the perf of Japid42 to the Play2.0 Scala template framework? I've seen lots of comments on Japid vs. Play 1.2, but those are less relevant (I think).

Thanks!

-P-


Reply to this email directly or view it on GitHub: https://github.com/branaway/Japid/issues/39#issuecomment-7528756

pgeez commented 11 years ago

Bing:

Ok, thanks.

Why would you natively expect Japid to be faster and smaller? While I understand that Java compilers are better optimized than Scala compilers, aren't both templates still compiled? And, the native template system in Play 2.0 has been completely rewritten, right? Would you still expect the 2X-20X perf gain mentioned here (http://www.playframework.org/modules/japid)?

I'm new to Scala, so please forgive my naivete.

-P-

branaway commented 11 years ago

I used the Scala plugin for play 1.0 as reference for which there was a benchmark. I remembered it was slower than Japid. How different is play 2 I don't know. I do know that compiling play2 templates are one of the things people are not happy with.

bing ran, en route

在 2012-8-7,2:20,pgeezreply@reply.github.com 写道:

Bing:

Ok, thanks.

Why would you natively expect Japid to be faster and smaller? While I understand that Java compilers are better optimized than Scala compilers, aren't both templates still compiled? And, the native template system in Play 2.0 has been completely rewritten, right? Would you still expect the 2X-20X perf gain mentioned here (http://www.playframework.org/modules/japid)?

I'm new to Scala, so please forgive my naivete.

-P-


Reply to this email directly or view it on GitHub: https://github.com/branaway/Japid/issues/39#issuecomment-7531147