• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to get the type of component in the request

 
Rupal Rshah
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to know how do i know the type of component on the requst object. That means if i have an HTML page with textbox, button and few other components, if on submitting this form i call i servlet. Then in a servlet how do i know the type of the compenent.
 
J. Kevin Robbins
Bartender
Posts: 1801
28
Chrome Eclipse IDE Firefox Browser jQuery Linux MySQL Database Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not sure why you would want to do that, but the only way I can think of is by using naming conventions since the name of the field/button is submitted as the name of the parameter. For instance, name an input field with a name attribute of "ifirstname" or a button with a name of "bsubmit". You could then parse the name to determine the component type.

But this seems like a lot of trouble for little gain. Why do you need this information? If you'll explain why you want to do this, maybe there is a better way to accomplish your goal.


 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65520
105
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That would be extremely odd. I too would like to know what you intend to do with this information.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!