• 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
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

how to open a new window in jsp

 
Ranch Hand
Posts: 689
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi,
I am new to javascript
my problem is i want to search student information from the database by entering student name..
the problem is there can be more than one name with the same name.
so if search for john then it should popup a window and it must display the name with his registration no
example :

john 10003

john 10012

john 10004

so that here the user can select the student according to his reg. number.

please anybody help me.
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Moving to the HTML/Javascript forum.
 
Ranch Hand
Posts: 256
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
you write a jsp which selects the information from the database.
A jsp ultimately translates to html content. so you have a html page which has all the information in tabular form.
now the problem is to open in a new window.
so you can call the jsp to open in a new window.

window.open(PAGENAME,.....)
or
window.showModalDialog(PAGENAME,....)

This will popup a new window.
You close this window using
window.close();
 
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
there is no need to use another page if u have only 2 fields.
try giving that info in alert message.
 
Sheriff
Posts: 67752
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"surya mm", you have already been asked on at least one other occasion to adjust your display name to meet JavaRanch standards. This is not optional. Please take a look at the JavaRanch Naming Policy and adjust your display name to match it prior to your next post.

Be aware that accounts with invalid display names are removed.

bear
JavaRanch Sheriff
 
saikrishna cinux
Ranch Hand
Posts: 689
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Niki Nono:
you write a jsp which selects the information from the database.
A jsp ultimately translates to html content. so you have a html page which has all the information in tabular form.
now the problem is to open in a new window.
so you can call the jsp to open in a new window.

window.open(PAGENAME,.....)
or
window.showModalDialog(PAGENAME,....)

This will popup a new window.
You close this window using
window.close();



hello boss i am using servlet for retiving th data from servlet not jsp file..
can i write this window.open in servlet like i write it in jsp file
 
Niki Nono
Ranch Hand
Posts: 256
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
jsp translates to servlet. then servlet translates to html.
this is how jsp works.
so if you dot no do database activity in jsp which i agree you should not, you do it in the servlet. So the servlet will translate to html.
So it will work.

The flow is to be clear
JSP - SERVLET - HTML.
 
Villains always have antidotes. They're funny that way. Here's an antidote disguised as a tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic