• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Request.getQueryString() returns null in the included JSP

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

We use OC4J 10.1.3.3 as our application server.

We have a simple struts application with 2 JSPs page1.jsp which includes page2.jsp.
When we call the page1.jsp directly from the URL,
http://<sysno>:<port>/test/page1.jsp?cid=1
the request.getQueryString() returns correct value in page2.jsp.

When we use a struts action to redirect to page1.jsp, request.getQueryString() returns null
in page2.jsp, Althou the request parameters are
available.
http://<sysno>:<port>/test/test.do?cid=1
i.e test.do forwards to page1.jsp.

This works fine in OC4J 10.1.2.
Any pointers?

Here is our code
struts-config.xml
=================
<?xml version="1.0" encoding="windows-1252" ?>
<!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.1//EN" "http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd">
<struts-config>
<action-mappings>
<action path="/test"
type="com.ti.education.TestQuery"
name=""
scope="session"
validate="false">
<forward name="test" path="/page1.jsp" redirect="false"/>
</action>
</action-mappings>
</struts-config>


page1.jsp
=========
<%out.println("request.getQueryString() in page1.jsp: " + request.getQueryString()+"</br>"); %>
<jsp:include page="page2.jsp">
<jsp aram name="testparam" value="testvalue"/>
<jsp aram name="testparam2" value="testvalue2"/>
</jsp:include>

page2.jsp
=================
<%@ page import="java.util.Enumeration" %>
<%

out.println("request.getQueryString() in page2.jsp: " + request.getQueryString());
Enumeration paramNames = request.getParameterNames();
out.println("<br/>Request parameters are:");
while(paramNames.hasMoreElements()) {
String paramName = (String)paramNames.nextElement();
String paramValue = (String)request.getParameter(paramName);
out.println("<br/>name = " + paramName + "; value = " + paramValue);
}
%>
Thanks,
Sivasankari
 
reply
    Bookmark Topic Watch Topic
  • New Topic