• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
  • Paul Clapham
Sheriffs:
  • paul wheaton
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Piet Souris
Bartenders:
  • Mike London

Namespace prefix for form fields..

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If I prefix a form field with portlet namespace, should I use this prefixed parameter name to get the value in my portlet class??

To be specific... my jsp looks like this:


Now, how should I access myfield in my render() method???


I strongly feel it should be the second way. But I did not find any convenient answer in JSR...
 
Author
Posts: 121
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
holla,

if you define the field names of your form like that, the second way should do. And yes, it is not very handy. Why do you want to prefix the input names of the form? I do not know your use case, but normally prefixing the form name is sufficient to avoid name ambiguities on a portal page for JavaScript etc., or do I miss something? If you ony prefix the name of the form, the name of the parameter is just like it is in the HTML tag.

Btw.: Welcome to the Java Ranch! Your login name does not adhere to the Official policy on registered names.

Greetings, Stefan
 
Sheriff
Posts: 4313
Android IntelliJ IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"holla"
Welcome to the JavaRanch! It's great that you found our snazzy new Portal and Portlets forum... but can you do me one favor? Please change your display name to match the JavaRanch Naming Policy (basically you should have a legitmate sounding first and last name). You can tweak it here

Thanks! and again welcome to the JavaRanch!
- Jess
 
Sachin Holla
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi Stefan,
thanks for your comments.. the second method should be the logical one. i was just playing with different combinations and i came across this scenario..


regarding my name -
my name is sachin holla. most of my friends call me holla, so i kept that display name..
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic