Solved

for cheekycj

Posted on 2002-03-22
8
240 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
[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
  • 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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

Suggested Solutions

Title # Comments Views Activity
Jquery - parsing the results returned from webmethod 1 128
difference between member and local variables. 29 146
caughtSpeeding java challenge 16 141
tomcat startup error 5 165
This article is a collection of issues that people face from time to time and possible solutions to those issues. I hope you enjoy reading it.
Dramatic changes are revolutionizing how we build and use technology. Every company is automating, digitizing, and modernizing operations. We need a better, more connected way to work together as teams so we can harness the insights from our systems…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

737 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