You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Smith, Johnathan M." <js...@ubspw.com> on 2002/10/17 14:26:42 UTC

Pros and Cons of Hard coding a JSP page in a Struts template vs u sing a parameter?

I would like to know the pros and cons of hard coding a JSP page in a struts
template.

Which struts template is better on speed and memory?

EXAMPLE1
<%@ page language="java" %>
<%@ page import="javax.servlet.http.*" %>
<%@ page import="javax.servlet.jsp.*" %>
<%@ taglib uri="/WEB-INF/struts-template.tld" prefix="template" %>
<%@ taglib uri="/WEB-INF/cdd.tld" prefix="cdd"  %>
<template:insert template="TempTest.jsp">
<template:put name="header" content="header.jsp"/>
<template:put name="navbar" content="navbar.jsp"/>
<template:put name="body" content="JSP/AddVendor.jsp"/>
</template:insert>

EXAMPLE2:
<%@ page language="java" %>
<%@ page import="javax.servlet.http.*" %>
<%@ page import="javax.servlet.jsp.*" %>
<%@ taglib uri="/WEB-INF/struts-template.tld" prefix="template" %>
<%@ taglib uri="/WEB-INF/cdd.tld" prefix="cdd"  %>
<template:insert template="TempTest.jsp">
<template:put name="header" content="header.jsp"/>
<template:put name="navbar" content="navbar.jsp"/>
<template:put name="body" content="<%= request.getParameter(\"body\") %>"/>
</template:insert><HTML>

I would think that example number 1 is better and faster??  From looking at
the source code example 1 is bigger do to a include inline?


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>