aspose file tools*
The moose likes JSF and the fly likes JSF page Declarations Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "JSF page Declarations" Watch "JSF page Declarations" New topic
Author

JSF page Declarations

Kavita Tipnis
Ranch Hand

Joined: Sep 21, 2008
Posts: 177
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.

Rahul Santha
Greenhorn

Joined: Apr 17, 2008
Posts: 12
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>

Thanks!<br />Rahul, IOWA
Bauke Scholtz
Ranch Hand

Joined: Oct 08, 2006
Posts: 2458
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

Joined: Oct 08, 2006
Posts: 2458
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

Joined: Sep 21, 2008
Posts: 177
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

Joined: Oct 08, 2006
Posts: 2458
You're welcome.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JSF page Declarations