aspose file tools*
The moose likes Servlets and the fly likes Calling a servlet from a JSP page using the J2EE reference implementation Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Calling a servlet from a JSP page using the J2EE reference implementation" Watch "Calling a servlet from a JSP page using the J2EE reference implementation" New topic
Author

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

Joe Guzzardo
Ranch Hand

Joined: Mar 14, 2000
Posts: 57
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

Joined: Jul 12, 2001
Posts: 5
can you try <jsp:include page="http://yourdomainname/servlet/ConnectionServlet" flush="true" />
Joe Guzzardo
Ranch Hand

Joined: Mar 14, 2000
Posts: 57
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Calling a servlet from a JSP page using the J2EE reference implementation