Win a copy of Node.js Design Patterns: Design and implement production-grade Node.js applications using proven patterns and techniques this week in the Server-Side JavaScript and NodeJS forum!
  • 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
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

<asp:Content> equivalent in JSP?

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi

I am typically an ASP.NET programmer, and I am familiar with ASP masterpages.

Because, I also know Java, I was handed a JSP project.

I am looking for an equivalent to <asp:Content> whereby I can wrap multiple lines of code/HTML between the open and close tag; for example like so:



However, the closest thing I found is <jsp:param name="param_title" value="param_value" /> , but this is an inconvient solution because the param needs to be inclosed within double quotes, whereby multiple lines of code/HTML will need be a series of concatinated strings.



Ideas?
 
author & internet detective
Posts: 40747
827
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Jeff,
Welcome to JavaRanch!

It looks like asp:content is used to include a piece of a web page located elsewhere. (I state this because I don't know ASP and found that out based on two minutes of searching. If my understanding is flawed, you'll know.)

JSP has includes where you can include a jspf (JSP Fragment). The jspf is a separate file containing part of a JSP. Your few lines could go in there.

Masterpages looks like a templating technology where you specify the master layout once and what goes in each spot elsewhere. Apache has a project called Tiles which does this.
 
Sheriff
Posts: 67592
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
Perhaps <c:import>?
 
reply
    Bookmark Topic Watch Topic
  • New Topic