Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » Problems with JSF Pages(Unable to create .xhtml file etc)
Problems with JSF Pages [message #533205] Wed, 12 May 2010 14:49 Go to next message
No real name is currently offline No real name
Messages: 6
Registered: May 2010
Junior Member
I'm using Exlipse version 3.4.2 and am having a very hard time figuring out how to create JSF pages that use any extension other than JSP... this has prevented me from creating even the simplest JSF facelet application by following the many on-line tutorials.

All of the facelets tutorials that I've found describe a step in which an HTML page is added and the user selects "New Facelet Template." There is no such option in my version of Eclipse... I noticed, however, that if I pick JSP there is an option to create a page using a "New JavaServer Faces (JSF) Page (xhtml)... I would have thought that this would create a .html page but it does not - I end up with a .JSP page...

Another question is how I get support for JSF 2.0... in my version of Eclipse I only have the option to select JSF 1.1 or JSF 1.2... I've downloaded and installed the latest WTP so I would have thought I'd get JSF 2.0 support - is this not available?

A final question related to all the above points is whether there is any tutorial out there that can be successfully folled using Exlipse - again, all the examples I've seen show different page creation options etc which I can't follow...
Re: Problems with JSF Pages [message #533223 is a reply to message #533205] Wed, 12 May 2010 15:28 Go to previous messageGo to next message
Eric Rizzo is currently offline Eric Rizzo
Messages: 2300
Registered: July 2009
Senior Member
This might get more response in the Web Tools (WTP) group.

Hope this helps,
Eric


On 5/12/10 10:49 AM, jeff.rowell@cgi.com wrote:
> I'm using Exlipse version 3.4.2 and am having a very hard time figuring
> out how to create JSF pages that use any extension other than JSP...
> this has prevented me from creating even the simplest JSF facelet
> application by following the many on-line tutorials.
> All of the facelets tutorials that I've found describe a step in which
> an HTML page is added and the user selects "New Facelet Template." There
> is no such option in my version of Eclipse... I noticed, however, that
> if I pick JSP there is an option to create a page using a "New
> JavaServer Faces (JSF) Page (xhtml)... I would have thought that this
> would create a .html page but it does not - I end up with a .JSP page...
> Another question is how I get support for JSF 2.0... in my version of
> Eclipse I only have the option to select JSF 1.1 or JSF 1.2... I've
> downloaded and installed the latest WTP so I would have thought I'd get
> JSF 2.0 support - is this not available?
>
> A final question related to all the above points is whether there is any
> tutorial out there that can be successfully folled using Exlipse -
> again, all the examples I've seen show different page creation options
> etc which I can't follow...
Re: Problems with JSF Pages [message #533245 is a reply to message #533205] Wed, 12 May 2010 16:48 Go to previous messageGo to next message
Russell Bateman is currently offline Russell Bateman
Messages: 3219
Registered: July 2009
Location: Provo, Utah, USA
Senior Member

On 5/12/2010 8:49 AM, jeff.rowell@cgi.com wrote:
> I'm using Exlipse version 3.4.2 and am having a very hard time figuring
> out how to create JSF pages that use any extension other than JSP...
> this has prevented me from creating even the simplest JSF facelet
> application by following the many on-line tutorials.
> All of the facelets tutorials that I've found describe a step in which
> an HTML page is added and the user selects "New Facelet Template." There
> is no such option in my version of Eclipse... I noticed, however, that
> if I pick JSP there is an option to create a page using a "New
> JavaServer Faces (JSF) Page (xhtml)... I would have thought that this
> would create a .html page but it does not - I end up with a .JSP page...
> Another question is how I get support for JSF 2.0... in my version of
> Eclipse I only have the option to select JSF 1.1 or JSF 1.2... I've
> downloaded and installed the latest WTP so I would have thought I'd get
> JSF 2.0 support - is this not available?
>
> A final question related to all the above points is whether there is any
> tutorial out there that can be successfully folled using Exlipse -
> again, all the examples I've seen show different page creation options
> etc which I can't follow...

Jeff,

A couple of years ago, I went through Kent Tong's excellent book using
Eclipse Europa (3.3). All the exercises worked and it did some of what
you're talking about (xhtml, in particular). I don't remember if it
covered JSF 2.0, however. Check this book out at
http://www.agileskills2.org/EssentialJSF/ I went through the free
chapters, then spent the $20 to get the whole thing.

Russ
Re: Problems with JSF Pages [message #533265 is a reply to message #533245] Wed, 12 May 2010 19:21 Go to previous messageGo to next message
No real name is currently offline No real name
Messages: 6
Registered: May 2010
Junior Member
Thanks for suggesting that book Russ - it certainly helped me understand some aspects of JSF environment configuration a bit better - and I did manage to get a simple JSF page to load... unfortunately, however, when I tried to make the page a bit more complex by referencing a backing bean I ended up getting the following error:

org.apache.jasper.JasperException: /hello.jsp(20,25) #{...} is not allowed in template text

There are lots of posts regarding this error on the net, but I haven't been able to understand from them what the cause or solution is... even if I could figure that out thought, I'd still be no closer to my original problem which was to figure out how to use Templating in JSF - whuch requires, I believe, the use of non-JSP pages...
Re: Problems with JSF Pages [message #533286 is a reply to message #533265] Wed, 12 May 2010 23:58 Go to previous messageGo to next message
Russell Bateman is currently offline Russell Bateman
Messages: 3219
Registered: July 2009
Location: Provo, Utah, USA
Senior Member

On 5/12/2010 1:21 PM, jeff.rowell@cgi.com wrote:
> Thanks for suggesting that book Russ - it certainly helped me understand
> some aspects of JSF environment configuration a bit better - and I did
> manage to get a simple JSF page to load... unfortunately, however, when
> I tried to make the page a bit more complex by referencing a backing
> bean I ended up getting the following error:
>
> org.apache.jasper.JasperException: /hello.jsp(20,25) #{...} is not
> allowed in template text
>
> There are lots of posts regarding this error on the net, but I haven't
> been able to understand from them what the cause or solution is... even
> if I could figure that out thought, I'd still be no closer to my
> original problem which was to figure out how to use Templating in JSF -
> whuch requires, I believe, the use of non-JSP pages...

This is not, of course, an Eclipse question. There is a better forum for
JSF at JavaRanch. If you wish to ask me specific questions directly, I
may or may not be able to help, but we can see.

Russ
Re: Problems with JSF Pages [message #533419 is a reply to message #533286] Thu, 13 May 2010 19:14 Go to previous messageGo to next message
No real name is currently offline No real name
Messages: 6
Registered: May 2010
Junior Member
I'm happy to say that I got Facelets working... I ended up comming accross a page ( http://jsflessons.blogspot.com/2009/03/intorduction-to-facel ets.html) which gave me clear instructions on how to obtain and install the plugins to Eclipse... i.e. you need to obtain the JSF Facelets Tools from the "JSF Facelets Tools - WTP Incubator project " at the following URL:

http://www.eclipse.org/webtools/incubator/downloads/ and move the four jar files in the zip file to the plugins folder in Eclipse...

For some reason the instructions go to state that you must add the following files to the Exclipse preferences under "Windows->Preferences->Java->Build Path->Use Libraries"

commons-digester.jar
commons-logging.jar
commons-collections.jar
commons-beanutils.jar

I have no idea where these jar files come from - they aren't in the package I downloaded and Eclipse seems to work perfectly fine without them... I now can create facelets in xhtml pages and see all of the page setup options relating to Facelets!
Re: Problems with JSF Pages [message #533434 is a reply to message #533419] Thu, 13 May 2010 20:32 Go to previous messageGo to next message
Russell Bateman is currently offline Russell Bateman
Messages: 3219
Registered: July 2009
Location: Provo, Utah, USA
Senior Member

On 5/13/2010 1:14 PM, jeff.rowell@cgi.com wrote:
> I'm happy to say that I got Facelets working... I ended up comming
> accross a page
> ( http://jsflessons.blogspot.com/2009/03/intorduction-to-facel ets.html)
> which gave me clear instructions on how to obtain and install the
> plugins to Eclipse... i.e. you need to obtain the JSF Facelets Tools
> from the "JSF Facelets Tools - WTP Incubator project " at the following
> URL:
>
> http://www.eclipse.org/webtools/incubator/downloads/ and move the four
> jar files in the zip file to the plugins folder in Eclipse...
> For some reason the instructions go to state that you must add the
> following files to the Exclipse preferences under
> "Windows->Preferences->Java->Build Path->Use Libraries"
> commons-digester.jar commons-logging.jar commons-collections.jar
> commons-beanutils.jar
> I have no idea where these jar files come from - they aren't in the
> package I downloaded and Eclipse seems to work perfectly fine without
> them... I now can create facelets in xhtml pages and see all of the page
> setup options relating to Facelets!
>

It would not go amiss for you to write up a short tutorial on
templating, JSF and Facelets (synthesizing what you've learned). If you
need a place to publish it, I can offer room on my own server.

Russ
Re: Problems with JSF Pages [message #533539 is a reply to message #533434] Fri, 14 May 2010 13:48 Go to previous messageGo to next message
Eric Rizzo is currently offline Eric Rizzo
Messages: 2300
Registered: July 2009
Senior Member
On 5/13/10 4:32 PM, Russ Bateman wrote:
> On 5/13/2010 1:14 PM, jeff.rowell@cgi.com wrote:
>> I'm happy to say that I got Facelets working... I ended up comming
>> accross a page
>> ( http://jsflessons.blogspot.com/2009/03/intorduction-to-facel ets.html)
>> which gave me clear instructions on how to obtain and install the
>> plugins to Eclipse... i.e. you need to obtain the JSF Facelets Tools
>> from the "JSF Facelets Tools - WTP Incubator project " at the following
>> URL:
>>
>> http://www.eclipse.org/webtools/incubator/downloads/ and move the four
>> jar files in the zip file to the plugins folder in Eclipse...
>> For some reason the instructions go to state that you must add the
>> following files to the Exclipse preferences under
>> "Windows->Preferences->Java->Build Path->Use Libraries"
>> commons-digester.jar commons-logging.jar commons-collections.jar
>> commons-beanutils.jar
>> I have no idea where these jar files come from - they aren't in the
>> package I downloaded and Eclipse seems to work perfectly fine without
>> them... I now can create facelets in xhtml pages and see all of the page
>> setup options relating to Facelets!
>>
>
> It would not go amiss for you to write up a short tutorial on
> templating, JSF and Facelets (synthesizing what you've learned). If you
> need a place to publish it, I can offer room on my own server.

The Eclipse wiki would be a good choice for where to publish such a thing.

Eric
Re: Problems with JSF Pages [message #533547 is a reply to message #533539] Fri, 14 May 2010 14:11 Go to previous messageGo to next message
No real name is currently offline No real name
Messages: 6
Registered: May 2010
Junior Member
Thanks for the suggestions - I'll try to put together some notes to describe my finding.... but today, for some reason that I can't explain I've hit another problem... my JSF facelet appliction worked fine yesterday, but today when I tried to run it I get an HTTPS 404 error... my machine was rebooted last night so I presume something changed as a result....

Fundamentally I'm very confused by how Exclipse is integrating with Tomcat... if I start Tomcat from a DOS promt I am able to open the Tomcat home page by entering http://localhost:8080 in a browser window (i.e. IE)... the Server status in Exclipse, however, shows "stopped". If I start the server from within Eclipse I get an error indicating that Tomcat is already running... also, when I shutdown Tomcat from a DOS prompt and then start it in Eclipse I am not able to view the Tomcat home page by entering http://localhost:8080 in a browser window...

I presume that I most have some conflict in my Exclipse settings somewhere - I had another version of Tomcat installed until yesterday - I downloaded a new copy and re-installed yesterday in an attempt to get my JSF application working - could there still must be some invalid reference to the old installation somewhere... not sure how to proceed with trouble-shooting this.

Re: Problems with JSF Pages [message #533563 is a reply to message #533547] Fri, 14 May 2010 14:53 Go to previous messageGo to next message
Russell Bateman is currently offline Russell Bateman
Messages: 3219
Registered: July 2009
Location: Provo, Utah, USA
Senior Member

On 5/14/2010 8:11 AM, jeff.rowell@cgi.com wrote:
> Thanks for the suggestions - I'll try to put together some notes to
> describe my finding.... but today, for some reason that I can't explain
> I've hit another problem... my JSF facelet appliction worked fine
> yesterday, but today when I tried to run it I get an HTTPS 404 error...
> my machine was rebooted last night so I presume something changed as a
> result....
> Fundamentally I'm very confused by how Exclipse is integrating with
> Tomcat... if I start Tomcat from a DOS promt I am able to open the
> Tomcat home page by entering http://localhost:8080 in a browser window
> (i.e. IE)... the Server status in Exclipse, however, shows "stopped". If
> I start the server from within Eclipse I get an error indicating that
> Tomcat is already running... also, when I shutdown Tomcat from a DOS
> prompt and then start it in Eclipse I am not able to view the Tomcat
> home page by entering http://localhost:8080 in a browser window...
>
> I presume that I most have some conflict in my Exclipse settings
> somewhere - I had another version of Tomcat installed until yesterday -
> I downloaded a new copy and re-installed yesterday in an attempt to get
> my JSF application working - could there still must be some invalid
> reference to the old installation somewhere... not sure how to proceed
> with trouble-shooting this.

This is a perennial problem, one I've fought a lot without yet
discovering a solution. I've tried many things, but the one that's been
the most reliable has been to remove the Server project from the Project
Explorer and also from the Server view (pane). Then re-create it, add in
the project, etc. and run again.

I think it has to do with how Eclipse publishes (or fails to publish) a
project's JAR subsequent times to Tomcat, but I'm not familiar enough
with the details to have reached a conclusion yet. I've recently had a
discussion with Larry Isaacs in the Eclipse WTP forum about this.

If you care and are interested enough, you can look at some things I've
said about this at

http://www.javahotchocolate.com/tutorials/jsf-notes.html#bad -output

and a few of the subsequent sections. (Eventually, these notes will
become a tutorial on writing JSFs.)

If you figure it out, please let me know.

Russ
Re: Problems with JSF Pages [message #533620 is a reply to message #533547] Fri, 14 May 2010 18:36 Go to previous messageGo to next message
Eric Rizzo is currently offline Eric Rizzo
Messages: 2300
Registered: July 2009
Senior Member
On 5/14/10 10:11 AM, jeff.rowell@cgi.com wrote:
> Thanks for the suggestions - I'll try to put together some notes to
> describe my finding.... but today, for some reason that I can't explain
> I've hit another problem... my JSF facelet appliction worked fine
> yesterday, but today when I tried to run it I get an HTTPS 404 error...
> my machine was rebooted last night so I presume something changed as a
> result....
> Fundamentally I'm very confused by how Exclipse is integrating with
> Tomcat... if I start Tomcat from a DOS promt I am able to open the
> Tomcat home page by entering http://localhost:8080 in a browser window
> (i.e. IE)... the Server status in Exclipse, however, shows "stopped". If
> I start the server from within Eclipse I get an error indicating that
> Tomcat is already running... also, when I shutdown Tomcat from a DOS
> prompt and then start it in Eclipse I am not able to view the Tomcat
> home page by entering http://localhost:8080 in a browser window...
>
> I presume that I most have some conflict in my Exclipse settings
> somewhere - I had another version of Tomcat installed until yesterday -
> I downloaded a new copy and re-installed yesterday in an attempt to get
> my JSF application working - could there still must be some invalid
> reference to the old installation somewhere... not sure how to proceed
> with trouble-shooting this.
>
>

First, you really should ask "advanced" questions about the JEE and
web-tools stuff on the Web Tools (WTP) forum group (find it on the
forums home page). I'm copying this response to that group so it will be
in both.
Having said that, from the little I know about how the WTP server
integration works, here's what I think:
Tomcat is essentially just another Java application. You have it
installed somewhere and tell Eclipse where that installation is based,
so that Eclipse can publish to, start, and stop that application. Just
like many other apps, it's possible to start multiple instances of
Tomcat, and that probably actually works fine as long as they're
configured to use different ports.
So if you launch Tomcat manually, Eclipse doesn't really have any way to
know that; it just knows if IT launched Tomcat.
As for viewing the default app, I suspect that is because a standard
installation of Tomcat has some default apps deployed, unless you
configure it otherwise. When Eclipse launches Tomcat, it does so with
specific configuration to only deploy the apps that you've associated,
in Eclipse, with the Tomcat server. It's not surprising to me that
whatever "default" apps are NOT deployed by Eclipse since the idea is
that you tell it what apps to deploy.

Hope this helps,
Eric
Re: Problems with JSF Pages [message #533626 is a reply to message #533620] Fri, 14 May 2010 19:20 Go to previous message
Larry Isaacs is currently offline Larry Isaacs
Messages: 1308
Registered: July 2009
Senior Member
Eric Rizzo wrote:
> On 5/14/10 10:11 AM, jeff.rowell@cgi.com wrote:
>> Thanks for the suggestions - I'll try to put together some notes to
>> describe my finding.... but today, for some reason that I can't explain
>> I've hit another problem... my JSF facelet appliction worked fine
>> yesterday, but today when I tried to run it I get an HTTPS 404 error...
>> my machine was rebooted last night so I presume something changed as a
>> result....
>> Fundamentally I'm very confused by how Exclipse is integrating with
>> Tomcat... if I start Tomcat from a DOS promt I am able to open the
>> Tomcat home page by entering http://localhost:8080 in a browser window
>> (i.e. IE)... the Server status in Exclipse, however, shows "stopped". If
>> I start the server from within Eclipse I get an error indicating that
>> Tomcat is already running... also, when I shutdown Tomcat from a DOS
>> prompt and then start it in Eclipse I am not able to view the Tomcat
>> home page by entering http://localhost:8080 in a browser window...
>>
>> I presume that I most have some conflict in my Exclipse settings
>> somewhere - I had another version of Tomcat installed until yesterday -
>> I downloaded a new copy and re-installed yesterday in an attempt to get
>> my JSF application working - could there still must be some invalid
>> reference to the old installation somewhere... not sure how to proceed
>> with trouble-shooting this.
>>
>>
>
> First, you really should ask "advanced" questions about the JEE and
> web-tools stuff on the Web Tools (WTP) forum group (find it on the
> forums home page). I'm copying this response to that group so it will be
> in both.
> Having said that, from the little I know about how the WTP server
> integration works, here's what I think:
> Tomcat is essentially just another Java application. You have it
> installed somewhere and tell Eclipse where that installation is based,
> so that Eclipse can publish to, start, and stop that application. Just
> like many other apps, it's possible to start multiple instances of
> Tomcat, and that probably actually works fine as long as they're
> configured to use different ports.
> So if you launch Tomcat manually, Eclipse doesn't really have any way to
> know that; it just knows if IT launched Tomcat.
> As for viewing the default app, I suspect that is because a standard
> installation of Tomcat has some default apps deployed, unless you
> configure it otherwise. When Eclipse launches Tomcat, it does so with
> specific configuration to only deploy the apps that you've associated,
> in Eclipse, with the Tomcat server. It's not surprising to me that
> whatever "default" apps are NOT deployed by Eclipse since the idea is
> that you tell it what apps to deploy.
>
> Hope this helps,
> Eric

Details about the Tomcat support in WTP can be found in the Tomcat
FAQ[1]. See if it addresses your questions. As for why your JSF
facelet application stopped working, I would need more details.

Cheers,
Larry

[1] http://wiki.eclipse.org/WTP_Tomcat_FAQ
Previous Topic:Windows 7 Ultimate Clean Install => Eclipse Java Problem
Next Topic:show "Cut" & hide "New Groovy Project" icon on toolbar
Goto Forum:
  


Current Time: Mon Oct 20 10:03:37 GMT 2014

Powered by FUDForum. Page generated in 0.01934 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software