This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach 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


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
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: 60765
    
  65

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 agree. Here's the link: http://aspose.com/file-tools
 
subject: Prevent child jsp page from inheiriting parent jsp page's scripts and CSS
 
Similar Threads
Code Too large
ul + new web design = no bullets?
more SCWCD object question
Getting Values in JSPs
request.getAttribute returning null.