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
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
Joined: Oct 07, 2008
Posts: 300
posted
0
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.
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.
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)
@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
Joined: Oct 07, 2008
Posts: 300
posted
0
Hi,
I have install the firebug. and when inspect its show the structure like this.