How would I create an xml document from a jsp page.So if a person signs up [ie reg page], how would i get those fields,so lets age, race,fname and get that info and turn it into an xmldocument?
I would have a servlet that would create the XML.1) Specify a URL in the action part of the form in the JSP(e.g.<FORM ID=mainform ACTION="/createxml" METHOD="post"><input type=text name=age><input type=text name=fname><input type=text name=lname><select name=race><option value=1>White</option><option value=2>Black</option><option value=3>Hispanic</option></select></FORM>2) Create a servlet (e.g. CreateXMLServlet.java) that gets the formdata from the JSP via the HTTPRequest object in the doPost method ofthe servlet. Put the servlet in <webapproot>/WEB-INF/classes/servlets/e.g.package servlets;...void doPost(HTTPRequest request ...) {...String age = request.getParameter("age");String fname = request.getParameter("fname");String lname = request.getParameter("lname");String raceID = request.getParameter("race");// Create xml document from this data3) Add a servlet to URL mapping in your <webapp-root>/WEB-INF/web.xmlfile.<servlet><servlet-name>createxml</servlet-name><servlet-class>servlets.CreateXMLServlet</servlet-class></servlet><servlet-mapping><servlet-name>createxml</servlet-name><url-pattern>/createxml</url-pattern></servlet-mapping>