Win a copy of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds this week in the Cloud/Virtualization forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

Refresh the same page  RSS feed

 
Ranch Hand
Posts: 79
Android Java Java ME
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Hello,

I have a JSP page where user selects date and a button "View". On click of View button I have to retrieve data of the specified date and show. I want to display the contents in same page.
How can I do somehting that on click to the btn, might be a function runs and displays the result in table or a message ?

Can this be possible or I should call other page only on click of a button.

Please help me accordingly
 
Ranch Hand
Posts: 368
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
On click of button call servlet in that you can get date & set it in to prepare scope(request or session) after that forward to same jsp.
while displaying date get that variable we set in servlet from session or request and display it.
 
Trupti Mehta
Ranch Hand
Posts: 79
Android Java Java ME
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Shailesh Narkhede wrote:On click of button call servlet in that you can get date & set it in to prepare scope(request or session) after that forward to same jsp.
while displaying date get that variable we set in servlet from session or request and display it.



Thanks Shailesh. But am wondering 1 point :
The flow is such, I check login type, if loginType = A, then print his name; else retrieve all names and ask user to select a name. Then user selects a date (for all login types). Then clicks on View button.
Now, I go to the Servlet, retrieve data, save it in session which I have to show and redirect to this page.

Can I have 2 forms like on start when I retrieve the data from servlet, if it is null, then form1 i.e. inputting data from user will be shown, else form2 which actually shows the retrieved data from session. As I have the data I don't need the inputting fields or don't want to set them as they are dynamic. Can this be possible ???

Also I have to give the privilege to select another date. I think it will be better to use other page only, instead of making 1 page so much complicated. What do you say ?
I hope I have made myself clear. Please help me know.
 
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can use JSTL core taglib to control the page flow.
 
Trupti Mehta
Ranch Hand
Posts: 79
Android Java Java ME
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Thanks to all of you for helping and guiding me. I highly appreciate your time and guidance.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!