The browser stores cookies by domain, so when you establish a session on localhost, the browser won't send that session cookie to server 24.124.73.112 ... and your servlet won't see the same sessionId. Try it out, but this is almost certainly your problem.

justin

At 01:03 PM 11/19/2002, you wrote:
Thanks for your response, Justin:

Here's my setup:

You could be on to something... when I do my testing, I click on a browser link
http://localhost:8080/TestStats/jsp/stats.jsp

When the jps accesses the servlet it uses
http://24.124.73.112:8080/TestStats/controller

However, localhost:8080 is the same physical box as 24.124.73.112:8080. Could all this a domain name resolution issue?
In any event, I will make them match and report back tonight on this. In the mean time here's some of info you mentioned:

SETUP:
Webserver and JSP container = Tomcat 4.1.12
Browsers, various = IE 5.2, Omniweb, Chimera, Mozilla all with cookies enabled.
Java dev platforms = JDK 1.3.1 (on MacOSX), JDK 1.4.x (on Windows2000)
DB = Oracle 8.1.7 on Linux

JSP STUFF:
The jsp talks to the contacts the servlet via a form action which is triggered by the usual submit button:

<FORM NAME="MyTestStats" METHOD="POST"
ACTION="http://24.124.73.112:8080/TestStats/controller"; >

Heres a piece of my web.xml (the one in the webapps folder)

<web-app>

<display-name>Tomcat Examples</display-name>
<description>
Tomcat Example servlets and JSP pages.
</description>

<servlet>
<servlet-name>C2</servlet-name>
<servlet-class>C2</servlet-class>
</servlet>

<servlet-mapping>
<servlet-name>C2</servlet-name>
<url-pattern>/controller</url-pattern>
</servlet-mapping>

I do not use URL rewriting.

Thanks again,
-FB

On Tuesday, November 19, 2002, at 02:33 PM, Justin Ruthenbeck wrote:


Are you sure that the URLs (server names) used to access both the JSP and Servlet are the same? For example, if you access the jsp with http://www.site.com/my.jsp and access the servlet from the browser with http://localhost/my.jsp, you'll see exactly what you're describing below.

Can you give us some information about your setup? Browser based?
Using cookies? URL rewriting? Do you have a webserver frontend (Apache/JK)? Source for jsp? How is the servlet hit (directly, from a form action)?

justin

At 12:21 PM 11/19/2002, you wrote:
Still zero responses... "ooh and it makes me wonder" Should I provide further details? Any comments would help, I'm just seeking clues not
necessarily a solution.

Thanks!
-FB


On Tuesday, November 19, 2002, at 08:00 AM, [EMAIL PROTECTED] wrote:

I'm not sure if Tomcat 4.1.12 has something to do with the following problem. My client session id is seemingly not written to the implicit JSP request object. Below is a section of my catalina.out printout which shows this.

Two things to note:
1. The request object is indeed instantiated and is shipped to Tomcat with valid data. Otherwise I would not be able to see the From and To dates that are constructed from drop down widgets on the JSP.

2. I would expect the session ids to match. Is this assumption correct


JSP Session id: 3F6FC46A183303B69EC4E8097528159E
Request Session id: null
Servlet Session id: F8568A66D6EF4BE71AC8AD37FF0921C7
Servlet Session is New?: true
Is Requested Session is Valid? false
Is Requested Session from Cookie? false
Is Requested Session from URL? false
FromDate : Oct/10/2002
ToDate : Oct/19/2002


Here's the servlet code (nothing special here, as far as I can tell)

public void doGet(
HttpServletRequest request, HttpServletResponse response)
throws IOException, ServletException {

response.setContentType("text/html");
PrintWriter out = response.getWriter();
HttpSession session = request.getSession(true);
//HttpSession session = request.getSession();
session.setMaxInactiveInterval(60*30);


System.out.println("Request Session id: " + request.getRequestedSessionId() );
System.out.println("Servlet Active Session id: " + session.getId() );
System.out.println("Servlet Active Session new?: " + session.isNew() );

boolean rtrue = request.isRequestedSessionIdValid();
System.out.println("Is Requested Session Valid? " + rtrue );

boolean ctrue = request.isRequestedSessionIdFromCookie();
System.out.println("Is Requested Session from Cookie? " + ctrue );

boolean utrue = request.isRequestedSessionIdFromURL();
System.out.println("Is Requested Session from URL? " + utrue );


--
To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

--
To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

--
To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to