struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Laurie Harper <lau...@holoweb.net>
Subject Re: Using jsps from another context
Date Thu, 19 Apr 2007 20:38:46 GMT
Rajesh Gupta wrote:
> Laurie Harper <laurie <at> holoweb.net> 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(PageContextImpl.java:821)
> org.apache.jasper.runtime.PageContextImpl.
> handlePageException(PageContextImpl.java:758)
> 	org.apache.jsp.jsp.common.layout_jspx._jspService(layout_jspx.java:81)
> 	org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
> 	javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
> 	org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
> 	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
> 	javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
> 
> root cause:
> java.lang.ClassCastException
> 	org.apache.struts.util.ModuleUtils.getModuleConfig(ModuleUtils.java:78)
> 	org.apache.struts.util.ModuleUtils.getModuleConfig(ModuleUtils.java:129)
> 	org.apache.struts.util.ModuleUtils.getModuleConfig(ModuleUtils.java:114)
> 	org.apache.struts.taglib.TagUtils.getModuleConfig(TagUtils.java:879)
> 	org.apache.struts.taglib.TagUtils.getModuleConfig(TagUtils.java:867)
> 	org.apache.struts.taglib.html.FormTag.lookup(FormTag.java:708)

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.

L.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message