• Post Reply Bookmark Topic Watch Topic
  • New Topic

head tag in JSP  RSS feed

 
trupti nigam
Ranch Hand
Posts: 640
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can a JSP have two head tags.
I mean I have a form JSP and a result JSP. The Result JSP includes the form JSP. Both has head tag in it. But for some reason, when I call the action class, the final result page displays only the for JSP and does not include the result JSP. I ahve put some scriptlets to print few lines in the result JSP. On the server logs I can see the control goes till the end of the Result JSP but it's not displayed on the browser.

IS it because I have 2 head tags in both the JSPs?

Thanks,
Trupti
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65833
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by trupti nigam:
Can a JSP have two head tags.


This really has nothing to do with JSP. Remember that JSP is merely a server-side templating technology to spit out an HTML page.

And no, an HTML page cannot have two <head> tags and be considered valid.

I mean I have a form JSP and a result JSP. The Result JSP includes the form JSP. Both has head tag in it.


Why? If one of the files is merely a fragment, why would it have a head tag?

but it's not displayed on the browser.


Probably because your HTML is invalid. When all is said and done, the HTML page that is sent to the browser must be valid for it to work correctly.
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!