Chris wrote:

If you're using JSTL in struts all the object will be available without drilling through the scopes.



How JSTL and Struts communicate each other?
Could anybody please explain this *mysterious* thing detailly?
I really want to know the black box behind JSP using JSTL


and Struts taglibs , but the servlet code compiled from JSP is too hard to explore.


The main points are that Struts puts form beans into either the session or request scope depending on what you configure struts to do.
The JSTL looks through the different scopes in order for the bean name. So the way to tie JSTL and Struts together is to know what the name of the bean that Struts has put into the scope.


From struts-config.xml you might have:

<form-bean name="myFormBean" type="com.my.form.myFormBean" />

When this is used with an action it is put into the session/request scope under the name 'myFormBean'
So to use it in JSTL you can just use ${myFormBean.abc} to access the myFormBean.getAbc() property.


Regards.
Chris

----- Original Message ----- From: "Mark Lowe" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Saturday, September 25, 2004 11:29 PM
Subject: Re: JSTL problem





If you're using JSTL in struts all the object will be available without drilling through the scopes.

In straight JSTL you'd use sessionScope. But as you're using struts you dont need to and you can decide what you want to scope to in you java or configuration of the ActionServlet..

HTH Mark

On 25 Sep 2004, at 15:27, M. Onur Tokan wrote:





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






--
Jason Lea




Reply via email to