You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Cindy Ballreich <ci...@ballreich.net> on 2002/08/06 18:39:58 UTC

questions about XML jsp tags

Are any of the XML style jsp tags ( <jsp:scriptlet> for example) legal in a standard (non well-formed XML) jsp page? This appears to be the case with Tomcat 4.0.4, but I haven't been able to find any documentation about this other than a mention in the dev-list archives. 

Also, I've read that <jsp:expr> is a legal tag. However, in the spec it appears that the correct form is <jsp:expression>. Is the first usage legal? Was it ever legal?  

Thanks! (And sorry if this is slightly off topic.)

Cindy

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Session problem, related to cookies and path

Posted by Milt Epstein <me...@uiuc.edu>.
A quick followup that may help focus this problem better.  In talking
to a colleague at work, a couple of things got clarified.  First,
apparently cookie path info is used by the browser to decide whether
to send a cookie for a given URL.  Now since the session cookie path
is from the rewritten URL (e.g. "/~servicename/http/examples") but the
URL only contains the unrewritten URL (e.g. "/examples"), indeed the
session cookie is not being sent.  And hence a solution for this would
be to have Tomcat use the unrewritten/internal URL to set the path on
the session cookie in the first place.  Anyone have any idea how this
might be accomplished?  For example, is there any way to make Tomcat
aware of the rewriting, or have it do some rewriting of its own?  Or
some way to specify a "URLBase" to Tomcat that URLs are considered
relative to, and that URLBase is not included in the path?

Thanks again.


On Tue, 6 Aug 2002, Milt Epstein wrote:

