I'm trying to implement the ParameterPropagatingSSI servlet and am not
getting the results that I expected.
I'm running JServ 1.0 and JSSI 1.1.2 on machine with RedHat 5.2
See excerpts from configuration files and the example that I'm trying to
get to work after my explanation.
I open index.jhtml, the SessionTest servlet is called, generates a new
session and a tcount=1.
Then it basically prints that value twice and also prints a link to
propagate.jhtml. There's also a link already
hard coded into index.jhtml. Neither of these is altered. In addition,
the link in propagate.jhtml is unchanged.
What am I missing? Where does the JServSessionId and any other parameter
get appended?
I've checked the FAQ-O-Matic and read
http://java.apache.org/jservssi/parameterprop.html, along with the
comments in the source code for ParameterPropagatingSSI
I must be missing something silly.
Thanks,
Tim
INDEX.JHTML:
<HTML>
<HEAD>
<TITLE>
Furnitureshow Development Server
</TITLE>
</HEAD>
<BODY>
<SERVLET CODE=SessionTest.class>
</SERVLET>
This <A HREF="propagate.jhtml">link</A> is static content.
</BODY>
</HTML>
PROPAGATE.JHTML
<HTML>
<HEAD>
<TITLE>
ParameterPropagatingSSI Test
</TITLE>
</HEAD>
<BODY>
<A HREF="propagate2.html">Try this link</A>
</BODY>
</HTML>
SERVLET:
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class SessionTest extends HttpServlet {
public void doGet(HttpServletRequest req, HttpServletResponse res)
throws ServletException, IOException {
PrintWriter out = res.getWriter();
// get current session object, create one if necessary
HttpSession session = req.getSession(true);
// increment the hit count for this page, save in client's
session under the name
// tcount
Integer count = (Integer)session.getValue("tcount");
if (count==null)
count = new Integer(1);
else
count = new Integer(count.intValue() + 1);
session.putValue("tcount", count);
// display hit count for this page
out.println("You've visited this page " + count +
((count.intValue()==1) ? " time." : " times."));
String [] names = session.getValueNames();
for (int i = 0; i < names.length; i++) {
out.println(names[i] + ": " + session.getValue(names[i]) +
"<BR>");
}
out.println("<P>");
out.println("This <A HREF=\"propagate.jhtml\">link</A>is
generated by the same servlet as the session.");
}
} // SessionTest
>From my JSERV.CONF:
ApJServMount /example /example
ApJServMount /servlets /servlets
ApJServAction .jhtml /servlets/JServSSI
>From my JSERV.PROPERTIES
# Execution parameters
#######################
# The Java Virtual Machine interpreter
# Syntax: wrapper.bin=[filename]
# Default: "/usr/bin/java" for Unix systems
# "c:\jdk\bin\java.exe" for Win32 systems
wrapper.bin=/usr/local/jdk117_v1a//bin/java
# Arguments passed to java interpreter (optional)
# Syntax: wrapper.bin.parameters=[string]
# Default: NONE
# Apache JServ entry point class
# Syntax: wrapper.class=[classname]
# Default: "org.apache.jserv.JServ"
wrapper.class=org.apache.jserv.JServ
# Arguments passed to main class after the properties filename
# Syntax: wrapper.class.parameters=[string]
# Default: NONE
# Note: currently not used
# PATH environment value passed to the JVM
# Syntax: wrapper.path=[path]
# Default: "/bin:/usr/bin:/usr/local/bin" for Unix systems
# "c:\(windows-dir);c:\(windows-system-dir)" for Win32 systems
# Notes: if more than one line is supplied these will be concatenated
using
# ":" or ";" (depending wether Unix or Win32) characters
# Under Win32 (windows-dir) and (windows-system-dir) will be
# automatically evaluated to match your system requirements
# CLASSPATH environment value passed to the JVM
# Syntax: wrapper.classpath=[path]
# Default: NONE (Sun's JDK/JRE already have a default classpath)
# Notes: if more than one line is supplied these will be concatenated
using
# ":" or ";" (depending wether Unix or Win32) characters.
# JVM must be able to find JSDK and JServ classes and any
# utility classes used by your servlets.
# Apache JServ Servlet Classes
wrapper.classpath=/usr/local/ApacheJServ-1.0/src/java/ApacheJServ.jar
# Sun's SDK
wrapper.classpath=/usr/local/JSDK2.0/lib/jsdk.jar
# JDBC drivers for Informix
wrapper.classpath=/usr/local/javalib/ifxjdbc/lib/ifxjdbc.jar
# Element Construction Set from Java Apache Project
wrapper.classpath=/usr/local/ecs-1.0/ecs.jar
# Jason Hunter's utility servlets from Servlet Programming
wrapper.classpath=/usr/local/javalib/cos.jar
# Servlet Zones parameters
###########################
# List of servlet zones JServ manages
zones=example,servlets
# Configuration file for each servlet zone
example.properties=/usr/local/ApacheJServ-1.0/example/example.properties
servlets.properties=/usr/local/apache/conf/servlets.properties
>From my SERVLETS.PROPERTIES file
# List of Repositories
#######################
repositories=/usr/local/javalib/ApacheJSSI.jar,
/usr/local/apache/servlets/
# Servlet Aliases
##################
servlet.JServSSI.code=org.apache.servlet.ssi.ParameterPropagatingSSI
servlet.JServSSI.initArgs=PropagateParameters=JServSessionId;tcount
--
--------------------------------------------------------------
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]