File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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: 31075
    
232

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


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
 
 
subject: Send custom select field to java classes?