Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Aaron Raja
Ranch Hand
Posts: 206
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
Amarender Reddy
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<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
Posts: 54
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Guys!!

I beg my pardon!
It was :



cheers
 
Aaron Raja
Ranch Hand
Posts: 206
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic