Skip to main content

Posts

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();

Create Servlet in a Eclipse

How to do it ? You just need to click on the create new file and select automatically suggested servlet. After click on this you find a dialog box is open in your system where you need to give your desired name of your servlet class. Click on next and select your method doGet & doPost whatever you're using in your html/jsp form. Now your servlet class is created successfully. New File-->Servlet-->select methods (doGet/doPost)-->Next/Finish.

Java Development Kit Released

List of versions of java development kit (JDK). Basically java has various JDK versions as mention in below table. Java SE Version Version Number Release Date Java SE Version Version Number Release Date JDK 1.0 (Oak) 1.0 January 1996 JDK 1.1 1.1 February 1997 J2SE 1.2 (Playground) 1.2 December 1998 J2SE 1.3 (Kestrel) 1.3 May 2000 J2SE 1.4 (Merlin) 1.4 February 2002 J2SE 5.0 (Tiger) 1.5 September 2004 Java SE 6 (Mustang) 1.6 December 2006 Java SE 7 (Dolphin) 1.7 July 2011 Java SE 8 1.8 March 2014 Java SE 9 9 September, 21st 2017 Java SE 10 10 March, 20th 2018 Java SE 11 11 September, 25th 2018 Java SE 12 12 March, 19th 2019 Java SE 13 13 September, 17th 2019...

Creating first program in java

It is very simple to write your first java code. Are you worried about how to do this ?. In this topic we are discussing about the basic syntax or terms used to write simple java program. You simply just follow the steps one by one as we did in our example. Don't worry if you don't understand the term used in it, Later we discuss each term on one by one. Steps to write program   Open any text editor like Notepad,Notepad++,TextEdit etc. Write the code as shown below. [ You can copy or paste it in your editor ]. After writing this code save it, with the name as " learningbyte.java " After saving the code go to that directory wherever you saved your java file in your computer. [ Your file location may be different from our example, so follow your directory].   Note:-To run this code , open cmd prompt and type as written below ! 1) File name (cmd) : javac learningbyte.java   2) Class name (cmd): java demo

Introduction to Java

  Java is developed by " James Gosling " and it is developed at Sun Microsystems Inc . Patrick Naugton and Mike Sheridon helps to developed java in Sun Microsystems Inc in 1991. It took 18 months to develop first working version. The initially java was named as "Oak" but later it is renamed as Java in 1995 as Oak was registered trademark of another company. Java is a high-level programming language. And it is compatible to run on variety of platforms like Windows , Linux ,Mac etc. Basically java has three different versions like In this tutorial we are going to learn about core java (J2SE) version only ! History of Java. The history of Java is very interesting. Java was originally designed for interactive television, but it was too advanced technology for the digital cable television industry at the time. The history of Java starts with the Green Team. Java team members (also known as Green Team), initiat...