• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

new, need help!!!

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I installed weblogic 6.1. everything is fine.
then i followed link http://edocs.bea.com/wls/docs61/quickstart/quick_start.html
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("<HTML><HEAD><TITLE>");
out.println(title);
out.println("</TITLE></HEAD><BODY>");
out.println("<H1>" + title + "</H1>");
out.println("<P>This is output from SimpleServlet.");
out.println("</BODY></HTML>");
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="1.0" ?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 1.2//EN" "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">;
<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.
http://localhost:7001/quickStartServlet.
didn't work.
can somebody help me find the problem?
Thanks,
 
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
one small mistake in your xml file.
in the 3rd line
there should not any semicolon ;
"http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">;
remove that and try again.
raj
 
Ranch Hand
Posts: 351
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"not_so_good", welcome to JavaRanch.
Please change your name to comply with the naming policy to which you agreed when you registered.
You can change your name here:
here

You can also find the naming policy here:
http://www.javaranch.com/name.jsp
Thank You!
 
it's a teeny, tiny, wafer thin ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic