struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Laurie Harper <>
Subject Re: Using jsps from another context
Date Thu, 19 Apr 2007 20:38:46 GMT
Rajesh Gupta wrote:
> Laurie Harper <laurie <at>> writes:
>> Rajesh Gupta wrote:
>>> Hi All,
>>>      I have several common jsp's in a common webapp, which will be shared
>>> by all other web applications. I use <c:import> tag to include jsp's from
>>> this common webapp. I can include jsp's , if they do not contain any struts
>>> specific things. But when i try to include a jsp with struts action (ex:
>>> <html:form action="search" method="get">) , it fails. Is it possible to
>>> include a jsp with a struts action in it from another web application. Any
>>> ideas, suggestions please?.
>>> I am using struts 1.2.4 & tomcat 5.0.
>> There's no provision in the JSP or Servlet spec for using resources in 
>> one web app from a different web app, so what does or doesn't work in 
>> this scenario is going to be a question of experimentation...
>> How exactly is it failing? What is the error you're getting? Does the 
>> page you're trying to include work if you call it directly (i.e. load it 
>> in your browser)?
>> Since what you are trying to do is non-standard, you'll need to be as 
>> detailed as you can about any problems you're facing.
>> L.
> Hi,
>     Thanks for the replay. Include work if i call it directly. Included jsp
> works successfully, if no struts actions in it. This is the exception i am
> getting when include jsp with struts action in it.(ex: <html:form
> action="search" method="get">)
> exception:
> javax.servlet.ServletException: javax.servlet.jsp.JspException: null
> org.apache.jasper.runtime.PageContextImpl.
> doHandlePageException(
> org.apache.jasper.runtime.PageContextImpl.
> handlePageException(
> 	org.apache.jsp.jsp.common.layout_jspx._jspService(
> 	org.apache.jasper.runtime.HttpJspBase.service(
> 	javax.servlet.http.HttpServlet.service(
> org.apache.jasper.servlet.JspServletWrapper.service(
> 	org.apache.jasper.servlet.JspServlet.serviceJspFile(
> 	org.apache.jasper.servlet.JspServlet.service(
> 	javax.servlet.http.HttpServlet.service(
> root cause:
> java.lang.ClassCastException
> 	org.apache.struts.util.ModuleUtils.getModuleConfig(
> 	org.apache.struts.util.ModuleUtils.getModuleConfig(
> 	org.apache.struts.util.ModuleUtils.getModuleConfig(
> 	org.apache.struts.taglib.TagUtils.getModuleConfig(
> 	org.apache.struts.taglib.TagUtils.getModuleConfig(
> 	org.apache.struts.taglib.html.FormTag.lookup(

That doesn't surprise me. You *might* be able to work round that by 
moving the Struts jar (and its dependencies) to a common lib directory. 
Of course that may cause problems in itself, as that's an unsupported 
and not-recommended practice.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message