• Post Reply Bookmark Topic Watch Topic
  • New Topic

Can't identify servlet in jsp (ear)weblogic  RSS feed

 
Mike Jeya
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I deployed a ear file Hello.ear..
Hello.jsp is invoking HelloServlet.It calls EJBs.
I can able to see the JSP.
if I submit the page,it couldn't find the servlet.
How can I solve this?
What mistake am I doing?
The structure is
--- _hello.jar
--- _hello.war
--- meta-inf/application.xml
--- meta-inf/Manifest.mf

_hello.jar structure is

--- example/Hello.class
--- example/HelloBean.class
--- example/HelloHome.class
--- example/HelloServlet.class
--- meta-inf/ejb-jar.xml
--- meta-inf/weblogic-ejb-jar.xml
--- meta-inf/Manifest.mf
_hello.war contains
--- Hello.jsp
--- meta-inf/Manifest.mf
--- web-inf/web.xml
web.xml is
----------
<!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>
<servlet>
<servlet-name>HelloServlet</servlet-name>
<servlet-class>example.HelloServlet</servlet-class>
</servlet>

</web-app>
 
Ali Gohar
Ranch Hand
Posts: 572
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Add following in web.xml
<servlet-mapping>
<servlet-name>HelloServlet</servlet-name>
<url-pattern>/helloservlet</url-pattern>
</servlet-mapping>
and use "/helloservlet" url pattern to call the servlet.
 
Kyle Brown
author
Ranch Hand
Posts: 3892
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You must include a URL Mapping in your web.xml to your servlet. URL Mappings are like "street addresses". What you've done, in effect, is build a house and then forget to put a street address on the front. So you can't lookup the servlet from the browser until you do.
Kyle
 
Mike Jeya
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ,
I changed the web.xml like that.
But it is not working
I am not able to figure out what problem is this?
Regards
Mike
 
Mike Jeya
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I solved this problem.
It was my mistake..
I copied servlet in wrong archive
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!