This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Struts and the fly likes Struts2 cross context JSP access using c:import throws ClassCastException Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts2 cross context JSP access using c:import throws ClassCastException" Watch "Struts2 cross context JSP access using c:import throws ClassCastException" New topic
Author

Struts2 cross context JSP access using c:import throws ClassCastException

Orton K Randy
Ranch Hand

Joined: Aug 12, 2011
Posts: 41

I have a couple of web apps deployed on the same server. There's a jsp in app1 that I want to access from app2. I enabled cross context access in the tomcat and tried this jstl tag:



The myJSP.jsp uses some struts2 tags itself.

I also made sure the required libraries are on both the app1 and app2's lib directory. During the runtime though, the app2's page won't render and I see this error:

Caused by: java.lang.ClassCastException:
com.opensymphony.xwork2.ognl.OgnlValueStack cannot be cast to
com.opensymphony.xwork2.util.ValueStack at
org.apache.struts2.views.jsp.TagUtils.getStack(TagUtils.java:53) at
org.apache.struts2.views.jsp.StrutsBodyTagSupport.getStack(StrutsBodyTagSupport.java:44)
at
org.apache.struts2.views.jsp.ComponentTagSupport.doStartTag(ComponentTagSupport.java:48)

Any idea why? If I copied the jsp to the app2 and referenced it using the same c:import tag, it works just fine!


Coderanch, best ever forum on the net. Hands down.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Struts2 cross context JSP access using c:import throws ClassCastException
 
Similar Threads
Struts2 java.lang.reflect.InvocationTargetException (Struts2 with Hibernate)
struts2 tiles2 No result defined for action result success
Struts2:Action-validation.xml
struts2 tile 2.2.0
JSON Gridview is not working with struts2