Not possible to attach 2 (or more) parameters from 2 different beans to an html:link?
Hello listers. I sent an email about a week ago and haven't heard a blip. So I guess this simply isn't possible? If I have a bean user and another module and want to attach a property from each to an html:link tag, how do I do it? As I understand it if I simply put paramName it will include ALL properties for that bean, which I don't need. But if I put paramName, paramProperty and paramId twice, once for each bean/property, it only attaches one! Is there some way I can create a custom bean ... in the page, put the two properties I need inside it, and pass *it* to the html:link with paramName ? Sounds kind a less-than.perfect solution. Any takers? Thanks, syg - Do you Yahoo!? Take Yahoo! Mail with you! Get it on your mobile phone.
Re: Not possible to attach 2 (or more) parameters from 2 different beans to an html:link?
You have to set a map of parameters to add to the link. You may create the map in an action prior to your JSP, or use this in your JSP (if you use JSTL) : jsp:useBean id=myLinkParams class=java.util.HashMap/ c:set target=${myLinkParams} property=param1 value=${user.id}/ c:set target=${myLinkParams} property=param2 value=${module.name}/ html:link action=/myAction name=myLinkParams click me ! /html:link Nico. Hello listers. I sent an email about a week ago and haven't heard a blip. So I guess this simply isn't possible? If I have a bean user and another module and want to attach a property from each to an html:link tag, how do I do it? As I understand it if I simply put paramName it will include ALL properties for that bean, which I don't need. But if I put paramName, paramProperty and paramId twice, once for each bean/property, it only attaches one! Is there some way I can create a custom bean ... in the page, put the two properties I need inside it, and pass *it* to the html:link with paramName ? Sounds kind a less-than.perfect solution. Any takers? Thanks, syg - Do you Yahoo!? Take Yahoo! Mail with you! Get it on your mobile phone. Our name has changed. Please update your address book to the following format: [EMAIL PROTECTED]. This message contains information that may be privileged or confidential and is the property of the Capgemini Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Not possible to attach 2 (or more) parameters from 2 different beans to an html:link?
-Original Message- From: Robert Bowen [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 06, 2004 8:44 AM To: [EMAIL PROTECTED] Subject: Not possible to attach 2 (or more) parameters from 2 different beans to an html:link? Hello listers. I sent an email about a week ago and haven't heard a blip. So I guess this simply isn't possible? If I have a bean user and another module and want to attach a property from each to an html:link tag, how do I do it? As I understand it if I simply put paramName it will include ALL properties for that bean, which I don't need. But if I put paramName, paramProperty and paramId twice, once for each bean/property, it only attaches one! If you use name, then you can just have a map of the params you need. I have also been known to use forwards, and have the params in the forward definition. That assumes that your params can be static. Is there some way I can create a custom bean ... in the page, put the two properties I need inside it, and pass *it* to the html:link with paramName ? Sounds kind a less-than.perfect solution. Any takers? Thanks, syg - Do you Yahoo!? Take Yahoo! Mail with you! Get it on your mobile phone. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Not possible to attach 2 (or more) parameters from 2 different beans to an html:link?
If you want to add multiple params to link, drop them in a Map. Here's an example that also uses JSTL: %@ taglib prefix=curi=http://java.sun.com/jstl/core; % %@ taglib prefix=html uri=http://jakarta.apache.org/struts/tags-html; % jsp:useBean id=params class=java.util.HashMap/ c:set target=${params} property=userProp value=${user.userProp}/ c:set target=${params} property=moduleProp value=${module.moduleProp}/ html:link action=... name=params ...Hit me/html:link Quoting Robert Bowen [EMAIL PROTECTED]: Hello listers. I sent an email about a week ago and haven't heard a blip. So I guess this simply isn't possible? If I have a bean user and another module and want to attach a property from each to an html:link tag, how do I do it? As I understand it if I simply put paramName it will include ALL properties for that bean, which I don't need. But if I put paramName, paramProperty and paramId twice, once for each bean/property, it only attaches one! Is there some way I can create a custom bean ... in the page, put the two properties I need inside it, and pass *it* to the html:link with paramName ? Sounds kind a less-than.perfect solution. Any takers? Thanks, syg -- Kris Schneider mailto:[EMAIL PROTECTED] D.O.Tech http://www.dotech.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]