Page 1 of 1
About Question enthuware.jwpv6.2.1233 :
Posted: Sat Feb 02, 2013 4:24 pm
by ETS User
This is wrong. Generating XML in a Servlet is perfectly valid. For example I could create some XML using the object mapping generated with a schema by JAXB -- everything in a neat objective fashion.
Re: About Question enthuware.jwpv6.2.1233 :
Posted: Sat Feb 02, 2013 4:32 pm
by admin
In that case, you are actually using JAXB to generate xml. You are not really writing code such as out.println("<sometag>"+value+"</sometag>"); in your servlet, which is what the question refers to.
HTH,
Paul.
Re: About Question enthuware.jwpv6.2.1233 :
Posted: Sat May 14, 2016 7:28 pm
by himaiMinh
For option 2, "writing code that interacts with the database to fetch data"
I think servlet is not the right place to interact with the database.
The servlet interacts with the business layer which interacts with the DB.
Re: About Question enthuware.jwpv6.2.1233 :
Posted: Sat May 14, 2016 8:22 pm
by admin
From that perspective, interaction with the database should not be done even by the business layer, it is done by the DAO layer.
But that is not the point here. From the exam perspective, you are dealing with JSPs and Servlets. Between these two, servlets are more appropriate for interacting with the database.
HTH,
Paul.