> I'm having a problem with sessions that I believe is related to
> cookies, in particular to the Path setting on the cookies.  Basically,
> whenever I try to set up a session, it doesn't work, and on each
> succeeding request, it tries to set up the session again (I set my
> browser up to show me the cookies the server is trying to set).  I've
> gotten the same behavior using Netscape 4.7X, MSIE 4.X, and MSIE 5.X,
> and also something similar when I try telnet'ing directly to the server.
>
> The server setup:
> UNIX (AIX 4.3.3)
> Apache 1.3.26
> Tomcat 4.0.4
> mod_jk
>
> Now, this is for a production service, and the sysadmins dictate a
> certain environment for our production services, and I'm 99% sure the
> environment is a factor here.  In particular, they are doing some
> funky URL rewriting using mod_rewrite, and I think that's part of the
> problem.  An example of the type of rewriting done is that a URL like:
>
> http://servername/examples
>
> will be turned into:
>
> http://servername/~servicename/http/examples
>
> I have the following directives in my Apache/mod_jk setup:
>
> JkMount /examples ajp13
> JkMount /examples/* ajp13
>
> and that's enough to get the above URL (the first one) to be passed to
> Tomcat; however, Tomcat is actually seeing the second one (i.e. the
> URI it sees is "/~servicename/http/examples").  In order to have
> Tomcat know what to do with such a URI, I have a Context in Tomcat's
> server.xml where the path is "/~servicename/http/examples" and the
> docBase is "examples".  That works to get to the desired content, but
> I think it has a side effect of screwing up the session cookie.  For
> example, if I go to the URL:
>
> http://servername/examples/jsp/snp/snoop.jsp
> (snoop.jsp is one of Tomcat's sample JSPs, and it does use sessions)
>
> it tries to set a session cookie with a path of
> "/~servicename/http/examples".  Even if I accept the cookie, when I do
> a reload/refresh, it will try to set it again (different session id,
> same path).  If I try going directly to Tomcat via:
>
> http://servername:8080/examples/jsp/snp/snoop.jsp
>
> everything works fine, the session cookie gets set OK, it doesn't try
> to set it again (the path there is "/examples").  I didn't notice
> anything helpful in the logs.
>
> My best guess is that because of the funky path in the session cookie,
> the cookie, even though set in the browser, is not getting to Tomcat,
> so it doesn't see it, and assumes it needs to set another session
> cookie.  I tried looking through the Tomcat source code to see if I
> could find some clues as to whether this might be the case, but that
> didn't lead anywhere.
>
> Any help/suggestions appreciated.
>

Milt Epstein
Research Programmer
Systems and Technology Services (STS)
Campus Information Technologies and Educational Services (CITES)
University of Illinois at Urbana-Champaign (UIUC)
mepstein@uiuc.edu


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Session problem, related to cookies and path

Posted by Milt Epstein <me...@uiuc.edu>.
I'm having a problem with sessions that I believe is related to
cookies, in particular to the Path setting on the cookies.  Basically,
whenever I try to set up a session, it doesn't work, and on each
succeeding request, it tries to set up the session again (I set my
browser up to show me the cookies the server is trying to set).  I've
gotten the same behavior using Netscape 4.7X, MSIE 4.X, and MSIE 5.X,
and also something similar when I try telnet'ing directly to the server.

The server setup:
UNIX (AIX 4.3.3)
Apache 1.3.26
Tomcat 4.0.4
mod_jk

Now, this is for a production service, and the sysadmins dictate a
certain environment for our production services, and I'm 99% sure the
environment is a factor here.  In particular, they are doing some
funky URL rewriting using mod_rewrite, and I think that's part of the
problem.  An example of the type of rewriting done is that a URL like:

http://servername/examples

will be turned into:

http://servername/~servicename/http/examples

I have the following directives in my Apache/mod_jk setup:

JkMount /examples ajp13
JkMount /examples/* ajp13

and that's enough to get the above URL (the first one) to be passed to
Tomcat; however, Tomcat is actually seeing the second one (i.e. the
URI it sees is "/~servicename/http/examples").  In order to have
Tomcat know what to do with such a URI, I have a Context in Tomcat's
server.xml where the path is "/~servicename/http/examples" and the
docBase is "examples".  That works to get to the desired content, but
I think it has a side effect of screwing up the session cookie.  For
example, if I go to the URL:

http://servername/examples/jsp/snp/snoop.jsp
(snoop.jsp is one of Tomcat's sample JSPs, and it does use sessions)

it tries to set a session cookie with a path of
"/~servicename/http/examples".  Even if I accept the cookie, when I do
a reload/refresh, it will try to set it again (different session id,
same path).  If I try going directly to Tomcat via:

http://servername:8080/examples/jsp/snp/snoop.jsp

everything works fine, the session cookie gets set OK, it doesn't try
to set it again (the path there is "/examples").  I didn't notice
anything helpful in the logs.

My best guess is that because of the funky path in the session cookie,
the cookie, even though set in the browser, is not getting to Tomcat,
so it doesn't see it, and assumes it needs to set another session
cookie.  I tried looking through the Tomcat source code to see if I
could find some clues as to whether this might be the case, but that
didn't lead anywhere.

Any help/suggestions appreciated.

Milt Epstein
Research Programmer
Systems and Technology Services (STS)
Campus Information Technologies and Educational Services (CITES)
University of Illinois at Urbana-Champaign (UIUC)
mepstein@uiuc.edu


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: questions about XML jsp tags

Posted by "Craig R. McClanahan" <cr...@apache.org>.

On Tue, 6 Aug 2002, Cindy Ballreich wrote:

> Date: Tue, 06 Aug 2002 09:39:58 -0700
> From: Cindy Ballreich <ci...@ballreich.net>
> Reply-To: Tomcat Users List <to...@jakarta.apache.org>
> To: tomcat-user@jakarta.apache.org
> Subject: questions about XML jsp tags
>
>
> Are any of the XML style jsp tags ( <jsp:scriptlet> for example) legal
> in a standard (non well-formed XML) jsp page?

No.  Per the JSP spec, a page must be either completely in XML syntax or
completely in the traditional syntax.

> This appears to be the
> case with Tomcat 4.0.4, but I haven't been able to find any
> documentation about this other than a mention in the dev-list archives.
>

See the JSP Specification for the detailed rules:

  http://java.sun.com/products/jsp/download.html

> Also, I've read that <jsp:expr> is a legal tag. However, in the spec it
> appears that the correct form is <jsp:expression>. Is the first usage
> legal? Was it ever legal?
>
> Thanks! (And sorry if this is slightly off topic.)
>
> Cindy
>

Craig


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>