User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the JSP section within the Web Development category of DaniWeb, a massive community of 401,536 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,380 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JSP advertiser: Lunarpages JSP Web Hosting
Views: 491 | Replies: 1
Reply
Join Date: Jan 2008
Posts: 27
Reputation: eddy556 is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
eddy556 eddy556 is offline Offline
Light Poster

Passing parameters back to calling document

  #1  
Feb 4th, 2008
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
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Jun 2006
Location: India
Posts: 6,811
Reputation: ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold 
Rep Power: 23
Solved Threads: 339
Moderator
Featured Poster
~s.o.s~'s Avatar
~s.o.s~ ~s.o.s~ is offline Offline
Rebellion Revamped

Re: Passing parameters back to calling document

  #2  
Feb 9th, 2008
> 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.
"I don't accept change. I don't deserve to live."

"Working a real job is a win if you're lazy, greedy, or unmotivated. If you're average, you fit right in. And if you're above average, the basic terms of employment and premise of the arrangement is against your interests."
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb JSP Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the JSP Forum

All times are GMT -4. The time now is 3:15 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC