Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

pass parameter in url link

 
ramesh mohan
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I want to pass the parameter in url <a> tag also i have to retrieve in different portlet i mentioned in <a>tag like page :portalname:pagename .How can i achieve that some times it is retrieving sometimes it produces null. What's the proper way to pass the parameter in anchor tag and i have to retrieve. Is it possible ?

[ jess disabled smiles so the post shows correctly. ]
[ November 28, 2005: Message edited by: Jessica Sant ]
 
Jessica Sant
Sheriff
Posts: 4313
Android IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm having a hard time understanding your question.... are you looking for something like this?

[ November 28, 2005: Message edited by: Jessica Sant ]
 
Michael Valentino
Ranch Hand
Posts: 96
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I could also benefit from a solution to this question. As of right now, I haven't found a way to pass request parameters in a URL link. I've had to use application variables, which i really don't want to do (the whole multi-user issue.. you know). I'm new to portlets and the difference in IBM's portlet implementation and a JSR168 implementation (some would say "mutilation" rather than "differences") is slowing me down enough as it is.

Thanks for any input.
 
ramesh mohan
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<a href="http://localhost:8080/portal/MyPortlet?ctrl:id=window.MyPortlet.DetailsPortletWindow&ctrl:type=render&empcode=<%=empdto.getEmpCode()%>"><%=empdto.getEmpCode()%></a>

empdto is the bean object to set and get.I retrieved using this but is this the correct way ?. I am using jboss portal
 
Julien Viet
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you should use the jsp tag lib as shown above to create a link to your portlet.
 
K Riaz
Ranch Hand
Posts: 375
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you wish to pass parameters within a URL, for example, "user=bob", then you simply create an Action URL (which will cause the portlets processAction() method to fire) and invoke "setParameter(key, value)" on it.

An example,

Create your ActionURL object as you would do so normally.

ActionURL myURL = renderResponse.createActionURL();

then add your parameters,

myURL.setParameter("user", "bob");

Now all you need to do is to simply place myURL into your <a> tag.

<a href="<%=myURL.toString()%>">Click Me</a>

Do not try to append parameters manually to the myURL object, as each portlet container has its own implementation of reading in custom parameters, and it will not recognise custom parameters this way.
[ December 10, 2005: Message edited by: K Riaz ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic