Skip to main content

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:

Comments

Popular posts from this blog

Conversions of LocalDate , LocalTime and LocalDateTime.

Getting values from joda Date & Time API in java 8