This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes JSP and the fly likes Prevent child jsp page from inheiriting parent jsp page's scripts and CSS Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » JSP
Bookmark "Prevent child jsp page from inheiriting parent jsp page Watch "Prevent child jsp page from inheiriting parent jsp page New topic
Author

Prevent child jsp page from inheiriting parent jsp page's scripts and CSS

thethuy nguyen
Greenhorn

Joined: Jul 25, 2012
Posts: 5
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?

thanks in advance
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 63195
    
  69

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.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: Prevent child jsp page from inheiriting parent jsp page's scripts and CSS
 
jQuery in Action, 3rd edition