• Post Reply Bookmark Topic Watch Topic
  • New Topic

<asp:Content> equivalent in JSP?  RSS feed

 
Jeff Tanner
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?
 
Jeanne Boyarsky
author & internet detective
Sheriff
Posts: 36457
460
Eclipse IDE Java VI Editor
  • 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.
 
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
Perhaps <c:import>?
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!