![]() ![]() ![]() ![]() Head back up to the project root directory with this command: This is made possible by declaring a PrintWriter object named out to send character text to the client in default ISO-8859-1 value. The function ends with two println statements to display the string messages to the web application. Within the overridden function, setContentType is used to specify the response sent to the client in text and HTML format. Additionally, the service uses the HttpServletResponse object to access HTTP headers and cookies when sending a response. ![]() The doGet() service takes in an HttpServletRequest object parameter to provide request information for the HTTP servlet. This one is overridden to support an HTTP HEAD request. The class is initialized with a variable that will be used and displayed later on the web page.Ī doGet() function is called to allow the servlet to handle GET requests. Notice that the newly created class HelloWorldServlet inherits the attributes and methods from the HTTPServlet class so that the Java application can use HTTP specific implementations. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |