Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Brandon Amyout
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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


model.png
[Thumbnail for model.png]
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64717
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Brandon Amyout
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64717
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Where is the code for the servlet that the form submits to?
 
Brandon Amyout
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64717
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64717
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic