Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

new need help!!

Status
Not open for further replies.

jimlee2003

Programmer
Jun 21, 2002
1
US
I installed weblogic 6.1. everything is fine.
then i followed link to deploy jsp, html and servlet.
jsp and html is fine, but i never get servlet work.
can somebody help me?

my step is:
1.
cd c:\bea\wlserver6.1\config\mydomain\application\DefaultWebApp\WEB-INF

mkdir classes

edit servlet SimpleServlet.java as follow:

import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;

public class SimpleServlet extends HttpServlet
{
/** * Handle the HTTP GET method by building a simple web page. */

public void doGet (HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
{ PrintWriter out;
String title = "Simple Servlet Output";
// set content type and other response header fields first
response.setContentType("text/html");
// then write the data of the response
out = response.getWriter();
out.println(&quot;<HTML><HEAD><TITLE>&quot;);
out.println(title);
out.println(&quot;</TITLE></HEAD><BODY>&quot;);
out.println(&quot;<H1>&quot; + title + &quot;</H1>&quot;);
out.println(&quot;<P>This is output from SimpleServlet.&quot;);
out.println(&quot;</BODY></HTML>&quot;);
out.close();
} }


2.
javac SimpleServlet.java
and then copy SimpleServlet.class to c:\bea\wlserver6.1\config\mydomain\application\DefaultWebApp\WEB-INF\classes


modify c:\bea\wlserver6.1\config\mydomain\application\DefaultWebApp\WEB-INF\web.xml
as follow:

<?xml version=&quot;1.0&quot; ?>
<!DOCTYPE web-app PUBLIC &quot;-//Sun Microsystems, Inc.//DTD Web Application 1.2//EN&quot; &quot;<web-app>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
</welcome-file-list>

<servlet>
<servlet-name>SimpleServlet</servlet-name>
<servlet-class>SimpleServlet</servlet-class>
</servlet>

<servlet-mapping>
<servlet-name>SimpleServlet</servlet-name>
<url-pattern>/quickStartServlet/*</url-pattern>
</servlet-mapping>
</web-app>


3.
start weblogicserver.

didn't work.

can somebody help me find the problem?
Thanks,
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top