Solved

Pass dynamic variable to include????

Posted on 2004-09-24
8
286 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
  • 4
  • 4
8 Comments
 
LVL 86

Accepted Solution

by:
CEHJ earned 500 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
 

Author Comment

by:894359
ID: 12148174
That's correct!
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
powerN  challenge 3 49
countX 22 70
pairs challenge 5 45
Starting to learn JAVA, 7 48
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…
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
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…

747 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now