Posts

Showing posts with the label Java

The javax.servlet Package

The javax.servlet package contains a number of interfaces and classes that establish the framework in which servlets operate. The most significant of these is Servlet. All servlets must implement this interface or extend a class that implements the interface Interface Description Servlet Declares life cycle methods for a servlet. ServletConfig Allows servlets to get initialization parameters ServletContext Enables servlets to log events and access information about their environment. ServletRequest Used to read data from a client request. ServletResponse Used to write data to a client response. The following table summarizes the core classes that are provided in the javax.servlet package: Class Description GenericServlet Implements the Servlet and ServletConfig interfaces. ServletInputStream Provides an input stream for reading requests from a client.

Servlet API

Two packages contain the classes and interfaces that are required to build servlets. javax.servlet javax.servlet.http These packages are the standard extensions provided by Tomcat. Hence, these are not included in Java 6. Please follow the links for more information.

Failed to load Main-Class manifest attribute from HelloWorld.jar - SOLVED

Image
When i try to compile a jar file using the below command in command prompt, java -jar HelloWorld.jar i got an error like Failed to load Main-Class manifest attribute from HelloWorld.jar This is due to the missing launch configuration.  The Main-Class header needs to be in the manifest for the JAR file - this is metadata about things like other required libraries. See the  Sun documentation  for how to create an appropriate manifest. Simply, i followed the eclipse for exporting the jar file instead of remembering all the commands. and choose as specified below. and choose the following options below. 1. Choose your class that contains MAIN method. 2. Choose the destination of Jar file 3. Once, one and two steps are done, Click Finish. Now run the same command via command prompt,  java -jar HelloWorld.jar This will not throw an