I'm sure this question has been asked many times in this forum but my searching has not revealed a concrete answer for me.
I have a JSP that has several enterable fields, all of which are to be used to build an XML document to be written on a directory on a server. This same JSP page has a HTML "Submit" button tag that has an "on-click" event handler code. When the user enters data into all of those fields and clicks the submit button, I would like to call a POJO, sending to it all of the data elements that were entered in those enterable fields and have that POJO create and write out the XML file.
I'm sure there must be a way to complete such a fundamental process, but I cannot find a solution.
Yes, within a JSP you can call a POJO type method.
In the above code, you have a java method called printStatusInfo that takes a request and can return a String. It can return an XML string that you can alert to the screen to validate you are working properly.
justin chin wrote:Yes, within a JSP you can call a POJO type method.
And, scriptlets have been discredited for almost 10 years now, please do not encourage their use,.
Joined: Jun 22, 2011
3. You can use a JSPF to contain the java code "methodName" that can access the Web App Server Java layer to keep things a little cleaner. This of course then can access anything you can imagine including POJO's.
This probably isn't the recommended way to solve this solution, but this answers you question directly.
justin chin wrote:
Your misunderstanding of how JSP works can be addressed by reading this article.
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com