You can, in theory, use scriptlets as often as you like. You may also use the newer "evaluation language" if you have it implemented. Struts doesn't "make" you do anything in this regard, but you'll find that by limiting scriptlets and thinking about how you implement the code, you'll be keeping your business logic away from the page.
Danilo Gurovich
-----Original
Message-----
hi, i am new to struts. my colleagues who are in struts say that i shouldnt use scriptlets in my jsp page where i use struts. but in some situations where the struts tags dont come to our rescue, say in logic situations. then we are compelled to use scriptlets to solve the problem. for ex, i am creating a collection to hold some value in my action class. Also i am setting to a request/session scope a variable which holds a number. in the jsp page i have to iterate using the number used in the request/session scope. but it has to display the collection elements holding the value. for this <logic:iterate isnt helping, or maybe i dont know. but using scriptlets in jsp it became very easy.
My question is can we use scriptlets in struts jsp in such situations or is it mandatory that we shouldnt use scriptlets what ever be the reason regards Srihari
|
- Is scriptlets allowed in struts Srihari
- RE: Is scriptlets allowed in struts Jim Barrows
- Danilo Gurovich