Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
thethuy nguyen
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64845
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic