• 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:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

[TILES] How to include an action as body in a definition [SOLVED]

 
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi there, here comes a tiles beginner question:

I have written a base definition, from which extends another definition. Here is the content of the tiles-def.xml:

I have succeeded into configuring everything so I can instantiate the page.estimaciones definition from my struts-config.xml without any exception.

Anyway, instead of the content of estimacionesContent.jsp, I get the following output:

:THIS IS THE HEADER
THIS IS THE MENUBAR
The requested resource (/NoLlego/web/jsp/struts/estimaciones/estimaciones) is not available
THIS IS THE COPYRIGHT


Where's my error??? I can't get estimacionesContent.do from tiles... Maybe is an stupid question, but I started to learn tiles yesterday... Please any tip will be appreciated!!!
[ July 03, 2008: Message edited by: Roberto L�pez L�pez ]
 
Ranch Hand
Posts: 213
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I am not an expert in tiles, but If I am getting it right, you should give your path to jsp in the tiles definition and your path of tiles definition in your forward tag in your action mapping.

So replace

with

and

with

In this way, you will forward in your action mapping to a tiles definition, which creates the view using the base definitions and forwards it to your jsp.

Please someone correct me If I am wrong.....

[ July 02, 2008: Message edited by: Sachin Adat ]
[ July 02, 2008: Message edited by: Sachin Adat ]
 
Roberto Lopez Lopez
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for your response, Sachin.

I understand your explanation, but just displaying my JSP isn't my real objective. I first tested with that config, but now I need to get the estimaciones.jsp after processing EstimacionesAction.

This is exactly the timeline of what I want:

  • Browser request.
  • struts-config.xml maps to page.estimaciones on tiles-defs.xml.
  • page.estimaciones is composed of: header.jsp, menubar.jsp, copyright.jsp AND /estimacionesContent.do (which generates another jsp).


  • I know it's a little strange but I need to do some operations before getting the estimaciones.jsp.

    Any idea???
    [ July 02, 2008: Message edited by: Roberto L�pez L�pez ]
     
    Sachin Adat
    Ranch Hand
    Posts: 213
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Hi,

    I am not sure about your requirements, but I think maybe you need to use the tiles controller.

    There is a good tutorial here
    Tiles Controller Class by Patrick Peak

    Check for Controller class.
     
    Roberto Lopez Lopez
    Greenhorn
    Posts: 23
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Thanks Sachin, nice page... I'll keep it at my bookmarks :-D

    Anyway, I've just solved the mistery... I had an error at estimaciones.jsp (a tag mistake) and tiles just displayed that short message "The requested resource is not available"... I don't know why it didn't displayed the error on the console, but finally I found it.

    Thank you!!!
    [ July 03, 2008: Message edited by: Roberto L�pez L�pez ]
     
    Sachin Adat
    Ranch Hand
    Posts: 213
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Great job ........
     
    reply
      Bookmark Topic Watch Topic
    • New Topic