1. Directory Structure for your Helloworld servlet :
2. Code:
Note :- Place the source file in WEB-INF/src/test/ directory.
package test;
import java.io.*;
import javax.servlet.http.*;
import javax.servlet.*;
public class HelloServlet extends HttpServlet {
public void doGet (HttpServletRequest req,
HttpServletResponse res)
throws ServletException, IOException
{
out.println("Hello, world!");
out.close();
}
}
3. Configuration Files
Note :- Put the configuration files in WEB-INF directory.
Web.xml :-
4. Compile the servlet code and place in WEB-INF/classes/test/ directory
Make jar (name of jar file : test.jar ) file and upload it on weblogic.
5. URL for accessing the servlet is :
http://localhost:7001/test/hello/
Note :- For any questions you can leave your comments.
Make jar (name of jar file : test.jar ) file and upload it on weblogic.
5. URL for accessing the servlet is :
http://localhost:7001/test/hello/
Note :- For any questions you can leave your comments.
No comments:
Post a Comment