• Post Reply Bookmark Topic Watch Topic
  • New Topic

Servlet not found using <jsp:include  RSS feed

 
Mat Anthony
Ranch Hand
Posts: 262
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I'm attempting to call a servlet that is deployed on a different server to my jsp.
The call is being initiated from within a jsp using the following:-

<jsp:include page="<%=servletURL%>" flush="true" >
<jsp:param name="fullDebug" value="<%=turnOnFullDebug%>" />
</jsp:include>

servletURL contains the following:-

servletURL="http://"+serverIPAddress+":"+serverPort+"/applicationDeployedName/ServletName";

I get the following error:-

java.lang.IllegalArgumentException: Resource /test/admin/http://serverIPAddress:serverPort/applicationDeployedName/ServletName?fullDebug=Y not found

How can I get this detect the servlet?

Please note that my jsp is located under public-html/test/admin/

Mat
 
Ankit Garg
Sheriff
Posts: 9610
37
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The jsp:include action is used to include resources from the same web application. if you want to include a resource from a different web application, then use <c:import>.

This has got nothing to do with servlets. Please take time to Carefully Choose One Forum when you start a topic. Moving to JSP forum...
 
Mat Anthony
Ranch Hand
Posts: 262
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ankit,
tried the <c:import as follows:-

><c:import url="<%=servletURL%>">
<c:param name="fullDebug" value="<%=turnOnFullDebug%>" />
</c:import>


Got the following error:-
javax.servlet.jsp.JspTagException: /opus_tests/ws/<%=servletURL%>?fullDebug


Not sure why <%=servletURL%> is not seen


MatD
 
Nishan Patel
Ranch Hand
Posts: 689
Eclipse IDE Java Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If possible put your JSP code to get clear idea about your servletURL and other value.
 
Mat Anthony
Ranch Hand
Posts: 262
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Nishan,
will this do

<%@ taglib prefix='c' uri='http://java.sun.com/jstl/core'%>

<%
String servletURL=servletLocation+"/testServlet";
%>

servletURL=<%=servletURL%>

<c:import url="<%=servletURL%>">
<c:param name='fullDebug' value='<%=turnOnFullDebug%>' />
</c:import>

Mat
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!