Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / May 2006

Tip: Looking for answers? Try searching our database.

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

Thread view: 
Devendra - 24 Apr 2006 13:58 GMT
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?
---
~Devendr@...
ossareh@gmail.com - 24 Apr 2006 17:38 GMT
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.
Oliver Wong - 25 Apr 2006 21:27 GMT
> Hi,
>
[quoted text clipped - 9 lines]
> 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
andrewthommo@gmail.com - 26 Apr 2006 00:43 GMT
....
> 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.
Oliver Wong - 26 Apr 2006 14:43 GMT
> 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
Owen Jacobson - 27 Apr 2006 16:32 GMT
>> Frames are not recognised in HTML 4.01 (AFAIR)
>>
[quoted text clipped - 3 lines]
>     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").
Oliver Wong - 27 Apr 2006 17:23 GMT
>> 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,
[quoted text clipped - 7 lines]
>   (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
andrewthommo@gmail.com - 02 May 2006 08:15 GMT
> > <andrewthommo@gmail.com> wrote in message
...
> >> Frames are not recognised in HTML 4.01 (AFAIR)
> >>
> >> They are discourage for any number of reasons..
...
> > Can you tell me what those reasons may be?
...
> 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.
Devendra - 27 Apr 2006 09:56 GMT
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@...


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.