Skip to main content

Posts

Binary search [Data structures]

Binary search is another technique of searching element/item/data in a list or array. In this technique it is mandatory that our given list or array should already be in a sorted manner(Ascending). Otherwise , this algorithm is failed at this situation. It follows divide and conquer approach.

Linear search [Data structures]

Linear search is a technique of searching elements in a list or array. As this name suggest linear, means a sequential searching in this we start searching our desired data/element from the start or initial stage of the list and this searching operation has been stopped at the end of the given list even our element is already found in between of the list it is a disadvantage of this technique but it deals with a unordered or unsorted list.

getInitParameterName() method in ServletConfig Interface [ Servlet ]

To get the name of the servlet which we created for our project you just need to create object of " ServletConfig " Interface. By writing these simple lines you can create an object of ServletConfig Interface and find the servlet name as well : ServletConfig ob = getServletConfig(); String servlet_name = ob.getServletName(); Now simply print " servlet_name " variable and also remember this if it's not working try to convert this variable in string type. Hope your error will remove. Output as:

getInitParameterNames() method in ServletConfig [ Servlet ]

ServletConfig in Servlet

ServletConfig is just only a object created by container itself.When servlet is loaded on the server at that time container make the servletconfig object by which you can simply do any required change in Web.xml file directly without disturbing any specific servlet. All the configurations can directly change by manipulating in a web.xml file there is no need to modifications in relevant servlet class file. ServletConfig is a interface actually who's object is created by container. by using that object we can do various changes in a servlet files without even touching that servlet file. There are 4 methods available in this interface as: 1 > getInitParameter(); 2 > getInitParameterNames(); 3 > getServletName(); 4 > getServletContext();