Solved

for cheekycj

Posted on 2002-03-22
8
236 Views
Last Modified: 2010-04-01
CJ,
Please see my comments posted at the bottom of this Q:

http://www.experts-exchange.com/jsp/qManageQuestion.jsp?ta=jsp&qid=20276592

Thanks
0
Comment
Question by:knightEknight
  • 4
  • 3
8 Comments
 
LVL 19

Expert Comment

by:cheekycj
ID: 6891062
are you getting compilation erors?

I am going to post here b/c I didn't get notifications of your posts in the other one.. (I don't know why)

CJ
0
 
LVL 19

Expert Comment

by:cheekycj
ID: 6891066
BTW: you figured it out but I should have clarified in the original question.  When you pass parameters to a JSP using the param tag .. the include file must retrieve them using request.getParameter("paramname");

Now AFAIK, you don't need the toString() b/c all request PARAMETERS are strings.

CJ
0
 
LVL 19

Expert Comment

by:cheekycj
ID: 6892315
are you getting compilation errors or is the code just not working right?
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 33

Author Comment

by:knightEknight
ID: 6894007
the code compiles, the parameter data is not returned (except for the getData)


  <% String pageType = "type1"; %>

  <jsp:include page="incpage.jsp?getData=junk" flush="true">
    <jsp: param name="pageName" value="name1" />
    <jsp: param name="pageType" value="<%=pageType%>" />
  </jsp:include>




Here is incpage.jsp:

  <%
   // check for null, if null convert to ""
   String pageType = (request.getParameter("pageType")==null) ? "" : request.getParameter("pageType").toString();
   String pageName = (request.getParameter("pageName")==null) ? "" : request.getParameter("pageName").toString();
   String getData  = (request.getParameter("getData")==null)  ? "" : request.getParameter("getData").toString();
  %>

  Page Name: <%=pageName%><BR>
  Page Type: <%=pageType%><BR>
  Get Data:  <%=getData%><BR>



Here is the output:

  Page Name: <BR>
  Page Type: <BR>
  Get Data:  junk<BR>
 

Thanks for the extra help.
0
 
LVL 33

Author Comment

by:knightEknight
ID: 6894012
to simplify, I did this with the same results:

   String pageType = request.getParameter("pageType");
   String pageName = request.getParameter("pageName");
   String getData  = request.getParameter("getData");
0
 
LVL 6

Accepted Solution

by:
kotan earned 50 total points
ID: 6898788
<jsp: param name="pageName" value="name1" />

Please remove the space between "<jsp:" and "param name .../>"

Then should be

<jsp:param name="pageName" value="name1"/>

0
 
LVL 33

Author Comment

by:knightEknight
ID: 6899117
Thanks, I should have seen that :)
0
 
LVL 19

Expert Comment

by:cheekycj
ID: 6899202
Sorry I couldn't help out.. been really busy with work.  But kotan.. is there as usual :-)
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
gZip compression filter 2 179
caughtSpeeding java challenge 16 140
JSONSerializer.toJSON in JSP generating error 8 88
struts spring hibernate example 12 136
In previous parts of this Nano Server deployment series, we learned how to create, deploy and configure Nano Server as a Hyper-V host. In this part, we will look for a clustering option. We will create a Hyper-V cluster of 3 Nano Server host nodes w…
The Windows functions GetTickCount and timeGetTime retrieve the number of milliseconds since the system was started. However, the value is stored in a DWORD, which means that it wraps around to zero every 49.7 days. This article shows how to solve t…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

685 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