You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tiles.apache.org by roointan <al...@gmail.com> on 2008/09/04 07:05:31 UTC

is it possible to include a bunch of jsps to a single placeholder?

hi.
I'm looking for a way to use tiles as a pluggability framework.
this is what we need:
we need a mechanism for dynamically including content in web pages. the
position of every segment is predefined. if there are "some" components to
be added to the page, we know "they" will be added [here!] for example.
we need the components be in the form of files. also we need hot
pluggability, server restart is really hated.
another thing we need is a light solution without a steep learning curve.
and the last is of course we are trying to avoid reinventing the wheel.
I checked tiles quickstart and FAQ. it seems tiles 2 is a nice structured
framework. but when i tested the sample, it seems you can't be doing hot
pluggability. i removed a jsp page, and it failed. so every component
specified must exist. (or not?). also the more important thing is that we
want to be able to place a kinda bunch of jsps to a single component holder. 
for example for a placeholder there is no file to include at first. later
1.jsp and 2.jsp may be added, and both must be added in that placeholder.
over time we may add some other jsps. is it possible to include a bunch of
jsps to a single placeholder? and how?
-- 
View this message in context: http://www.nabble.com/is-it-possible-to-include-a-bunch-of-jsps-to-a-single-placeholder--tp19303435p19303435.html
Sent from the tiles users mailing list archive at Nabble.com.


Re: is it possible to include a bunch of jsps to a single placeholder?

Posted by Antonio Petrelli <an...@gmail.com>.
2008/9/6 roointan <al...@gmail.com>:
> does tiles have a jira url to request the feature? (a placeholder that
> points to a folder. a naming convention for files (eg: "theseFiles*"). if no
> file exists, then nothing will be added. but files that match the filter
> name, will be added one by one. (eg: theseFiles1.jsp and theseFiles2.jsp for
> that placeholder) )

Tiles has not such a feature OOTB, but you can use a list attribute,
but you need to specify every single instance to add to the list.
Probably it could be some sort of list attribute defined by a
wilcard-based pattern.
Feel free to open a JIRA issue, and if you want to help in the
development, feel free again :-D
If you want to further discuss this new feature you may want to ask
the Tiles Developers mailing list:
http://tiles.apache.org/mail-lists.html

>
> this:
> "... , filling its attributes at runtime. To do it, you can use the
> <tiles:insertTemplate> tag. The attributes can be put using
> <tiles:putAttribute> and related tags."
> is not the kinda "runtime setting" i am looking for. i want to be able to
> include content dynamically at runtime based on special conditions, as i
> wrote, existence of files, with a known naming convention.

In fact you may be interested in this:
http://tiles.apache.org/tutorial/advanced/list-attributes.html
but, again, it has no support for wildcards.

> so please help me avoid learning
> tiles (!) to see if it has those features. I'm not familiar with templates
> and definitions and contexts and so.

Read the tutorial if you don't want a "RTFM" answer.

> by now i see that i need to check for the existence of the files using I/O
> APIs myself, and then use Tiles APIs (and write relatively lots of code) to
> create templates based on the names of those files. (am i wrong?)
> (and do you think there is any other framework better suited to the
> requirements?

Your case seems perfectly reasonable, but Tiles has not this feature,
so either you or Tiles developers need to write "a lot of code".

Antonio

Re: is it possible to include a bunch of jsps to a single placeholder?

Posted by roointan <al...@gmail.com>.

Antonio Petrelli-3 wrote:
> 
> 2008/9/4 roointan <al...@gmail.com>:
>> we need a mechanism for dynamically including content in web pages.
> 
> Take a look at the runtime composition:
> http://tiles.apache.org/tutorial/advanced/runtime.html
> and the view preparer:
> http://tiles.apache.org/tutorial/advanced/preparer.html
> 

thanks for the links.

does tiles have a jira url to request the feature? (a placeholder that
points to a folder. a naming convention for files (eg: "theseFiles*"). if no
file exists, then nothing will be added. but files that match the filter
name, will be added one by one. (eg: theseFiles1.jsp and theseFiles2.jsp for
that placeholder) )

this: 
"... , filling its attributes at runtime. To do it, you can use the
<tiles:insertTemplate> tag. The attributes can be put using
<tiles:putAttribute> and related tags."
is not the kinda "runtime setting" i am looking for. i want to be able to
include content dynamically at runtime based on special conditions, as i
wrote, existence of files, with a known naming convention.
overriding configuration by changing jsp files is not what i want.
I have absolutely no experience with tiles. so i need your help. with these
links i'm back to the position I was, checking the documentation to see if
what i'm looking for is available or not. so please help me avoid learning
tiles (!) to see if it has those features. I'm not familiar with templates
and definitions and contexts and so.

by now i see that i need to check for the existence of the files using I/O
APIs myself, and then use Tiles APIs (and write relatively lots of code) to
create templates based on the names of those files. (am i wrong?)
(and do you think there is any other framework better suited to the
requirements?
-- 
View this message in context: http://www.nabble.com/is-it-possible-to-include-a-bunch-of-jsps-to-a-single-placeholder--tp19303435p19342971.html
Sent from the tiles users mailing list archive at Nabble.com.


Re: is it possible to include a bunch of jsps to a single placeholder?

Posted by Antonio Petrelli <an...@gmail.com>.
2008/9/4 roointan <al...@gmail.com>:
> we need a mechanism for dynamically including content in web pages.

Take a look at the runtime composition:
http://tiles.apache.org/tutorial/advanced/runtime.html
and the view preparer:
http://tiles.apache.org/tutorial/advanced/preparer.html

HTH
Antonio