Thanks Tim, for your help. Really appreciated. I have resolved this issue. It
was that the name the contact.jsp was using to find the template was wrong.
didnt know it had to be relative to the root directory of the application. I
assumed it will c since they were both sitting in the same directory.
i changed it to /pb/contact_tmpl.jsp and worked.
The good side is that, i now dont use stripes as a magic software that just
works. I have gained understanding in its inner workings which is a very
valuable knowledge for me.
cheers
From: [EMAIL PROTECTED]
To: [email protected]
Date: Thu, 3 Jul 2008 05:52:58 +0100
Subject: Re: [Stripes-users] Forwarding to a jsp that uses stripes taglib
from a filter(Its a bug)
Sorry, it was overnight here in Uk, so I was asleep when u replied. sorry for
the delay. Right i will show all four pages involved in this process
1. the rewrite rule is this
<rule>
<from>^/$</from>
<to>/pb/home.jsp</to>
</rule>
<rule match-type="wildcard">
<from>/*</from>
<to>/pb/$1.jsp</to>
</rule>
<rule match-type="wildcard">
<from>/do/lk/*</from>
<to>/action/$1.action</to>
</rule>
the second rule is what am intrested in most
2. web.xml
<filter-mapping>
<filter-name>UrlRewriteFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>StripesFilter</filter-name>
<url-pattern>/*</url-pattern>
<dispatcher>REQUEST</dispatcher>
<dispatcher>INCLUDE</dispatcher>
<dispatcher>FORWARD</dispatcher>
</filter-mapping>
<filter-mapping>
<filter-name>StripesFilter</filter-name>
<servlet-name>StripesDispatcher</servlet-name>
<dispatcher>REQUEST</dispatcher>
<dispatcher>FORWARD</dispatcher>
<dispatcher>INCLUDE</dispatcher>
</filter-mapping>
thought only the filter mappings are important
3.contacts.jsp
<%@ taglib prefix="s" uri="http://stripes.sourceforge.net/stripes.tld" %>
<s:layout-render name="contacts_tmpl.jsp" title="Contact Us">
</s:layout-render>
4. contacts_tmpl.jsp
<%@ taglib prefix="d" uri="http://stripes.sourceforge.net/stripes-dynattr.tld"
%>
<%@ taglib prefix="s" uri="http://stripes.sourceforge.net/stripes.tld" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<s:layout-definition>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>Our Promises</title>
<link href="../css/style.css" rel="stylesheet" type="text/css" />
<link href="../css/layout.css" rel="stylesheet" type="text/css" />
<script src="../js_lib/rollover.js" type="text/javascript"></script>
</head>
<body id="page1"
onload="MM_preloadImages('../images/tmpl/but_1_act.gif','../images/tmpl/but_2_act.gif','../images/tmpl/but_3_act.gif','../images/tmpl/but_4_act.gif','../images/tmpl/but_5_act.gif','../images/tmpl/but_6_act.gif')">
<div id="site_center">
<div class="tall_top">
<div class="tall_bottom">
<div id="main">
<!-- header -->
<div id="header">
<div class="row_1">
<div class="column1">
<div class="indent">
<h1>Generalex</h1>
</div>
</div>
<div class="column2">
<div class="indent">
<a href="#">Sitemap</a> | <a
href="index-5.html">Contacts</a> | <a href="#">Login</a>
</div>
</div>
<div class="clear"></div>
</div>
<div class="row_2">
<a href="index.html" onmouseout="MM_swapImgRestore()"
onmouseover="MM_swapImage('r_1','','images/but_1_act.gif',1)"><img alt=""
src="images/but_1_act.gif" id="r_1" /></a><img alt="" src="images/spacer.gif"
width="2" height="1" /><a href="index-1.html" onmouseout="MM_swapImgRestore()"
onmouseover="MM_swapImage('r_2','','images/but_2_act.gif',1)"><img alt=""
src="images/but_2.gif" id="r_2" /></a><img alt="" src="images/spacer.gif"
width="2" height="1" /><a href="index-2.html" onmouseout="MM_swapImgRestore()"
onmouseover="MM_swapImage('r_3','','images/but_3_act.gif',1)"><img alt=""
src="images/but_3.gif" id="r_3" /></a><img alt="" src="images/spacer.gif"
width="2" height="1" /><a href="index-3.html" onmouseout="MM_swapImgRestore()"
onmouseover="MM_swapImage('r_4','','images/but_4_act.gif',1)"><img alt=""
src="images/but_4.gif" id="r_4" /></a><img alt="" src="images/spacer.gif"
width="2" height="1" /><a href="index-4.html" onmouseout="MM_swapImgRestore()"
onmouseover="MM_swapImage('r_5','','images/but_5_act.gif',1)"><img alt=""
src="images/but_5.gif" id="r_5" /></a><img alt="" src="images/spacer.gif"
width="2" height="1" /><a href="index-5.html" onmouseout="MM_swapImgRestore()"
onmouseover="MM_swapImage('r_6','','images/but_6_act.gif',1)"><img alt=""
src="images/but_6.gif" id="r_6" /></a>
</div>
<div class="row_3">
<div class="indent">
<img alt="" src="images/slogan.gif" /><br />
<a class="link1" href="#">Learn more info</a>
</div>
</div>
</div>
<!-- content -->
<div id="content">
<div class="row_1">
<div class="col_1">
<a href="#"><img alt="" src="images/1_bann1.jpg" /></a>
</div>
<div class="col_2">
<a href="#"><img alt="" src="images/1_bann2.jpg" /></a>
</div>
<div class="clear"></div>
</div>
<div class="row_2">
<div class="indent">
<div class="wrapper">
<div class="col_1">
<div class="indent">
<div class="line_hor">
<img class="title" alt="" src="images/1_t1.gif"
/><br />
<ul class="ul">
<li><a href="#">Aenean nonum myendrerit</a>
maurihasellus portusce sesucurs ueifriu tibus </li>
<li><a href="#">Morbi nunc odcursu</a> ectus
aloreecenas trisique orci esus eleifeseis</li>
<li><a href="#">Donec accumsan mal esuada</a>
orcec sit ameesus eleifecursum ipsudolo</li>
</ul>
</div>
<h3>Lorem ipsum dolor sit amet, consean nonum
endrerit mauris. Phase llus porta. Fusce suscipit varietugiat malesuer atuer
adipiscindis.</h3>
<p>Aenean nonummyendrerit mauris. Phasellus portusce
susarius mi. Cumiis qutibus et magnis dis partu rientntes, nascetur
ridiculuulla du malda odio. Morbi nudcursu ectus aloreecenas trisiq orcec sit
amet eros.</p>
<p class="p1">Lorem ipsum dolor stuer adipiscing
elit. Ma mentum dictum magned laoreet aliuam leo. Ut tellubus eget, elemesus
eleifend eli Aenean auctor wisi et urnam eratlutpais Integer rutrum ante eu
lacuVestibulum libero nista vel.</p>
<a class="link1" href="#">Learn more info</a>
</div>
</div>
<div class="col_2">
<div class="indent">
<img class="title" alt="" src="images/1_t2.gif" /><br
/>
<a class="link1" href="#"><strong>12 05
2008</strong></a>
<p>Aenean nonummyendrerit maurissellus portusce
susarius mi. Cumiis natopen atibus et magnis dis partu. <a href="#">more</a></p>
<a class="link1" href="#"><strong>12 05
2008</strong></a>
<p>Aenean nonummyendrerit maurissellus portusce
susarius mi. Cumiis natopen atibus et magnis dis partu. <a href="#">more</a></p>
<a class="link1" href="#"><strong>12 05
2008</strong></a>
<p class="p1">Aenean nonummyendrerit maurissellus
portusce susarius mi. Cumiis natopen atibus et magnis dis partu. <a
href="#">more</a></p>
<a class="link1" href="#">Learn more news</a>
</div>
</div>
<div class="clear"></div>
</div>
</div>
</div>
</div>
<!-- footer -->
<div id="footer">
<div class="indent">
<div class="fleft">
Console © 2008 • <a href="index-6.html">Privacy
Policy</a>
</div>
<div class="fright">
<a class="rss_link1" href="#">subscribe</a>
</div>
<div class="clear"></div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>
</s:layout-definition>
this may be overkill, but i'm desperate as this is the last hurdle on this
project. all other stripes pages that do not pass through the rules are happy
From: [EMAIL PROTECTED]
Date: Wed, 2 Jul 2008 18:10:00 -0400
To: [email protected]
Subject: Re: [Stripes-users] Forwarding to a jsp that uses stripes taglib
from a filter(Its a bug)
The code that you have found comes from the LayoutDefinitionTag. This tag
should only ever occur on the page that defines the common layout (not on pages
using that layout). Because of this, certain assumptions are made:
1) Layout JSPs (those using s:layout-definition) are only ever executed by
Stripes, and in fact by the layout-render tag. You should not be forwarding to
those yourself
2) The only way the s:layout-render tag ever executes the layout is via an
INCLUDE
3) Therefore, when used properly, the call to find the include_path should work
just fine
I'm not sure exactly what you're doing differently that is causing this
problem. Can you perhaps show us the JSP that is invoking the layout?
-t
On Jul 2, 2008, at 5:42 PM, Farouk Alhassan wrote: My reading of the servlet
spec shows that, using getAttribute('javax.servlet.include.servlet_path')-which
is the only method used by
net.sourceforge.stripes.tag.layout.LayoutDefinitionTag.doStart() -will work
only if the include was used. since you should be
able to forward to the jsp page before that page invokes the layout-definition
using include, the above method will have a wrong value since the parameter
will not be there. at this point, it will be under
getAttribute("javax.servlet.forward.servlet_path"); I therefore think stripes
should consider this as well since the relegation of the control to the jsp can
come from anywhere.
I dont know how to fix this though
From: [EMAIL PROTECTED]
To: [email protected]
Date: Wed, 2 Jul 2008 19:19:18 +0100
Subject: Re: [Stripes-users] Forwarding to a jsp that uses stripes taglib
from a filter
a short section of my web.xml. the urlRewriter creates the name of the jsp
file requested and forwards to it. Stripes intercepts the forward to do
instantiation before jsp is written
<filter-mapping>
<filter-name>UrlRewriteFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>StripesFilter</filter-name>
<url-pattern>/*</url-pattern>
<dispatcher>REQUEST</dispatcher>
<dispatcher>FORWARD</dispatcher>
</filter-mapping>
<filter-mapping>
<filter-name>StripesFilter</filter-name>
<servlet-name>StripesDispatcher</servlet-name>
<dispatcher>REQUEST</dispatcher>
<dispatcher>FORWARD</dispatcher>
</filter-mapping>
From: [EMAIL PROTECTED]
Date: Wed, 2 Jul 2008 13:48:02 -0400
To: [email protected]
Subject: Re: [Stripes-users] Forwarding to a jsp that uses stripes taglib
from a filter
Do you have the URLRewrite filter mapped only to the REQUEST dispatcher, or
does it also kick in on INCLUDEs? It sounds to me like the Stripes code is
expected to only ever be called through an include, and in this case is not
because something is intercepting in the middle and doing something else. Is
that the case? And if so, is there any need to have the URLRewrite work on
anything except requests coming in from outside the container?
-t
On Jul 2, 2008, at 1:41 PM, Farouk Alhassan wrote: Hi guys, can someone help me
here as i am stack.. a further debugging shows that is definetily null. This
may also be due to the fact the there is
confusion on the value returned by the
String name = (String) getPageContext().getRequest()
.getAttribute('javax.servlet.include.servlet_path'); depending on whether its a
include or a forward
http://www.caucho.com/resin-3.0/webapp/faq.xtp
From: [EMAIL PROTECTED]
To: [email protected]
Date: Wed, 2 Jul 2008 08:07:03 +0100
Subject: [Stripes-users] Forwarding to a jsp that uses stripes taglib from a
filter
I have an intercepting filter that rewrites a url and forwards to the url
(URLrewriter http://tuckey.org/urlrewrite/ )
wrk lik
/contact will be retwritten as /contacts.jsp and forwarded to the jsp. However
the jsp throws a very nice NPE. dont know. a little dig into the stripes
code reveals the execption on this line
// Assuming that the layout definition page is always included, the
following line gets
// the name of the page the tag is sitting on, as per Servlet 2.4 spec,
page 65.
String name = (String) getPageContext().getRequest()
.getAttribute('javax.servlet.include.servlet_path');
what can i do, to get round it. I have attached the stack trace
> -------------------------------------------------------------------------
> Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
> Studies have shown that voting for your favorite open source project,
> along with a healthy diet, reduces your potential for chronic lameness
> and boredom. Vote Now at http://www.sourceforge.net/community/cca08
> _______________________________________________
> Stripes-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/stripes-users
Get Started!
Get Hotmail on your Mobile! Try it
Now!-------------------------------------------------------------------------Sponsored
by: SourceForge.net Community Choice Awards: VOTE NOW!Studies have shown that
voting for your favorite open source project,along with a healthy diet, reduces
your potential for chronic lamenessand boredom. Vote Now at
http://www.sourceforge.net/community/cca08_______________________________________________Stripes-users
mailing [EMAIL PROTECTED]://lists.sourceforge.net/lists/listinfo/stripes-users
Find out how to make Messenger your very own TV! Try it Now!
Win £3000 to spend on whatever you want at Uni! Click here to
WIN!-------------------------------------------------------------------------Sponsored
by: SourceForge.net Community Choice Awards: VOTE NOW!Studies have shown that
voting for your favorite open source project,along with a healthy diet, reduces
your potential for chronic lamenessand boredom. Vote Now at
http://www.sourceforge.net/community/cca08_______________________________________________Stripes-users
mailing [EMAIL PROTECTED]://lists.sourceforge.net/lists/listinfo/stripes-users
Text MSN to 63463 now! Get Messenger on your mobile
_________________________________________________________________
Welcome to the next generation of Windows Live
http://www.windowslive.co.uk/get-live-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
Stripes-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-users