Hi Tim,
On Tue, 13 Jul 1999, Tim Trentham wrote:
TT| I'm trying to implement the ParameterPropagatingSSI servlet and am not
TT| getting the results that I expected.
Your configuration looks fine so far, but you try to use the servlet in a
different way than it is meant for.
ParameterPropagatingSSI just propagates parameters which are given in the
GET or POST request of the page. It does _not_ evalutate the session
itself or any parameters given to it (tcount).
Since the session idntifier from JServ (JServSessionId) is given as GET
parameter if cookies doesn't work, this mechanism works to propagate
the JServ-session as well.
To test this, just call
propagate.jhtml?tcount=12
of your example, and you'll see that the link to propagate2.jhml will be
rewritten.
To rewrite URLs _whithin_ your own servlets:
TT| // get current session object, create one if necessary
TT| HttpSession session = req.getSession(true);
[...]
TT| out.println("<P>");
TT| out.println("This <A HREF=\"propagate.jhtml\">link</A>is
TT| generated by the same servlet as the session.");
You've call HttpServletResponse.encodeUrl(), because
ParameterPropagatingSSI does _not_ take care about the output of embedded
servlets. Note, that encodeUrl() just encodes the Url, if cookies are
disabled in the browser.
So - if you call encodeUrl() here, the propagate.jhtml-link gets rewritten
to hold the JServSessionId as GET-parameter which then works like the
example above. Note that tcount never becomes a rewritten GET-parameter
since it is a value maintained in your session.
With ParameterPropagatingSSI you're not lost if you use sessions together
with jhtml-fils and the client happens to have cookie support switched off
- if you use the encodeUrl() in you own servlets where necessary.
Hope this helps and sorry if the orignal documentation of JSSI wasn't
clear enough ..
ciao,
-hen
---
Henner Zeller [EMAIL PROTECTED]
PGP pub key [77F75B39]: finger [EMAIL PROTECTED]
If Microsoft is the answer, it must have been a VERY silly question.
--
--------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
READ THE FAQ!!!! <http://java.apache.org/faq/>
Archives and Other: <http://java.apache.org/main/mail.html/>
Problems?: [EMAIL PROTECTED]