Hi,

check the struts doc for html-tags:

To pass a single dynamic parameter, specify the parameter's name using the paramId 
attribute. You can then specify the name of the JavaBean holding the value using the 
paramName attribute, and a particular property using paramProperty.

So, a tag like

<html:link paramID="target"
     paramName="linkParams" 
paramProperty="target"
     paramScope="request"
>detail.html</html:link>


this is from 
http://jakarta.apache.org/struts/api-1.0/org/apache/struts/taglib/html/package-summary.html#doc.Other.hyperlinking

in this way you can add one parameter to the querystring. there is also
a way to add more than one parm...

hope this helps
Alexander

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Friday, October 19, 2001 4:28 PM
To: [EMAIL PROTECTED]
Subject: rtexprvalue not working in <html:link> tag!!! --- REVISITED



OK, this is weird.  The <html:link> page attribute doesn't work as expected
when you append a query string to a scriptlet, as in <html:link page="
<%=somepage%>?color=green" >.   Here sample code that highlights the
discrepancy.  Can someone explain??

------------------------------------------------- SCENARIO ONE - no
queryString - this works Yay!
--------------------------------------------------------------------------

**************JSP PAGE:**************
<%   String somepage= "/crazylink.do";   %>

<html:link page="<%=somepage%>" >click</html:link>

**************JAVA CREATED FROM JSP:**************
String somepage = "crazylink.do";

org.apache.struts.taglib.html.LinkTag _jspx_th_html_link_0 = new
org.apache.struts.taglib.html.LinkTag();
.... code ....
_jspx_th_html_link_0.setPage(somepage);

************** LINK CREATED ****************
http://localhost:8080/myapp/crazylink.do

--------------------------------------- SCENARIO TWO - using a queryString
- this does NOT WORK.  BOO!
------------------------------------------------

**************JSP PAGE:**************
<%   String somepage= "/crazylink.do";   %>

<html:link page="<%=somepage%>?color=green" >click</html:link>

**************JAVA CREATED FROM JSP:**************
String somepage = "crazylink.do";

org.apache.struts.taglib.html.LinkTag _jspx_th_html_link_0 = new
org.apache.struts.taglib.html.LinkTag();
.... code ....
_jspx_th_html_link_0.setPage("<%=somepage%>?color=green");

************** LINK CREATED ****************
http://localhost:8080/myapp/<%=somepage%>?color=green


***Note:  I realize one can just append the query string like so:
<%   String somepage= "/crazylink.do?color=green";      %>

But this does me no good since the link "/crazy.do" will be used throughout
the page with different queryStrings for each.



                                                                                       
                        
                    Craig_Reichenbach                                                  
                        
                    @lotus.com              To:     [EMAIL PROTECTED]     
                        
                                            cc:     (bcc: Craig Reichenbach/CAM/Lotus) 
                        
                    10/18/2001 02:18        Subject:     rtexprvalue not working in 
<html:link> tag!!!         
                    PM                                                                 
                        
                    Please respond to                                                  
                        
                    struts-user                                                        
                        
                                                                                       
                        
                                                                                       
                        




Anyone know why my scriptlet in the following <html:link> tag is not being
evaluated?
******************************************************************************

<%
String somepage= "index.jsp";
%>

<html:link page="<%=somepage%>">Click Here</html:link>
******************************************************************************


The value showing up is not the evaluted scriptlet, but the scriptlet
itself, as in "http://localhost:8080/myapp/<%=somepage%>"

I'm using Tomcat4.0 & Struts1.0

Scriptlets are evaluated in other custom tags I have used so I don't think
it's a jasper issue...  I don't htink it has to do w/ the taglib either...
What's up???

Thanks,
-Craig

To be sure, the page attribute accepts a rtexprvalue:
<attribute>
<name>page</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute>




Reply via email to