I have an index servlet broken into two parts of the menu, and different contents (servlets). How to index the menu and the different content? And to realize their interaction?

Closed due to the fact that the essence of the question is incomprehensible by the participants of Streletz , dirkgntly , αλεχολυτ , aleksandr barakin , user194374 5 Sep '16 at 10:04 .

Try to write more detailed questions. To get an answer, explain what exactly you see the problem, how to reproduce it, what you want to get as a result, etc. Give an example that clearly demonstrates the problem. If the question can be reformulated according to the rules set out in the certificate , edit it .

  • Maybe you want to split the jsp file into several files? Or specify more specifically and add a sample code, what and where to include. - MrFylypenko
  • I want several jsp files to be reflected on one page and they interact with each other. Something like obsolete HTML frames. Show nothing. I have jsp but I don’t know how to glue them together :(. I’ve read that they do ajax with help but I'm not into JS with a tooth with my foot - Bogdan Shulga

1 answer 1

here's an example, try this: index.jsp

<%@ page contentType="text/html;charset=UTF-8" language="java" %> <html> <head> <title></title> </head> <body> <jsp:include page="header.jsp"/> <jsp:include page="body.jsp"/> </body> </html> 
  • Yes thank you. Just come to something like that. Only in the div stuffed :). And how from the header on the body to work? While I think ... but the advice does not hurt :) - Bogdan Shulga
  • Well, at least write how to work? What result do you want to get? - MrFylypenko
  • In general, while unscrewing like this: `<form form action =" body.jsp "method =" post "> <input type =" submit "name =" success "value =" success "/> <input type =" submit "name = "index" value = "index" /> </ form> <% if (request.getParameter ("success")! = null) {System.out.println (request.getParameter ("success"));%> < div class = "block1"> <jsp: include page = "success.jsp"> </ jsp: include> </ div> <%}%> <% if (request.getParameter ("index")!! = null) {System.out.println (request.getParameter ("index"));%> <div class = "block1"> <jsp: include page = "index.jsp"> </ jsp: include> </ div> < %}%> ` - Bogdan Shulga