my dog learned polymorphism*
The moose likes JSP and the fly likes Not able to pass value through <SELECT><OPTION> tag as argument to POJO class to return value JSP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Not able to pass value through <SELECT><OPTION> tag as argument to POJO class to return value JSP" Watch "Not able to pass value through <SELECT><OPTION> tag as argument to POJO class to return value JSP" New topic
Author

Not able to pass value through <SELECT><OPTION> tag as argument to POJO class to return value JSP

Brandon Amyout
Greenhorn

Joined: Nov 18, 2013
Posts: 4
Hi,

I am trying to pass a value to a POJO class method through <SELECT><OPTION> and returning value on the JSP page. but not able to do that please help

//POJO code


//JSP code




[Thumbnail for model.png]

Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60080
    
  65

What you have not shown is the servlet to which the form is submitted. That's what holds the responsibility to marshall the request parameters and delegate those values to any POJOs or other areas of the app.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Brandon Amyout
Greenhorn

Joined: Nov 18, 2013
Posts: 4
Bear Bibeault wrote:What you have not shown is the servlet to which the form is submitted. That's what holds the responsibility to marshall the request parameters and delegate those values to any POJOs or other areas of the app.


Will you be a little explanatory, i am not able to understand what exactly you want to say...
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60080
    
  65

Where is the code for the servlet that the form submits to?
Brandon Amyout
Greenhorn

Joined: Nov 18, 2013
Posts: 4
Bear Bibeault wrote:Where is the code for the servlet that the form submits to?


First block from the top but that's not a servlet that's a POJO class which is returning some value.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60080
    
  65

You can't submit a form to just any old class. Are you using a framework? If so, you need to map the actions accordingly. If not, then you need a servlet to respond to the request.
Brandon Amyout
Greenhorn

Joined: Nov 18, 2013
Posts: 4
Bear Bibeault wrote:You can't submit a form to just any old class. Are you using a framework? If so, you need to map the actions accordingly. If not, then you need a servlet to respond to the request.


Okay, Now i have one more problem if i cant submit a form like this. And also if i pass request to servlet through the form and how do we get the response in a <div> section. Any idea??
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60080
    
  65

Brandon Amyout wrote:And also if i pass request to servlet through the form and how do we get the response in a <div> section. Any idea?

Ajax
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Not able to pass value through <SELECT><OPTION> tag as argument to POJO class to return value JSP
 
Similar Threads
Using EL to generate attribute/value pairs inside of an XHTML element
struts2jquery sending parameters to action
Line break for a sentence without spaces
Passing values to same page
how to add multiple rows dynamically to a table using javascript