This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
I have one JSP wherein user needs to enter some data before hitting the submit button. The name of my JSP is ProcessData.jsp. In my ProcessData.jsp I want to handle the onload event of the JSP so I place,
body onload "processResult"
The function processResult was called during the first time the ProcessData.jsp was called.
Then after hitting the submit button, my action class will validate the required data. If any data is not entered correctly, I render my action class to forward it to action mapping of ERROR. But in this case, it will just forward to the same JSP(ProcessData.jsp).
Here's my struts-config.xml.
But my problem is, the onload event was not called so I can't alert the user for some error.
I have tried doing this in my servlet using RequestDispatcher then forward both the request and response object and the onload event was called accordingly. But I am trying to learn Struts.
Can I do it this way? thanks.
Sean Clark ---> I love this place!!!
Me ------> I definitely love this place!!!