dcsimg
<HTML:LINK> tag. How to specify multiple parameters in HREF string.
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   lady_naureen
Posted On:   Monday, July 8, 2002 02:29 AM

I found the following code as a repsonse to the same question as mine but my application has slight variation in the below scenario, instead of having hard coded values as in the example below: <% java.util.HashMap params = new java.util.HashMap(); params.put("param1", "driver1"); params.put("param2", "driver2"); pageContext.setAttribute"paramsName", params); %> Test HREF The values of my parameters to be passed is determined ar runtime. I want to achieve the following functionality but I get compilation error on BEAN:WRITE with the following code:    More>>


I found the following code as a repsonse to the same question as mine but my application has slight variation in the below scenario, instead of having hard coded values as in the example below:



<% java.util.HashMap params = new java.util.HashMap();
params.put("param1", "driver1");
params.put("param2", "driver2");
pageContext.setAttribute"paramsName", params);
%>




Test HREF



The values of my parameters to be passed is determined ar runtime. I want to achieve the following functionality but I get compilation error on BEAN:WRITE with the following code:







<% java.util.HashMap params = new java.util.HashMap();
params.put("param1", );
params.put("param2", );

pageContext.setAttribute("paramsName", params);
%>




Test HREF



The JSP page has multiple rows in a table and each row has HREF with paramaeter values unique to this particular row. When the user clicks the HREF, key values of this row have to be passed to the Action class which is necoded in te URL of HREF..



Looking for a reply from JGURUs.

   <<Less

Re: &lt;HTML:LINK&gt; tag. How to specify multiple parameters in HREF string.

Posted By:   Dave_Smith  
Posted On:   Monday, July 8, 2002 09:25 AM

The easiest thing to do is to define your own Java Tag class, which constructs the link URL for you, and then use that instead of . A good model to use as a template for this is in the struts-example application. If you go to the walkthrough on the app ('tour.do') theres a section describing making a specific link with params. Fortunately you can do things like


/somemapping.do?param1=value1 etc


The action specified by somemapping will then be able to get at this param.


Hope this helps


DS

About | Sitemap | Contact