Data packaging and XSLT parsing data in servlet applications
I wrote a small web application today: a simple landing interface (HTML), enter the user's name and mailbox. You can then click Submit. The submitted interface is a welcome interface - display the name of the user and the mailbox. This implementation process does not involve access to the database.
Let me talk about my realization.
1. Get the data entered from the landing interface, construct a subclass of Javax.serveT.Filter to process (package) to get data, use the Document instance (DOM) in org.w3c.dom package to package this data, and put These data is placed in the instance of HTTPSession
2. In the LoginServlet (subcategory of javax.servlet.http.servlet), use the previously write XSLT file to parse the Document object (DOM) in the HTTPSession instance, and send the resolution result to response.getwriter (), users Seeing that the original window is converted into a successful window to display the information you just entered.
This is an example of a combined with the servlet, as well as XML and XSLT.