Creator Tip: CSS based templates for similar page look and feel

One of the powerful features of Sun Java Studio Creator is the ability to save your web pages as template. New pages could be created using the saved page template. This gives a powerful way to make most of the pages in your web site with similar look and feel. I have created a simple website with one page that can be saved as template and then used to create other additional pages with that template for same look and feel. You can down load the project from here.

In order to use the page in this project as template, do the following.

  • Download the project and extract the zip
  • Open the project in Creator 2 Update 1.
  • Right click on the project (SampleTemplate1) and select "Save Project As"
  • In the dialog select the location and project name for the new project. You can also check "Add project to template list" checkbox. Next time when you create a project you will see your project as template under the Category "My Templates". You can create new project using this saved project template. (Note: Unfortunately because of a bug in Creator the package name will be same as the original project)
  • Now, open the new "Saved As" project. You should see all the contents from the original project including WebTemplate1.jsp
  • Right click on the WebTemplate1.jsp and select  "Save as Template".
  • In the popup dialog select the Category Template -> Web Pages and click OK. Your page is saved as template.
  • To create a new web page with the saved template, right click and do Web Pages -> New -> File/Folder
  • Select the WebTemplate1.jsp. (Now onwards you will see  Web Pages -> New ->WebTemplate1.jsp.

Bingo!. You have created a new page with exact look feel as the template page. Now go ahead and modify the new page as per your heart's content. You can create any number of web pages from the template with similar look and feel.

The web page template I created looks like the following image.


<strong>This site has alignment problems</strong>

Posted by guest on July 06, 2006 at 01:21 AM PDT #

Could you please explain more in detail, which browser and what kind of alignment problem etc. I tested with Firefox 1.5 & IE 6 and seems to look OK. Thanks

Posted by Winston Prakash on July 14, 2006 at 02:51 AM PDT #

not problem with IE 6 as I khow...

Posted by Alex on July 22, 2006 at 01:24 AM PDT #

And with Firefox too

Posted by Alex on July 22, 2006 at 01:27 AM PDT #

I have just moved from .NET to Java, and Your example is great. However I have a small issue. I modified the example to make 3 layers: header, contents, and footer. However, I can not make the contents layer take 100% height (the maximum height no matter of the window size), so that the user can not see empty spaces above the header or below the footer regardless of the page size. Can you please help me?

Posted by Ahmed on August 14, 2006 at 04:04 AM PDT #

Hi, your desing is quite nice under 1024x768 but with other resolutions ( i use 1280x1024) it really doesn't make sense. Footer is too high and everything doesn't look nice anymore. Would you please tell me how to create a page which would be nicely centered no matter on what resolution seen ? thank you

Posted by dominik on October 09, 2006 at 12:16 PM PDT #

big thanks for this tip, very useful for me

Posted by Jordan on March 17, 2007 at 07:01 AM PDT #

Hi, Many Thanks for the tip. Im a newbie to the visual web pack. I have created a template and have used it to create a new page. when I run the page, the browser does not render it. it gives me HTTP status 500 message. I have not made any changes to the new page. The template page is working fine and the browser renders it.. Did I miss anything that Im supposed to do.. Any help is appreciated

Posted by Supernus on September 11, 2007 at 11:43 PM PDT #

HTTP 500 means internal error in the server. Look at the Server log file to find out what is going wrong.

Posted by Winston Prakash on September 12, 2007 at 12:41 AM PDT #

It says something like "Servlet.service() for servlet Faces Servlet threw exception
org.apache.jasper.JasperException:/Home.jsp(5,25) #{...} not allowed in a template text body."

Posted by Supernus on September 12, 2007 at 01:52 AM PDT #

Hi, i'm new to netbeans. can I apply a template to an existing page?

i make a template, I create a page based on this template, but if I decide to change the template how do I apply the changes to my page?


Posted by cristina on September 19, 2007 at 01:46 AM PDT #

I got this as well..

"It says something like "Servlet.service() for servlet Faces Servlet threw exception
org.apache.jasper.JasperException:/Home.jsp(5,25) #{...} not allowed in a template text body."

Posted by Supernus on September 12, 2007 at 08:52 AM PDT #"

Posted by cristina on September 19, 2007 at 01:48 AM PDT #

css web template page (example) --

Posted by :-: S€zæR -> on May 13, 2008 at 02:18 PM PDT #

HI i need your help i really want to create my own website/web page but i dont know how to go about doing it so can you please help me out

Posted by chester.. on May 22, 2008 at 11:57 PM PDT #

you should also try to use free templates from

Posted by templates on July 10, 2008 at 12:40 AM PDT #

Post a Comment:
  • HTML Syntax: NOT allowed

« June 2016