?
Solved

Pass dynamic variable to include????

Posted on 2004-09-24
8
Medium Priority
?
296 Views
Last Modified: 2011-08-18
I want to pass a parameter to an include:
<%

String stage = request.getParameter("primaryComp");

%>

<jsp:include page="test.jsp?stage=<%=stage%>" flush="true"/>



/////////////////////
but this doesn't work? Any ideas?? The parameter is being passed in.
0
Comment
Question by:894359
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
8 Comments
 
LVL 86

Accepted Solution

by:
CEHJ earned 2000 total points
ID: 12148022
<jsp:include ...
<jsp:param name="stage" value="<%stage%>" />
</jsp:include>
0
 

Author Comment

by:894359
ID: 12148133
I tried;

<jsp:include page="test.jsp" flush="true"/>
        <jsp:param name="stage" value="red"/>
          </jsp:include>

And it comes up null in the include???

Here's how I'm calling it in the include:

String stage = request.getParameter("stage");
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 12148146
So it's coming up null even with a literal (as above)?
0
Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

 

Author Comment

by:894359
ID: 12148174
That's correct!
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 12148206
Hmm, not sure why. I'm clocking off now, but objects will be able to help out (soonish probably)
0
 

Author Comment

by:894359
ID: 12148299
I figured out why I was having problems, for some reason, I had to remove the "/" in the include call:

<jsp:include page="test.jsp" flush="true">
        <jsp:param name="stage" value="<%=stage%>"/>
          </jsp:include>
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 12149407
:-)

Hmm. Can you please post the code that's now working?
0
 

Author Comment

by:894359
ID: 12427638
<jsp:include page="test.jsp" flush="true">
       <jsp:param name="stage" value="<%=stage%>"/>
         </jsp:include>

:)
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
Suggested Courses
Course of the Month10 days, 13 hours left to enroll

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question