Win a copy of The Journey To Enterprise Agility this week in the Agile and Other Processes forum! And see the welcome thread for 20% off.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
Bartenders:
  • Carey Brown
  • Tim Holloway
  • Joe Ess

JSF page Declarations  RSS feed

 
Ranch Hand
Posts: 177
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I came across a really weird thing which has a lot to do
with jsf page declarations and running javascripts.
here is code for two very simple jsf pages
(note: I have not used any IDE help to write the declarations)

Now the fun part, if example2.jsp is run, nothing is shown(blank page) however if you remove the <script></script>
it runs fine.

Note: The javascript file is in the proper location and is being referenced correctly by example1.jsp

Am I missing something here? I have written working apps before with example1.jsp syntax
and the visual web apps with example2.jsp declaration style with extra xmlns attribute for woodstock component library

But this completely caught me offguard, my reference for this syntax was core jsf book.

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is what I use. Try this and see if there is any luck with loose.dtd.

Example:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>

<%@taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<html>
<head>

<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<meta name="GENERATOR" content="Rational Application Developer">
<link rel="stylesheet" type="text/css" href="sdmenu/sdmenu.css" />
<link rel="stylesheet" type="text/css" href="js/datepicker/DatePicker.css" title="Style">
<link rel="stylesheet" type="text/css" href="template/Styles.css" title="Style">
<link rel="stylesheet" type="text/css" href="theme/stylesheet.css" title="Style">
<script type="text/javascript" src="sdmenu/sdmenu.js">
</script>
<script type="text/javascript">

//JS code

</script>
</head>
 
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Rahul Santha wrote:This is what I use. Try this and see if there is any luck with loose.dtd.

You didn't understood the actual problem.

Suggesting the loose DTD makes also no sense. It is a worthless DTD which only triggers browsers to non-standards mode. you should be using strict. Also coming up with some irrelevant autogenerated meta headers and stylesheets would only confuse the topicstarter more.

Regarding to the actual problem: in JSPX you should wrap plain template text inside jsp:text tags. I wouldn't recommend using JSPX for JSF. I suggest you to take a look for Facelets: https://facelets.dev.java.net/nonav/docs/dev/docbook.html
 
Bauke Scholtz
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Kavita Tipnis wrote:
But this completely caught me offguard, my reference for this syntax was core jsf book.

I should add, Facelets is going to replace JSP as the default suported view technology in the upcoming JSF 2.0 (currently in beta release). It is really worth the effort to go for Facelets.
 
Kavita Tipnis
Ranch Hand
Posts: 177
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I had a look at Facelets, and that looks promising, for right now I am just sticking to declarations using taglibs.
Thanks !
 
Bauke Scholtz
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You're welcome.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!