can i submit 2 jsp pages to the server at a single button click.

D

Devendra

all java gurus,
I am facing trouble with this issue.
can someone please help me in this regard.

scenario is like this:

Application uses frames to load multiple JSPs.
One of the frame(say frameA) contains a form(say formA) with <select>
list and submit button.
In other frame (say frameB) i have another form(say formB).

When user clicks on 'submit' of page in frameA ; i need to check the
selection he made and load the frameB accordingly.
But before loading frame B with new content ; i want to store the
information in formB that was modified before clicking the submit of
formA.

So i will need to get both formA as well as formB to get submitted on
single submit.

1. is it possible to achieve?
2. if yes, how?

i tried by using unload event for body of page in frameB.
but the it first goes to the server -> brings new page for frame b->
calls unload for old page->
(tried to ) save the old page by call to submit()...
but now i can't see the new page in frameB.
perhaps because when server recieves the old page. it is not generating
new page after it.
server generates new page before saving old one.

please help me?
 
O

ossareh

Hi,

this sounds like more a job for javascript that for jsp. With a
javascript block you can do something like this;

onSubmit() {
form.on.page.A.submit();
form.on.page.B.submit();
}

naturally their submissions will then go to the correct jsp pages which
you can process - be warned though, if javascript is disabled on your
client's browser a click will result in no action at all.
 
O

Oliver Wong

Hi,

this sounds like more a job for javascript that for jsp. With a
javascript block you can do something like this;

onSubmit() {
form.on.page.A.submit();
form.on.page.B.submit();
}

naturally their submissions will then go to the correct jsp pages which
you can process - be warned though, if javascript is disabled on your
client's browser a click will result in no action at all.

Assuming onSubmit() is an event in form A, won't this result in an
infinite recursion? I guess you'd need a second secret, invisible submit
button for form A to actually do the "talk to JSP backend" stuff.

- Oliver
 
A

andrewthommo

Devendra wrote:
.....
Application uses frames to load multiple JSPs.

Frames are not recognised in HTML 4.01 (AFAIR)

They are discourage for any number of reasons, see
comp.infosystems.www.html for reasons why.
So i will need to get both formA as well as formB to get submitted on
single submit.

As mentioned, you might look to JS to perform this,
but check it with the experts* and they will probably
advise against it, but you might also get suggestions
that achieves it for JS enabled browsers, yet degrades
gracefully for users with browsers with no JS.

* comp.lang.javascript

Andrew T.
 
O

Oliver Wong

Frames are not recognised in HTML 4.01 (AFAIR)

They are discourage for any number of reasons, see
comp.infosystems.www.html for reasons why.

My USENET server carries the comp.infosystems.www hierarchy, but not
comp.infosystems.www.html, it seems. Can you tell me what those reasons may
be? I find the "navigation frame + main content frame" to be a pretty
common, and as far as I can tell, relatively problem free design. I'm aware
that some browsers (e.g. lynx) may have problem rendering frames, but they
degrade relatively elegantly.

- Oliver
 
D

Devendra

Thanks to all of you there ; for your valuable suggestions.
i have chosen to use javascript.

Andrew, i want to have look at those reasons for discouraing frames.
but i guess there is some typo with the link.
can you please re-send the link.

Thanks & Regards,
~Devendr@...
 
O

Owen Jacobson

My USENET server carries the comp.infosystems.www hierarchy, but not
comp.infosystems.www.html, it seems.

That's because he misspelled comp.infosystems.www.authoring.html .
Can you tell me what those reasons may be? I find the "navigation frame
+ main content frame" to be a pretty common, and as far as I can tell,
relatively problem free design. I'm aware that some browsers (e.g. lynx)
may have problem rendering frames, but they degrade relatively
elegantly.

Because they're an extremely leaky abstraction of templates.

- If you arrive at the content part of a frameset without the frameset
(eg., from a search engine hit), you cannot navigate the site. Working
around this requires scripting, which is less than optimal.
- If you find a page within a frameset that you're interested in, and you
bookmark it, when you load the bookmark odds are good you'll arrive
back at the beginning of the frameset.
- They break URLs. A single URL should point to a single resource, but a
frameset's URL refers to a series of resources (one for every page you
navigate to within the frameset, not "one for every frame").
 
O

Oliver Wong

message
Can you tell me what those reasons [that frames are bad]
may be? I find the "navigation frame
+ main content frame" to be a pretty common, and as far as I can tell,
relatively problem free design. I'm aware that some browsers (e.g. lynx)
may have problem rendering frames, but they degrade relatively
elegantly.

Because they're an extremely leaky abstraction of templates.

- If you arrive at the content part of a frameset without the frameset
(eg., from a search engine hit), you cannot navigate the site. Working
around this requires scripting, which is less than optimal.

Usually what is done is that each page in the "content frame" either has
something you can click on to take you to the top level document (see the
"frames" and "no frames" link in generated JavaDocs, for example), or each
page in the content frame will contain navigational links as well (e.g. for
sequential content, the navigational frame will act as a table of contents,
with the links in the content frames will be "forward one page" or
"backwards one page").
- If you find a page within a frameset that you're interested in, and you
bookmark it, when you load the bookmark odds are good you'll arrive
back at the beginning of the frameset.

Depends on the browser implementation. I believe FireFox stores the
state of each frame when bookmarked.
- They break URLs. A single URL should point to a single resource, but a
frameset's URL refers to a series of resources (one for every page you
navigate to within the frameset, not "one for every frame").

This is the strongest argument against frames, in my opinion, and I
concede there isn't much you can do about this if you use frames.

- Oliver
 
A

andrewthommo

Owen said:
....
Because they're an extremely leaky abstraction of templates.
(trim further reasons)

Whew! Glad you provided such a good answer.
I forgot all the problems with frames as soon as I stopped
(mostly*) using them.

* I still use them for some CD based projects that are
impractical otherwise.

Andrew T.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top