• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Calling a servlet from a JSP page using the J2EE reference implementation

 
Joe Guzzardo
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a JSP with an include tag as follows: <jsp:include page="servlet/ConnectionServlet" flush="true" />
When I use JRUN it works fine. I created an ear file and ported
the application to the J2EE reference implementation. When running the app under the J2EE reference implementation the ConnectionServlet is never called. I figured it must a deployment issue. I tried adding the ConnectionServlet.class file to the WEB-INF\classes file as servlet\ConnectionServlet.class but the JSP still can't find the servlet. Any ideas where I've gone wrong? TIA, Joe
 
wenwei cheng
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can you try <jsp:include page="http://yourdomainname/servlet/ConnectionServlet" flush="true" />
 
Joe Guzzardo
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I quote this from the j2ee guide:
page= "{ relativeURL | <%= expression %> }"
The relative URL that locates the file you want to include, or an expression that evaluates to a String that is equivalent to the relative URL.
The relative URL looks like a pathname-it cannot contain a protocol name, port number, or domain name. The URL can be absolute or relative to the current JSP file. If it is absolute (beginning with a /), the pathname is resolved by your Web or application server.
So I don't think your suggestion will work, but thanks anyway.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic