Changes between Version 12 and Version 13 of Web/Servlet


Ignore:
Timestamp:
Oct 27, 2017, 6:20:23 AM (4 years ago)
Author:
vadim.godunko
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Web/Servlet

    v12 v13  
    169169
    170170{{{
    171 with Ada.Text_IO;
    172 
    173171package body My_Servlets is
     172
     173   Text_Encoding : constant League.Strings.Universal_String
     174     := League.Strings.To_Universal_String ("utf-8");
     175   Text_Plain    : constant League.Strings.Universal_String
     176     := League.Strings.To_Universal_String ("text/plain");
    174177
    175178   ------------
     
    182185     Response : in out Servlet.HTTP_Responses.HTTP_Servlet_Response'Class) is
    183186   begin
    184       Ada.Text_IO.Put_Line ("ScissorTruss");
     187      Response.Set_Status (Servlet.HTTP_Responses.OK);
     188      Response.Set_Content_Type (Text_Plain);
     189      Response.Set_Character_Encoding (Text_Encoding);
     190      Response.Get_Output_Stream.Write
     191       (League.Strings.To_Universal_String ("Hello, World!"));
    185192   end Do_Get;
    186193
     
    233240}}}
    234241
    235 and be instantiated in application deployment description file as well as some path needs to be mapped to it:
     242and be instantiated in application deployment description file as well as to map '/my' path to it:
    236243
    237244{{{
     
    259266</web-app>
    260267}}}
    261