Reputation: 1
Planning to use php-based CMS to manage content of several sites.
But 2 of them are based on Tomcat + JSP, not php - i can't integrate them directly into CMS, so I need to "inject" them from PHP internal. JSP site implemets several web forms, use ajax and live theirs own life, and I need to wrap it with CMS to manage banners, news, articles and other content, placed around jsp form.
I've wrote an proxy.php that took all requests grabs (with file_get_contents(...)) external sites's HTML, parse it with DOMDocument to add prefix to it's resources (was /js/js.js, became /external_site/js/jw.js and etc.), render html directly with "echo" and configured nginx to get static content based on /external_site/.
But the problem is that external site's forms have buttons and links, and all posts should be handled by servlets.
This is not an ideal solution from all points and all traffic should be passed throught CMS.
Main question is there some frameworks or best practice form making such includings ?
Upvotes: 0
Views: 54
Reputation: 1
Think there is another idea.
To use cURL like full request/response proxy for JSP requests. Please, suggest articles or may be a solution of how to create http proxy to plainly pass POST requests (with cookies) without any modifications.
In this way JSP app will expect no difference of who is the source of request. And after getting response, i can prepare correct html for "echo".
Upvotes: 0
Reputation: 11080
No. It would take a ridiculous amount of time/people to create and support such a framework/system/whatever. Your best bet is to replace jsp engines with the cms you are planning to use.
Жесть какая. Мои соболезнования.
Upvotes: 2