Prevent child jsp page from inheiriting parent jsp page's scripts and CSS
posted 3 years ago
My problem is that I have a JSP page within a JSP page, and the child JSP page keeps inheriting all of the parent JSP page's scripts (which I don't want), and then the parent JSP page's CSS gets overridden by the child JSP page (which I don't want as well). I am using fancybox to open the child JSP page through an ajax get call. Is there a way to tell the pages not to take any scripts or css from parent and child?
There is no such thing as a page in a page. Including JSPs in another does not created nested pages, a single HTML page is delivered to the client as the response, and that's all that matters.
And the CSS and script defined in that page is in scope for the entire page. There's nothing that can be done about that.
If your CSS is causing problems in the elements that make up the dialog in the page, then you need to write the CSS selectors such that they do not apply to the element that you do not wish to apply them to. Or write rules to override the unwanted rules.