You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by Peter Pilgrim <pe...@db.com> on 2002/04/11 19:10:07 UTC

Design questions about the implementation

Very simply?  In the code for IncludeTag why could you not
have used RequestDispatcher.include() to get the content as String?

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?

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

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.

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

............................................ Swamped under electronic mails


--

This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden.



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


Re: Design questions about the implementation

Posted by "Craig R. McClanahan" <cr...@apache.org>.

On Thu, 11 Apr 2002, Peter Pilgrim wrote:

> Date: Thu, 11 Apr 2002 18:10:07 +0100
> From: Peter Pilgrim <pe...@db.com>
> Reply-To: Struts Developers List <st...@jakarta.apache.org>
> To: struts-dev@jakarta.apache.org
> 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:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>