You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Rajesh Gupta <71...@googlemail.com> on 2007/04/18 11:00:15 UTC

Using jsps from another context

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.


Thanks in advance.
Rajesh**

Re: Using jsps from another context

Posted by Laurie Harper <la...@holoweb.net>.
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


Re: Using jsps from another context

Posted by Rajesh Gupta <71...@googlemail.com>.
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)



Thanks
Rajesh






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


Re: Using jsps from another context

Posted by Laurie Harper <la...@holoweb.net>.
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.


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