• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to change jsp fragment included into another jsp ?

 
Volodymyr Lysenko
Ranch Hand
Posts: 512
1
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello!

I have .jsp file which is included in other jsp files:

As you see it has static <title>. But I want to customize this title for each jsp page.

How to do that in jsp? Should I create my own jsp tag?
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65530
108
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Where would the title data be coming from?
 
Volodymyr Lysenko
Ranch Hand
Posts: 512
1
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
From another jsp page into which this fragment is incuded.

Title is static but different for each page.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65530
108
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Easiest would be to simply set it as a request-scoped variable.

Personally, I rarely include files anymore. Rather, I create tag files which have all the advantages of includes, and can be parameterized.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!