HI Zinger:
answer to this question depends on env conditions
setAttribute method stores the attribute in JVM itself for every session,
while set parameter will pass the attribute as a header information to you
new jsp.
So it all depends on memory available, cpu speed, and no of pages you are
going to use this technique.
Cheers
Hemant
----- Original Message -----
From: "Oskar Zinger" <[EMAIL PROTECTED]>
To: "TomcatDev" <[EMAIL PROTECTED]>;
<[EMAIL PROTECTED]>
Sent: Sunday, June 03, 2001 12:15 AM
Subject: get/setAttribute and getParameter...


> Hi,
> What is more time consuming?
>
> JSP1:
> <% request.setAttribute("FLAG", new Boolean("true")); %>
> <jsp:include page="JSP2.jsp" flush="true"/>
>
> JSP2:
> <% boolean FLAG = ((Boolean)
> request.getAttribute("FLAG")).booleanValue();
>      if (FLAG) {
>        ..........
>        ...........
>      }
> %>
>
> OR?:
>
> JSP1:
> <jsp:include page="JSP2.jsp?FLAG=true" flush="true"/>
>
> JSP2:
> <% String FLAG = request.getParameter("FLAG");
>       if (FLAG.equals('true")) {
>          ..........
>          ..........
>       }
> %>
>
> OR?:
>
> JSP1:
> <jsp:include page="JSP2.jsp?FLAG=true" flush="true"/>
>
> JSP2:
> <% boolean FLAG = (new
> Boolean(request.getParameter("FLAG"))).booleanValue();
>       if (FLAG) {
>          ..........
>          ..........
>       }
> %>
>
>
> AND, which way is it best practiced.
>
> Thankss for any help!
> --
> Oskar Zinger

Reply via email to