Home > Back-end >  Help the solution: the first JSP page jump to other JSP page, the first function on the JSP page how
Help the solution: the first JSP page jump to other JSP page, the first function on the JSP page how

Time:05-11

Recently took over a WEB project, the project for each page jump in the window. The location. The href, such as 1. JSP through the window. The location jump to 2. JSP,
I want to in this WEB project to implement a global function, ensure that have an effect on each page, the key question is how to ensure that the same function have an effect on each page,
At present there are both considered way:
1, a:
In 1. JSP achieve this function, regardless of the back window. The location jump to 2. JSP, (3) the JSP page, and so on, to ensure that 1. The function also can continue to run on the JSP, by this way, it is best not to change the window. The location of the jump, changed all pages after jump way, because all browsers to do the test, an incompatible will destroy,
This way, had not thought of solution, and so on BBS Posting Montana for help you

2, the way 2
On all pages are to implement this function, so 1. JSP to jump to 2. After the JSP, this feature in 2. JSP there, this way it looks simple, but the execution has two questions: (1) the equivalent of all pages of this WEB project involves exhaustive, but some pages link to other WEB pages of the project, the project to change other projects page is difficult to do, (2) every page with the same function, how to ensure that the features of temporal relations between multiple pages and unified whole,

I tend to use the implementation way, way for the realization method of a Montana please feel free to comment, many thanks!

CodePudding user response:

Do you want to make sure he should continue to run to get the result? Do not change the jump way can't keep, you can put the operation on the backend to, and then when you are 2. JSP, 3. JSP, returns 1. JSP to send a request to the backend get run results, try this on?

CodePudding user response:

reference 1/f, Java stack all route reply:
do you want to make sure he should continue to run to get the result? Do not change the jump way can't keep, you can put the operation on the backend to, and then when you are 2. JSP, 3. JSP, returns 1. JSP to send a request to the backend get run results, try this on?


1, this is a front-end project
2. The JSP is not necessarily return 1. JSP, may continue to jump to the other JSP page,
The function of 3, I need to do is every 10 seconds to send a message to a server, regardless of the user in 1. The JSP page or 2. JSP, 3. JSP... Every 10 seconds will be able to send a message to a server,
4, jump way also is not can't change, is to ensure that modified minimal impact, compatible for all business functions

CodePudding user response:

You this demand is a bit weird.
If you are new to this line, it is suggested that demand directly, your plan may not be reasonable
If you have some work experience, can consider to use the front end of the maturity framework, rather than the JSP

CodePudding user response:

VUE has good practice in the jump, you don't need to do this

CodePudding user response:

Should be turned to the right, the JSP is owned by the backend, although it looks like the front of the nature of the JSP you can understand as in Java a technology of dynamically generated HTML front end cycle were written js to send a message to the background, and think every page has the same js method, usually in the upper window to js method (upper case), or each JSP with the same js references, this according to the framework you use has a simplified way

CodePudding user response:

Is there a file is all of the file contains a call? Such as the head. The JSP? Foot. JSP?
Add js polling

CodePudding user response:

refer to the second floor LCSZNDX response:
Quote: refer to 1st floor all Java stack route reply:
do you want to make sure he should continue to run to get the result? Do not change the jump way can't keep, you can put the operation on the backend to, and then when you are 2. JSP, 3. JSP, returns 1. JSP to send a request to the backend get run results, try this on?


1, this is a front-end project
2. The JSP is not necessarily return 1. JSP, may continue to jump to the other JSP page,
The function of 3, I need to do is every 10 seconds to send a message to a server, regardless of the user in 1. The JSP page or 2. JSP, 3. JSP... Every 10 seconds will be able to send a message to a server,
4, jump way also is not can't change, is to ensure that modified minimal impact, for all business functions do compatible


The JSP will no backend? Don't know your side of the interface architecture, if you have a menu bar, a, b page are child pages you can on the main menu page scheduling in the past, but timing task is suggested that the backend directly use scheduling framework to run, not the client has a request, so to change the front is the smallest, start-stop interface can be supplied by the backend
  • Related