I have been trying to get a bit more comfortable with JSP. It is not quite as easy to use a PHP is. What I am wondering about is page includes.
In php I might have something similar to:
code:
<?php
$pageTitle = "This Page";
$modifiedBy = "Developer Name";
$modifiedDate = "M DD, YYYY";
?>
<?php include(header file); ?>
<p>Content</p>
<?php include(footer file); ?>
This file would take the variables from the top and put them into both the header and the footer. This would make it easy to keep standard headers and footer with some dynamic content in them. Like echoing back the page title in the <title> tag.
So, I am not sure how this would work with JSP.
I would imaging something like:
code:
<%!
String pageTitle = "This Page";
String modifiedBy = "Developer Name";
String modifiedDate = "MM DD, YYYY";
%>
<%@ include file = ?header file.jsp" %>
<p>Page Content</p>
<%@ include file = "footer file.jsp" %>
I am not sure how this would work or if this is the correct way to do it.
Would the .jsp pages be parsed? How would this work? Would I do a simple echo...
It is a bit hard for me to move from Java application programming into servlets, knowing the difference from other internet programming languages.
Any help with this would be cool.
-mage-