On Thu, 11 Apr 2002, Peter Pilgrim wrote:

> Date: Thu, 11 Apr 2002 18:10:07 +0100
> From: Peter Pilgrim <[EMAIL PROTECTED]>
> Reply-To: Struts Developers List <[EMAIL PROTECTED]>
> To: [EMAIL PROTECTED]
> Subject: Design questions about the implementation <bean:include>
>
>
> Very simply?  In the code for IncludeTag why could you not
> have used RequestDispatcher.include() to get the content as String?
>

This would be straightforward in a Servlet 2.3 environment, where you can
use a response wrapper to swallow the output.  However, this is expressly
disallowed in a Servlet 2.2 environnment, so you cannot implement this and
remain 2.2-compliant.

> A URLConnection is used to open a socket and effective internally
> read the content from the server.
>
> Does the server know it has a request from the same client?

It would be technically feasible to do this for *most* cases, but it could
get fooled.  The "import" tag in the JSP Standard Tag Library attempts to
optimize the "same application" case, so you might want to investigate
using that if you're on a Servlet 2.3 / JSP 1.2 platform.

>
> Is the HttpSession object shared between the client (IncludeTag) and
> the server?
>

The include tag code (at least in 1.1-beta) sends the session id along, so
it should end up using the same session.

> If this is so true, could transfer information to the URL target with the
> `session.setAttribute()' method ? That is I could do this
> `session.setAttribute( "bestShow", "JavaONE 2002"  ) and the URL target
> could retrieve it with `session.getAttribute("bestShow")'
>
> Is this is an expensive operation? Especially if I have lots of
> <bean:include> elements in a JSP.
>

The Struts tag does go through the network layer, even on the same
machine.

> --
> Peter Pilgrim                       ++44 (0)207-545-9923

Craig


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to