I am using jsp tag libs and have a requirement that on click of an image button that button should be replaced by a separate jsp which is included in current jsp and with in same page contents of that jsp should come but I am facing problem as how can I invoke <jsp:include> directive on click of a button Can any one pls give me suggestion? Thanks in advance
SCJP,SCWCD,SCBCD<br />If Opportunity doesn't knock then build the door
but I am facing problem as how can I invoke <jsp:include> directive on click of a button
You can't - the button is on the user side and jsp:include is on the server side. Perhaps you can keep the included jsp output invisible until the button is clicked using JavaScript. Bill [ September 25, 2004: Message edited by: William Brogden ]
i got the answer we have to refresh jsp on click of button and while refreshing it we put some flag which if true can allow the jsp:include to become active correct me if i am mwrong
SCJP,SCWCD,SCBCD<br />If Opportunity doesn't knock then build the door
The method you have thought is correct one. Use the flag to include another JSP. Another method, to include the JSP content at the very start when this page is loaded, but keep in a hidden div. You can show these contents on the click of that button.
but the first method appears better if the contents/processing on server side for the included JSP is heavy. If it is very small, send one is better, it will aviod the network traffic.
Sanjeev Kaushik
If you open the box, you will find Heisenberg strangling Shrodenger's cat. And waving this tiny ad:
a bit of art, as a gift, that will fit in a stocking