This week's book giveaway is in the HTML/CSS/JavaScript forum.
We're giving away four copies of Practical SVG and have Chris Coyier on-line!
See this thread for details.
Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Problems with Reusing JSPs

 
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: 65542
110
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.
 
And then we all jump out and yell "surprise! we got you this tiny ad!"
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!