• Post Reply Bookmark Topic Watch Topic
  • New Topic

Problems with Reusing JSPs  RSS feed

 
Alec Lee
Ranch Hand
Posts: 569
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We created some JSP fragments and want to reuse them. But the problem is in JSP, the attributes are used everywhere in the page. There is no facility similiar to variable/method argument declaration in Java/C/C++. As a result, given a piece of JSP, we have to scan thru the whole file to dig out all the expected input values (attributes). Is there any simple way to overcome this issue? One approach I can think of is to refactor the JSPs to include scriplet at the beginning to check the existence of expected attributes in the required scope.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65833
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Alec Lee:
There is no facility similiar to variable/method argument declaration in Java/C/C++..


Incorrect. That's what custom tags are all about.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!