Closed Thread Icon

Topic awaiting preservation: JSP Includes (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=12108" title="Pages that link to Topic awaiting preservation: JSP Includes (Page 1 of 1)" rel="nofollow" >Topic awaiting preservation: JSP Includes <span class="small">(Page 1 of 1)</span>\

 
WarMage
Maniac (V) Mad Scientist

From: Rochester, New York, USA
Insane since: May 2000

posted posted 03-13-2002 05:42

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-

WarMage
Maniac (V) Mad Scientist

From: Rochester, New York, USA
Insane since: May 2000

posted posted 03-14-2002 00:34

Got it, it works exactly the same as php!

-mage-

« BackwardsOnwards »

Show Forum Drop Down Menu