You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2004/02/10 20:27:57 UTC
DO NOT REPLY [Bug 26838] New: -
Improper handling of javax.servlet.include.query_string during a nested include with parameters
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=26838>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND
INSERTED IN THE BUG DATABASE.
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=26838
Improper handling of javax.servlet.include.query_string during a nested include with parameters
Summary: Improper handling of javax.servlet.include.query_string
during a nested include with parameters
Product: Tomcat 5
Version: Nightly Build
Platform: Other
OS/Version: Other
Status: NEW
Severity: Normal
Priority: Other
Component: Catalina
AssignedTo: tomcat-dev@jakarta.apache.org
ReportedBy: kris@dotech.com
CC: kris@dotech.com
Example setup:
include1.jsp:
-------------
<jsp:include page="/include2.jsp">
<jsp:param name="foo" value="bar"/>
</jsp:include>
include2.jsp:
-------------
<jsp:include page="/process.jsp"/>
process.jsp:
------------
<%@ page contentType="text/plain" %>
<%@ page import="java.io.*" %>
<%@ page import="java.util.*" %>
<%!
private boolean areSomeVarsNull(PageContext pageContext,
int scope,
JspWriter out) throws IOException {
boolean someAreNull = false;
for (Enumeration names = pageContext.getAttributeNamesInScope(scope);
names.hasMoreElements();) {
String name = (String)names.nextElement();
if (pageContext.getAttribute(name, scope) == null) {
out.println(name + " is null");
someAreNull = true;
}
}
return someAreNull;
}
%>
<%
areSomeVarsNull(pageContext, PageContext.PAGE_SCOPE, out);
areSomeVarsNull(pageContext, PageContext.REQUEST_SCOPE, out);
areSomeVarsNull(pageContext, PageContext.SESSION_SCOPE, out);
areSomeVarsNull(pageContext, PageContext.APPLICATION_SCOPE, out);
%>
Which results in:
javax.servlet.include.query_string is null
In other words, "javax.servlet.include.query_string" was part of the attribute
names enumeration but it's value was null when accessed through getAttribute.
This is somewhat similar to Bug #26611.
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org