• 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

Can't identify servlet in jsp (ear)weblogic

 
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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>
 
Ranch Hand
Posts: 572
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
author
Posts: 3892
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I solved this problem.
It was my mistake..
I copied servlet in wrong archive
 
Would you turn that thing down? I'm controlling a mind here! Look ... look at the tiny 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