• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
  • Knute Snortum
Sheriffs:
  • Liutauras Vilda
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Joe Ess
  • salvin francis
  • fred rosenberger

<asp:Content> equivalent in JSP?

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • 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: 39789
797
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
  • 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.
 
Marshal
Posts: 67340
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Perhaps <c:import>?
 
This guy is skipping without a rope. At least, that's what this tiny ad said:
Sauce Labs - World's Largest Continuous Testing Cloud for Websites and Mobile Apps
https://coderanch.com/t/722574/Sauce-Labs-World-Largest-Continuous
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!