• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Reoccurring HTML Block

 
Drew Lane
Ranch Hand
Posts: 296
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am wondering if anyone has a suggestion on how to best handle this situation:
I've got a reoccuring block of HTML that needs to be displayed in my JSP page (or servlet). The number of occurances of this block of HTML will depened upon a varialble that is received by the page.

So my question is this - what is the best way to store this block of HTML? Should I store it as JSP file and do a JSP include as needed?
One more twist: There are a few variables in each HTML block that may change with each occurance, so I am not sure if I can change those variables using the include method mentioned above.
Thanks!
Drew
 
Bhuvana Madhav
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can very well have that specific block of html as a jsp file and include it in the main page.The variables avaliable in the main jsp will be avaliable in the include jsp too. so you wont have any pbm in changing the values in yr include file.
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
pbm? yr?
Anyway, you can open and close scriptlet tags inside a loop if you want:

Not very pretty but is this what you're (yr?) looking for?
Dave.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic