• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

Maven + Tiles + Struts2

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
So I am playing a little bit with the struts2 features and try to integrate them in little example projects. I also use Maven because it is a nice feature to make depencies. But I don't know why my Application doesn't work.

My environment:
- Eclipse 3.6
- Tomcat 6
- struts 2.2.1
- tiles-plugin 2.2.1

This is my maven pom.xml file:



This is my SayHelloAction:



this is my tiles-definition.xml:



this is my struts.xml:


web.xml:


My error message is this:


This is my project structure:


I really don't know why. Because I he must find the definition file??
directories.png
[Thumbnail for directories.png]
Direcotry Structure
 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
OGNL 3 has a javassist dependency; if you search this forum you'll see another discussion about this exact topic. One of the POMs (I forget which) declares it as a provided resource or something... I forget what I was told when I asked another S2 dev about this.
 
Matthias Zeilerbauer
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
So finally did it. After one whole day...crap! (now I will dream of tiles definitions and struts2 )
My error was that I must not load a template file (layout.jsp) as a welcome site (at first).
Another thing what I found out was when you build a struts2-tiles webapp that you have to depend on javassist even when you use ognl 3.0!

My solution was to create an index.jsp which I declared as my welcome site which immediatly redirects to my SayHelloAction, which then loads the template file:

index.jsp:


When anybody needs my working version (also in .war available) than contact me: zeiler.matthias(at)gmx.at

 
Matthias Zeilerbauer
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

David Newton wrote:OGNL 3 has a javassist dependency; if you search this forum you'll see another discussion about this exact topic. One of the POMs (I forget which) declares it as a provided resource or something... I forget what I was told when I asked another S2 dev about this.



I had to declare it as "compile", because only "provided" had not implemented it. I don't know if that is a bug, and also don't think it is logic, since "provided" implements the depency when it doesn't exist?
 
David Newton
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That's why I said OGNL 3 has a dependency on Javassist. "Provided" means that it's assumed the dependency will exist at runtime--it's not necessary at compile time, since you're not compiling OGNL itself.
 
Matthias Zeilerbauer
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ah ok. That means when I would compile ognl than javassit would compile also. thanks for making it clear to me.
 
David Newton
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Actually, I mis-spoke--I don't know if OGNL has a compile-time dependency on jassist, but I *do* know it has a run-time dependency. I forget which pom it is, but one of them assumes javassist will be provided at run-time. Not sure about compile time.
 
Quick! Before anybody notices! Cover it up with this tiny ad:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic