| | |
Passing parameters back to calling document
Please support our JSP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Jan 2008
Posts: 32
Reputation:
Solved Threads: 0
Hey,
I have a primary JSP which inlcudes a secondary JSP which is dynamic. How do I pass parameters FROM the secondary JSP back the PRIMARY JSP not the other way around?
For example I have a page which displays the output from a database. The first page is just interested in formatting while the second page actually calls the data from the database - hence it is included. However I also have it so a user can click a record (generated by the second jsp) which can then be edited on the primary page. I therfore need to page the primary key to be passed from the second jsp to the primary one.
Hope you can help :-)
Thanks
I have a primary JSP which inlcudes a secondary JSP which is dynamic. How do I pass parameters FROM the secondary JSP back the PRIMARY JSP not the other way around?
For example I have a page which displays the output from a database. The first page is just interested in formatting while the second page actually calls the data from the database - hence it is included. However I also have it so a user can click a record (generated by the second jsp) which can then be edited on the primary page. I therfore need to page the primary key to be passed from the second jsp to the primary one.
Hope you can help :-)
Thanks
> How do I pass parameters FROM the secondary JSP back the PRIMARY JSP not the other way
> around?
You can use session variables as common piggyback mechanism though I am not very sure what you mean by pass the parameters.
The entire process of including the JSP is just an abstraction for the developer. In the end, the client would be just served with a single HTML file (unless you are using Iframes/frames). When the user clicks on the link to modify the record, just call the first or the parent JSP and perform a check in the first JSP to see if the user wants to just view or modify the records.
But still there seems to be something wrong with your design. Are you by any chance accessing the database from the JSP. If yes, it's wrong and you shouldn't do that. If no, then why use two pages? JSP technology is meant to be a presentation layer technology and it's primary purpose is the formatting of the data which is processed in a servlet.
> around?
You can use session variables as common piggyback mechanism though I am not very sure what you mean by pass the parameters.
The entire process of including the JSP is just an abstraction for the developer. In the end, the client would be just served with a single HTML file (unless you are using Iframes/frames). When the user clicks on the link to modify the record, just call the first or the parent JSP and perform a check in the first JSP to see if the user wants to just view or modify the records.
But still there seems to be something wrong with your design. Are you by any chance accessing the database from the JSP. If yes, it's wrong and you shouldn't do that. If no, then why use two pages? JSP technology is meant to be a presentation layer technology and it's primary purpose is the formatting of the data which is processed in a servlet.
I don't accept change; I don't deserve to live.
![]() |
Similar Threads
- C++ Performance Tips (C++)
- Data Abstraction (Computer Science)
Other Threads in the JSP Forum
- Previous Thread: Refreshing a JSP page only once
- Next Thread: does request.getParameter() return string type only?
| Thread Tools | Search this Thread |
apache backbutton combobox connection database development directorystructure dynamicpagetitles eclipse frames glassfish ie8 imagetodatabse imageupload integer internet java javaee javascript jsf jsp jsppagetitles levels mvc2 mvcmodel2 network parameters passing ping printinserverinsteadofclient redirect request.getparameter response servlet servletdopost()readxml sessions software ssl state_saving_method stocks sun tomcat tutorial update video web






