passing objects through jsp:include

Hi all

My jsp page gets an java Object from a request attribute. This page also include another jsp using jsp:include. I would like to pass this request attribute to the included jsp page.

Is it possible. If it could be done with ,<bean:include> all the better....

Thnks in advance for any help

Jubs

[337 byte] By [--jubs--a] at [2007-10-2 10:26:24]
# 1
Use HTTPSession
pazhanikanthana at 2007-7-13 2:06:09 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2

Hi pazhanikanthan

I tried that but it seems <html:message> in struts searches for messages in the request object and not in the session. The real deal is that I want to pass ActionMessages to an included page on the original page. saveMessage() only saves to the request object I think....

By the way why cant a included page not get a the request attributes of the original page?

let you know if i find something.

jubs

--jubs--a at 2007-7-13 2:06:09 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3
A JSP:include is like new Request to the Resource. Obviously the Request attributes cannot be reused.
pazhanikanthana at 2007-7-13 2:06:09 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 4

>A JSP:include is like new Request to the Resource

No, that is incorrect.

a jsp:include is equivalent to a call to requestDispatcher.include(request, response). It is purely internal (ie the web browser knows nothing about it)

It uses the same request/response objects as the jsp/servlet that is including the target.

setting request attributes should be sufficient.

evnafetsa at 2007-7-13 2:06:09 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 5
Yes you should be able to share stuff between JSPs by using request attributes. You wil only get into trouble if there is a redirect in there.
dominic1976a at 2007-7-13 2:06:09 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...