Solved

for cheekycj

Posted on 2002-03-22
8
230 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
 
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
jAVA SERVLETS CODE FOR ONLINE SUPERMARKE 2 196
Need to view directory list in apache/tomcat 9 109
squirrelPlay java challenge 40 157
main method of string class 3 103
What does UTC stand for?  “Coordinated Universal Time” – Think of this as the true time on Planet Earth that never changes with the exception of minor leap seconds here and there to account for the changes in the planet's rotation.   What does th…
There are many Password Managers (PM) out there to choose from. PM's can help with your password habits and routines, but they should not be a crutch you rely on too heavily. I also have an article for company/enterprise PM's.
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

920 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

15 Experts available now in Live!

Get 1:1 Help Now