I have a jsp page which opens another jsp in new tab. In the second jsp I upload a file on the server (I need the second jsp because there I made some important things). I want somehow to put a link to this file in the first jsp but without refreshing it (because I have fields with user data and I dont want this data to be lost). I want to make it asynchronously. I know I can put ajax in the first jsp and update the DOM but how to trigger this ajax from the second jsp?
Asked
Active
Viewed 148 times
0
-
Can you please share your code? – funcoding May 13 '17 at 09:45
-
Is the second page being included with `<%@ include file="filename" %>`? – funcoding May 13 '17 at 09:48
-
the second page is completely new jsp - nothing is included – ivanlirchev May 13 '17 at 09:52
-
Sorry, man don't quite follow your request. No without any code to see or a visual to take a look at! – funcoding May 13 '17 at 09:56
-
this is principal question. The code is not important. U can always make an example. My code is not simple. I cannot paste it here sorry. I wanted the idea not code. – ivanlirchev May 13 '17 at 09:58
1 Answers
0
The problem is that you open the new tab. It is not possible to communicate between tabs with JS. Basically, you have to use the iframe. You may find some useful information for example here https://stackoverflow.com/a/14570255/5462443 and that is how it is possible to access parent window from the iframe https://stackoverflow.com/a/9006960/5462443.

Community
- 1
- 1

Mykhailo Hodovaniuk
- 511
- 5
- 10