Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How i write the code so that at on submit as well as at onload we call same servlet i

 
sumanta panda
Ranch Hand
Posts: 224
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear ALL,
Suppose I have a jsp page which contains three radio buttons.Let say three fields are .ALL .NSE .BSE


When i click the link of jsp page the default of ALL(.ALL radio button) data mapped with servletpage will displayed automatically.

After click the jsp page link,also the user can choose the radio button(Either .ALL/.BSE/.NSE ) and click the submit button
respective data ((Either .ALL/.BSE/.NSE ) mapped with sevletpage and getting displayed.


I dont have facing any problem when i click submit button i will get the data according the radio button i choose.
But i am facing poroblem how automatically the .ALL radio button data(Which must connect to servlet for retrive data from database) will displayed when i click the jsp page link.


Thanks a lot in Advance.

Regards
Sumanta Panda
 
Mike Curwen
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you keep mentioning "click the link of the jsp", but don't describe where that link is.

Anyways.. why not make this "link to the jsp" a "link to the servlet" instead?

I assume in your JSP somewhere, you have a form something like this:


And that in your /app/reloadWithChoice servlet, it eventually redirects to the jsp we just got submitted from?

So instead of linking to "choose.jsp", you'd link to "/app/reloadWithChoice?choice=.all"
 
sumanta panda
Ranch Hand
Posts: 224
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear All,
Please look at my code when I click the view at that time it will call submitForm() method and displaying the data properly(Send request to servlet and value will populated).

Similarly I also call the submitForm(buttonObj) method in function loadInitialValues() at the page load time but why didn�t the value populated automatically.

Could please rectify my code at loading time in function loadInitialValues() where I call submitForm (buttonObj).









[ December 12, 2008: Message edited by: Paul Sturrock ]
 
sumanta panda
Ranch Hand
Posts: 224
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear All,
Kindly i request all of you please suggest/advise me for my doubt.

Thanks a lot in Advance.

Regards
Sumanta Panda
 
sumanta panda
Ranch Hand
Posts: 224
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you all.Now it is working.

Regards
Sumanta Panda
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic