Solved

for cheekycj

Posted on 2002-03-22
8
227 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
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 
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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
xjc and jaxb 2 89
iterator example remove 8 74
dateFashion java challenge 9 128
Can't access image with tomcat/html 6 85
In this article, I will show you HOW TO: Perform a Physical to Virtual (P2V) Conversion the easy way from a computer backup (image).
For cloud, the “train has left the station” and in the Microsoft ERP & CRM world, that means the next generation of enterprise software from Microsoft is here: Dynamics 365 is Microsoft’s new integrated business solution that unifies CRM and ERP fun…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

760 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

18 Experts available now in Live!

Get 1:1 Help Now