• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Null value is coming

 
Ranch Hand
Posts: 303
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi List[],

I have two list box first list box is showing State.On clicking the state the value in the second box is changing according to state.But when i am selecting the second list box value and submitting the value its showing null value.
Please help me how to solve this problem.

My Jsp Page;


and second jsp page which acting like java script file


 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
So the second select box has a name of "select"? Is there a "select" property in your action? (That's not a very specific name--it might be better in the long run to name it something meaningful.)

When posting code examples it's best to limit the posted code to only the code directly related to the problem. It's difficult to wade through 125 lines of HTML just to find the 5-10 lines of the state select box and ajax tag.
 
pankaj semwal
Ranch Hand
Posts: 303
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
ok,Next time i will post the limited code.

But still i am getting the null value even i created the setter and getter in action class.

Thanks
 
David Newton
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Have you checked teh actual submission to see if a "select" form value is being sent from the browser?
 
pankaj semwal
Ranch Hand
Posts: 303
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi David Newton ,

I am not understanding what you saying .Can you explain in detail.



Thanks
 
David Newton
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Using a tool like HttpHeaders, Firebug, etc. have you checked to make sure there's a "select" form value being sent?

If there's a "select" form value, and a select setter of the appropriate type (how did you declare your setter?) then it should work, assuming the HTML is rendering and submitting properly.
 
Ranch Hand
Posts: 608
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The usual way to check if the parameter is getting passed is using a tool like HttpHeaders, Firebug like David has mentioned.

Other than that (as I think your is a get request) you should be able to see the parameters being passed in the URL itself (The URL once you click the submit button) Check to see if the parameters are getting passed there.
(In case of post a simple trick is to temporarily change the method to get - to see if the parameters being passed are correct. Of course if its Ajax there is no option but to fall back on Firebug and any http sniffer)
 
David Newton
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
@Sam: The <s:form> tag creates a POST request by default. Also, in this case, the form submission itself isn't Ajax--just the load of the secondary select.
 
pankaj semwal
Ranch Hand
Posts: 303
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I have install the firebug. and when inspect its show the structure like this.

name "state"
options [options]
.
.
.
.
.
value= 3.

what does it mean.


 
David Newton
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
...

Okay, maybe it *would* be easier for you to change the form method to "get" and check the URL :/

Ultimately, you have to determine if the value is being sent from the client to the server.

You still haven't mentioned how your setter is declared.
 
pankaj semwal
Ranch Hand
Posts: 303
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
but when i am posting data using get method .it does not showing values in url i.e it sending data as post method.

 
David Newton
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Are you getting *any* data? How is your setter declared? Can you post the *entire* POST data from Firebug so we can see what's being sent?
 
When people don’t understand what you are doing they call you crazy. But this tiny ad just doesn't care:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic