This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
If you use struts tags, the bean will be made available to the jsp page, else you have to define it or get it by . or try using the <jsp:useBean>
"Failure is not when you fall down; its only when you fail to get up again."
Joined: Jul 26, 2004
i am now getting the results by using <jsp:usebean>
But when i trying to displaying the value in a button it does not get the result.
eg in a HTML:button tag i got an onclick to go to an action with a id Search.do?test=<%=beanSearch.getValue()%>
(sorry i can't get to paste the code)
Joined: Jan 08, 2003
So now the testVal variable is initialised when the page is loaded and when you click the button it gets the value there.
The problem with the scriptlet is that, unlike the bean tag, it does not automatically go through the context collections to find the referenced bean. That's why you need to use the jsp:usebean tag first in order for the scriptlet to work.
Shankar: When you first get to the jsp page all the scriptlets are processed at the server side and replaced...
No, the scriplets have already been processed by the time the response gets back to the browser. You can "view source" in the browser to verify this.