• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Can JSPs embedded in other jsp ?

 
nirjari patel
Ranch Hand
Posts: 386
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you embed 5 JSPs in one parent JSP ? So in total there are 6 jsp.
Parent jsp acts like a frame in which 5 jsp are embedded taking care of particular area ? Is it possible to do like this ?
 
Shailesh Chandra
Ranch Hand
Posts: 1082
Java Oracle Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I do not know , what your requirements are...

But answer is Yes, I had embed up to 4 jsps in on parent Jsps sometime back in 2002.

I used the below tag for same



remember your embed jsp can not use anything available in parent jsp.


Shailesh
 
amit punekar
Ranch Hand
Posts: 544
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
There are frameworks like Tiles, that promotes use of various JSP used as tiles to create a web page.
You can also use <jsp:include> action or include directives to do that.

 
Raghavan Muthu
Ranch Hand
Posts: 3381
Mac MySQL Database Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There are two ways.

1. JSP Include Directive (<include ..>)
2. JSP Include Action (<jsp:include>)

There is a difference between these two. JSP Include directive includes the files at compilation time and hence any dynamic changes in the included file will not be reflected. Whereas the jsp:include action does include the file at runtime (on demand) so it guarantees to reflect the changes you do in the included file even after starting the container!
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65335
97
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There are also many other possibilities. Without more details it's impossible to recommend one.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic