?
Solved

for cheekycj

Posted on 2002-03-22
8
Medium Priority
?
244 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
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 200 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

Industry Leaders: 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

Moore’s Law has proven itself time and time again since it was first introduced. So what’s next? Will Moore’s law continue to remain relevant, or will new technology take over and bring us the next big advancement in computing?
Social messanging services like WhatsApp and Facebook can help businesses in ways that many owners don't even imagine, giving new opportunities to connect with customers. Discover some of the most innovative things they can do for your company.
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …

830 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