This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes JForum and the fly likes Send custom select field to java classes? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Products » JForum
Bookmark "Send custom select field to java classes?" Watch "Send custom select field to java classes?" New topic
Author

Send custom select field to java classes?

Nate Williamson
Greenhorn

Joined: Jul 06, 2011
Posts: 6
Hello,

I am trying to add a custom field (a select with options) to the "New Post" page (templates/default/post_form.htm). Adding the new field is not a problem but I can't figure out a way to get the selected value of that field to the java classes in the back end. Does anyone know how this can be done? I am more familiar with JSF and haven't worked with freemaker before.

Thanks!
Nate Williamson
Greenhorn

Joined: Jul 06, 2011
Posts: 6
I guess the actual question is, how do I assign the value of the selected option to a value in the java classes (Post.java for example).
Nate Williamson
Greenhorn

Joined: Jul 06, 2011
Posts: 6
Figured it out..

All I needed to do was set the name of my select and then get it in the insertSave method of PostAction.

this.request.getParameter("name_of_select");
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 32481
    
214

Thanks for posting the answer for anyone who has this question in the future.


[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
 
Have you checked out Aspose?
 
subject: Send custom select field to java classes?
 
It's not a secret anymore!