A
Albert
Well, I'm developing a website where the content is dynamically
included.It's my first jsp project so I've got some - probably basic
-questions.
A jsp page is divided in some areas like content, navigation etc.
Content -as an example - is dynamically included and should display some -
I call them - blocks.
A block is for example an image, a list and a headline. So content can
have 1 to many blocks.
So a page ->content->block->image
I'm using the MVC pattern so my first approach was that my controller
servlets passes to the jsp page an object called model and the jsp page
gets
the data out of it.
Because of the structure this gets very ugly like:
Page onepage = (Page) model.getPage();
and then
(Area) onearea = (Area) onepage.getArea('content');
and so on...
The second problem is how do I pass the needed objects to the includes..?
Actually the jsp-page gets the object and writes it into the request with
setAttribute and the included page pulls them out..
But this looks horrible..
Thanks for any advice!
included.It's my first jsp project so I've got some - probably basic
-questions.
A jsp page is divided in some areas like content, navigation etc.
Content -as an example - is dynamically included and should display some -
I call them - blocks.
A block is for example an image, a list and a headline. So content can
have 1 to many blocks.
So a page ->content->block->image
I'm using the MVC pattern so my first approach was that my controller
servlets passes to the jsp page an object called model and the jsp page
gets
the data out of it.
Because of the structure this gets very ugly like:
Page onepage = (Page) model.getPage();
and then
(Area) onearea = (Area) onepage.getArea('content');
and so on...
The second problem is how do I pass the needed objects to the includes..?
Actually the jsp-page gets the object and writes it into the request with
setAttribute and the included page pulls them out..
But this looks horrible..
Thanks for any advice!