struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "red phoenix" <rodphoe...@gmail.com>
Subject Re: how to include struts by using <jsp:include page
Date Thu, 12 Jul 2007 02:01:42 GMT
I tried with <c:import>,it still raise a question,I use Tomcat6,my directory
is follows:
C:\tomcat\webapps\struts2-blank-2.0.8

when I use visit
http://localhost:8080/struts2-blank-2.0.8/a.jsp <http://lo>
it raise following error:
The requested resource (/struts2-blank-2.0.8/example/HelloWorld.action) is
not available

But when I use
http://localhost:8080/struts2-blank-2.0.8/example/HelloWorld.action, it can
runs well.

My a.jsp file is follows:
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
<html>
<c:import url="/example/HelloWorld.action"/>
</html>

If I use absolute path,it can runs well,like follows:
<c:import url="
http://localhost:8080/struts2-blank-2.0.8/example/HelloWorld.action"/>

I only want to use relative path,not absolute path,I don't know why raise
above error,and how to correct it ?

Thanks



On 7/12/07, Michael Jouravlev <jmikus@gmail.com> wrote:
>
> On 7/11/07, red phoenix <rodphoenix@gmail.com> wrote:
> > I want to use <jsp:include to load my struts file,such as:
> >    <jsp:include   page="/a1.do"   />
> >   <jsp:include   page="/a2.do"   />
> >
> >
> > but when I run this jsp file,http://localhost:8080/a.jsp,it raise
> > error,it shows it can't find a1.do and a2.do,but when I write follows in
> IE,
> > http://localhost:8080/a1.do, it can show right result.
> >
> > I am puzzled with it.I wan to know if I don't use <jsp:include page?
> >
> > How to include struts in JSP?
>
> I just checked with Tomcat 6 and it worked for me. Seems that your
> Struts app is a root app for your servlet container, I just checked
> it. Can't help you more, sorry.
>
> Important: after you sort out the pathing/context issue, replace
> <jsp:include> with <c:import>, otherwise you may have problems
> including Struts-generated content -- usually a JSP page -- into
> another JSP page.
>
> Michael.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message