• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Reusing JSPs across applications

 
Ranch Hand
Posts: 230
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello all:

I have been thinking about how I can reuse the same JSPs in different applications . . . if there could be some sort of abstraction or project that my applications could inherit from. Any thoughts on this are welcome.

Thanks
Eric
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
To what end?
Are you trying to save on disk space?
Disk space is pretty cheap and usually not worth the expense you'll put into managing this.

If it's just for code re-use, most people, these days manage this with build tools like ANT or MAVEN.
With tools like these, you can pull resources from where ever you like at build time.
 
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

John Eric Hamacher wrote:Hello all:

I have been thinking about how I can reuse the same JSPs in different applications . . . if there could be some sort of abstraction or project that my applications could inherit from. Any thoughts on this are welcome.

Thanks
Eric


To be sure: are you writing raw Java code in JSP files instead of in Java classes? That would explain this odd question a bit more. If this is indeed the case, then the solution is simple: you should be writing Java code in Java classes, you should never be using scriptlets. This isnĀ“t 1998 anymore.
 
Sheriff
Posts: 67749
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I usually avoid and dislike "me too" posts, but this one is important enough for me to add my voice to the already wise advice given here:
  • Write scriptless JSPs
  • Perform any resource sharing at the build and source control level, not at run-time

  •  
    John Eric Hamacher
    Ranch Hand
    Posts: 230
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Thanks for the responses.

    I have scriptless JSP fragments I want to maintain centrally and use in multiple applications. I didn't literally mean the JSP would be inheriting other JSPs, more like the application projects would be inheriting other projects which have the JSPs to be reused.
     
    Bear Bibeault
    Sheriff
    Posts: 67749
    173
    Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    See Ben's post and my second point.
     
    And when my army is complete, I will rule the world! But, for now, I'm going to be happy with this tiny ad:
    a bit of art, as a gift, the permaculture playing cards
    https://gardener-gift.com
    reply
      Bookmark Topic Watch Topic
    • New Topic