This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Portals and Portlets and the fly likes passing value using Namespace from JSP to Portlet's  processAction method? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Portals and Portlets
Bookmark "passing value using Namespace from JSP to Portlet Watch "passing value using Namespace from JSP to Portlet New topic
Author

passing value using Namespace from JSP to Portlet's processAction method?

Aaron Raja
Ranch Hand

Joined: Jun 07, 2007
Posts: 206
Educate me Ranchar!!!
I was reading "Portlet Programming" by Cameron McKenzie !!!
So far very good book! but I got confuse with his example

Book explaining about using
<portlet:namespace/> before any value from JSP
eg-->
<input name="<portlet:namespace/>addSubmit" type="SUBMIT" value=" Add "></input>

and
when that field is retriving into portlet use
String addAction = request.getParameter(response.getNamespace()+"addSubmitt");

I am using processAction where I want to process it! but ActionResponse class don't have getNamespace()method and it won't compile!

how to link back to the portal makes sense so does using Action Process but combining won't! So I am getting confuse

Any work around ?
Thanks

Aaron Raja
[ November 05, 2007: Message edited by: Aaron Raja ]

Thanks, AR
SCWCD 5, SCJP 1.4, OCA (PL/SQL)
Amarender Reddy
Ranch Hand

Joined: May 12, 2005
Posts: 54
<portlet:namespace/> tag is used to uniquely identify each from element with-in a portlet. This is specially useful when we have more than one portlet in the applicaton. The Portal Best Pracitices suggest the mandatory use of this tag but this can be voilated when really not required.

In your case, you can just use :
Amarender Reddy
Ranch Hand

Joined: May 12, 2005
Posts: 54
Guys!!

I beg my pardon!
It was :



cheers
Aaron Raja
Ranch Hand

Joined: Jun 07, 2007
Posts: 206
Thanks Amarender!
I need to make these data coming from form unique because we have lot of portlets!
I need both, best of the both world! Unique record coming from form and need to use processAction to process multiple action senerios too!!!
Work around or alternative approach? Anything to make it work?

Aaron Raja
[ November 06, 2007: Message edited by: Aaron Raja ]
 
 
subject: passing value using Namespace from JSP to Portlet's processAction method?
 
Similar Threads
liferay portlet - form parameters missing from request
Basics Help need for Portlet development
how to call processAction() method from icefaces ,in liferay
Namespace prefix for form fields..
Portlets and External Javascript Files