• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

@webServlet is not working in weblogic10.3

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
@webServlet was not supported by servlet application. the page cannot be displayed without web.xml. but it takes init- params in @webServlet.can anybody help me . i'm using weblogic server 10.3
 
Ranch Hand
Posts: 98
Oracle Redhat
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try using @WLServlet annotation, its the annotation used to register Servlets in WebLogic Server.

For ex: The following annotation, placed
at the top of the SimpleServlet source file, eliminates the need for web.xml entries for this servlet:

@WLServlet (
name = "SimpleServlet",
mapping = {"/simple"}
)
public class SimpleServlet extends HttpServlet
{
...
}
 
suganandan sundaresan
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Mr.Anandraj for your kind Reply
but the thing was @WLServlet can't be resolved, what package should i want to import for using this.
i imported import javax.servlet.annotation.*;
but it was not regconized. please help me if you know the solution.
here is my Program

***************************
import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.ServletException;
import javax.servlet.annotation.*;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@WLServlet(name="HelloAnnotationServlet", mapping={"/simple"})


public class HelloAnnotationServlet extends HttpServlet {

@Override
protected void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException {
resp.setContentType("text/html");
PrintWriter out = resp.getWriter();
out.write("<h2> Welcome to the world of servlet annotation </h2>");
out.write("
");
out.close();
}


}

Thanks & Regards
suganandan
 
anandraj tadkal
Ranch Hand
Posts: 98
Oracle Redhat
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try to import "weblogic.servlet.annotation.WLServlet" class


 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
    Bookmark Topic Watch Topic
  • New Topic