• 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

Opening new JSP page with parameters of parent page.

 
Ranch Hand
Posts: 126
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
<nods head>
I have two pages, one called Search.jsp and DisplayResults.jsp.
Search.jsp collects all the information that a user wants to search
for, and after they press a 'search' button, the DisplayResults.jsp
displays the search results. This means that all of the data that
I collected within the search page needs to be sent to the
results page.
I have an initial idea, does it work?
window.open("DisplayResults.jsp?....(all of the parameters collected within Search.jsp");
is there a simpler way of sending all of the parameter collected within
search.jsp to displayresults.jsp?
Thanks
Zak Nixon
 
Sheriff
Posts: 67746
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
Since you can only stuff so much on the URL, you could run into a problem if the list of params gets long.
 
Zak Nixon
Ranch Hand
Posts: 126
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is there a limit on the number of parameters a URL can have?
Also, do you have a possible solution to my problem?
THanks
Zak
 
Ranch Hand
Posts: 305
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You are most likely collecting the user information with a FORM? Why not just submit the form to the displayResults.jsp?
Example:

Then you just have a button which will submit the form. Ideally, you'd want to submit the form to a Servlet, which grabs the results from the database, then forwards these results to the proper page for display.
 
Bear Bibeault
Sheriff
Posts: 67746
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


Is there a limit on the number of parameters a URL can have?


No, but there is a limit on the number of characters, and more params means more characters.

Why not just submit the form to the displayResults.jsp?


I believe the problem is that he wants displayResults.jsp to appear in a new window rather than the same window as the submitting JSP.
What I believe you can do is to, using a submit handler, open a window using window.open, assign it a name, and use that name in the target attribute of the form.
In any case, this has ceased to be a JSP question and is now a Javascript question, so I'm going to move this over to the HTML/Javascript forum for further discussion.
 
Zak Nixon
Ranch Hand
Posts: 126
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ok,
I have the following:

My form is on a page called SearchRecords.jsp, and my form is called
searchForm.
Whenever the submit button is pressed, test() runs successfully, but
pops up DisplayResults.jsp (no params passed) and another page
which is my SearchRecords.jsp page with all the parameters.
Can someone lead me in the right direction?
Thanks
Zak
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
look at this code:
http://obiewebsite.sourceforge.net/obie.php?Submit_a_form_to_a_popup
Eric
 
Zak Nixon
Ranch Hand
Posts: 126
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Eric, Eric, Eric.....
You have made my day so much easier!
Thank you SO MUCH for helping me out.
JAVARANCH KICKS REAR!!!


Zak Nixon
 
reply
    Bookmark Topic Watch Topic
  • New Topic