Hi friend,
As per your problem following points to help in create a weblogic application.
1)Install the WebLogic Server and the Eclipse IDE.
2)Develop a servlet application to run the WebLogic Server.
3)Create a servlet file HelloWorld.java which print "Hello World".
package webservlet;
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class HelloWorld extends HttpServlet {
public void doGet(HttpServletRequest request,
HttpServletResponse response)
throws ServletException, IOException {
PrintWriter out = response.getWriter();
out.println("Hello World");
}
}
4)Create a directory structure for a Web application.
a)Create a WEB-INF directory.
b)Create a classes directory in the WEB-INF directory.
c)Create a web.xml deployment descriptor in the WEB-INF directory for the Web application.
5)The Directory Structure of WEB-INF.
/WEB-INF
| |
web.xml classes
|
webservlet
|
HelloWorld.class
6)Create bulid.xml and web.xml in WEB-INF directory.
Web.xml
.....................................
<servlet>
<servlet-name>HelloWorld</servlet-name>
<servlet-class>webservlet.HelloWorld</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>HelloWorld</servlet-name>
<url-pattern>/helloWorld</url-pattern>
</servlet-mapping>
</web-app>
......................
build.xml
.......................
<target name="compile" depends="init">
<javac debug="true" classpath=""
srcdir="${src}/WEB-INF/classes" destdir="${src}/WEB-INF/classes">
<include name="**/*.java" />
</javac>
<copy todir="${build}/WEB-INF">
<fileset dir="WEB-INF" >
<include name="web.xml" />
</fileset>
</copy>
<copy todir="${build}/WEB-INF/classes">
<fileset dir="${src}/WEB-INF/classes" >
<include name="**/HelloWorld.class" />
</fileset>
</copy>
</target>
<target name="weblogicapplication" depends="compile">
<war basedir="${build}" includes="**/*.class"
destfile="${dist}/helloworld.war" webxml="WEB-INF/web.xml"/>
<copy file="${dist}/helloworld.war" todir=""/>
</target>
........................
7)Develop an build.xml file having Targets.
8)Compile the HelloWorld.java and package and deploy the helloworld.war Web application in the Eclipse IDE with an Ant build.xml .
9)Right-click on the build.xml file and select Run then Ant Build.
10)The Web application .war file helloworld.war created and is deployed to the WebLogic 8.1 Application Server applications directory.
11)Start the WebLogic Server with the bin/run script.
12)The URL
http://localhost:7001/webservlet/HelloWorld13)The HelloWorld Servlet runs in the WebLogic Server
14)output display in the browser.
Thanks.