Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » JavaServer Faces » Open Declaration from selection in xhtml
Open Declaration from selection in xhtml [message #476041] Fri, 24 October 2008 15:08 Go to next message
Michael Giroux is currently offline Michael GirouxFriend
Messages: 81
Registered: July 2009
Location: Phoenix, AZ
Member
Is there a plan to implement an "Open Declaration" menu that navigates to
the Java class associated with an action or value reference in xhtml?

For example, if document contains a command button like this:
<h:commandButton value="Search" action="#{commentSearch.search}"
id="commentSearchRequest_searchComments" />

and faces-config.xml contains:
<managed-bean>
<managed-bean-name>commentSearch</managed-bean-name>
<managed-bean-class>
mycompany.CommentSearchBean
</managed-bean-class>
</managed-bean>

It would be nice to be able to go directly to the Java code at
mycompany.CommentSearchBean.search() by placing the cursor in the
#{commentSearch.search} portion of the xhtml document, and selecting an
Open Declaration menu.
Re: Open Declaration from selection in xhtml [message #476042 is a reply to message #476041] Fri, 24 October 2008 16:26 Go to previous messageGo to next message
Michael Giroux is currently offline Michael GirouxFriend
Messages: 81
Registered: July 2009
Location: Phoenix, AZ
Member
Digging a little deeper into this, I see there is a context menu to
navigate from the Web Page Editor to the Java action code. For my
project, selecting the Navigate->Java->Action context menu always produces
an error dialog "The value is either an invalid Expression of the
definition is missing."

Since the project builds and executes I doubt the Expression is invalid,
leaving me with "the definition is missing".

The project was originally a Java project. It was later converted to a
Dynamic Web Project. Now I suspect the project needs further tweaking to
add the JSF Facet.

Is there a document that describes migrating a simple Java project to
support JSF?

Michael
Re: Open Declaration from selection in xhtml [message #476043 is a reply to message #476041] Mon, 27 October 2008 16:16 Go to previous messageGo to next message
Michael Giroux is currently offline Michael GirouxFriend
Messages: 81
Registered: July 2009
Location: Phoenix, AZ
Member
Michael Giroux wrote:

I'm getting a validation error on the xmlns for ui:
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets">

The problem reported on the xmlsn:ui attribute is "Can't find facelet tag
library for uri http://java.sun.com/jsf/facelets"

The project libraries include the following:
Apache Tomcat 6 runtime
Facelets: jsf-facelets-1.1.14.jar
JSTL: jstl-1.2.jar
JSF: Sun Reference Implementation

For the JSF, I have also tried to use the MyFaces jars.

I have created the project two times from top to bottom of the tutorial,
and came up with this error both times.

Does this error "Can't find facelet tag library ..." point to anything
obvious that I'm doing wrong?

Michael
Re: Open Declaration from selection in xhtml [message #476044 is a reply to message #476041] Mon, 27 October 2008 17:59 Go to previous messageGo to next message
Cameron Bateman is currently offline Cameron BatemanFriend
Messages: 481
Registered: July 2009
Senior Member
Michael Giroux wrote:

> Is there a plan to implement an "Open Declaration" menu that navigates to
> the Java class associated with an action or value reference in xhtml?

What you want works (except this one case, see below) if you hold ctrl
down and mouseover the EL expression, you should get a hyperlink that you
can click to take you to the class or method. It works for JSPs. If you
install the Facelets incubator it will work for XHTML for bean classes and
bean properties. Bean method expressions (i.e. bean.action where the
expression binds to BeanClass.action() instead of
BeanClass.get/setAction()) work for JSP, but I just noticed an outage for
XHTML.

I have launched this bug to track:

https://bugs.eclipse.org/bugs/show_bug.cgi?id=252241

You can CC yourself on the bug to track progress.
Re: Open Declaration from selection in xhtml [message #476045 is a reply to message #476042] Mon, 27 October 2008 18:02 Go to previous messageGo to next message
Cameron Bateman is currently offline Cameron BatemanFriend
Messages: 481
Registered: July 2009
Senior Member
> Is there a document that describes migrating a simple Java project to
> support JSF?

Not currently AFAIK. If you find one or want to write/blog one we would
be happy to link for others.

The main steps, as you observe, involve adding the JSF facet (this also
requires adding the Dynamic Web Project and Java facets) and adding the
runtime jars to the classpath (which can be done from the facet install
dialog). To add facets to an existing project, right-click on the
project, select Properties and go to Project Facets in the dialog that
opens.

Thanks,

Cameron
Re: Open Declaration from selection in xhtml [message #476046 is a reply to message #476043] Mon, 27 October 2008 18:05 Go to previous messageGo to next message
Cameron Bateman is currently offline Cameron BatemanFriend
Messages: 481
Registered: July 2009
Senior Member
> The problem reported on the xmlsn:ui attribute is "Can't find facelet tag
> library for uri http://java.sun.com/jsf/facelets"

Have you installed the Facelet incubator tools support? This will be
required since Facelets doesn't provide JSP support that would allow it to
work in basic WTP.
Re: Open Declaration from selection in xhtml [message #476047 is a reply to message #476046] Mon, 27 October 2008 20:11 Go to previous messageGo to next message
Michael Giroux is currently offline Michael GirouxFriend
Messages: 81
Registered: July 2009
Location: Phoenix, AZ
Member
Cameron Bateman wrote:

> Have you installed the Facelet incubator tools support?

Yes. I checked the Help->About->Plugin Feature details menu and see the
feature is installed, version 0.1.0 -- JSF Faceltes Tools - WTP Incubator
Project version 0.1.0.200807291102.

I must have missed a step. I'll try again.

Michael
Re: Open Declaration from selection in xhtml [message #476048 is a reply to message #476044] Mon, 27 October 2008 20:13 Go to previous message
Michael Giroux is currently offline Michael GirouxFriend
Messages: 81
Registered: July 2009
Location: Phoenix, AZ
Member
Cameron Bateman wrote:

> Michael Giroux wrote:

>> Is there a plan to implement an "Open Declaration" menu that navigates to
>> the Java class associated with an action or value reference in xhtml?

> What you want works (except this one case, see below) if you hold ctrl
> down and mouseover the EL expression,


Thanks Cameron. This is what I need.

Michael
Re: Open Declaration from selection in xhtml [message #618571 is a reply to message #476041] Fri, 24 October 2008 16:26 Go to previous message
Michael Giroux is currently offline Michael GirouxFriend
Messages: 81
Registered: July 2009
Location: Phoenix, AZ
Member
Digging a little deeper into this, I see there is a context menu to
navigate from the Web Page Editor to the Java action code. For my
project, selecting the Navigate->Java->Action context menu always produces
an error dialog "The value is either an invalid Expression of the
definition is missing."

Since the project builds and executes I doubt the Expression is invalid,
leaving me with "the definition is missing".

The project was originally a Java project. It was later converted to a
Dynamic Web Project. Now I suspect the project needs further tweaking to
add the JSF Facet.

Is there a document that describes migrating a simple Java project to
support JSF?

Michael
Re: Open Declaration from selection in xhtml [message #618572 is a reply to message #476041] Mon, 27 October 2008 16:16 Go to previous message
Michael Giroux is currently offline Michael GirouxFriend
Messages: 81
Registered: July 2009
Location: Phoenix, AZ
Member
Michael Giroux wrote:

I'm getting a validation error on the xmlns for ui:
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets">

The problem reported on the xmlsn:ui attribute is "Can't find facelet tag
library for uri http://java.sun.com/jsf/facelets"

The project libraries include the following:
Apache Tomcat 6 runtime
Facelets: jsf-facelets-1.1.14.jar
JSTL: jstl-1.2.jar
JSF: Sun Reference Implementation

For the JSF, I have also tried to use the MyFaces jars.

I have created the project two times from top to bottom of the tutorial,
and came up with this error both times.

Does this error "Can't find facelet tag library ..." point to anything
obvious that I'm doing wrong?

Michael
Re: Open Declaration from selection in xhtml [message #618573 is a reply to message #476041] Mon, 27 October 2008 17:59 Go to previous message
Cameron Bateman is currently offline Cameron BatemanFriend
Messages: 481
Registered: July 2009
Senior Member
Michael Giroux wrote:

> Is there a plan to implement an "Open Declaration" menu that navigates to
> the Java class associated with an action or value reference in xhtml?

What you want works (except this one case, see below) if you hold ctrl
down and mouseover the EL expression, you should get a hyperlink that you
can click to take you to the class or method. It works for JSPs. If you
install the Facelets incubator it will work for XHTML for bean classes and
bean properties. Bean method expressions (i.e. bean.action where the
expression binds to BeanClass.action() instead of
BeanClass.get/setAction()) work for JSP, but I just noticed an outage for
XHTML.

I have launched this bug to track:

https://bugs.eclipse.org/bugs/show_bug.cgi?id=252241

You can CC yourself on the bug to track progress.
Re: Open Declaration from selection in xhtml [message #618574 is a reply to message #476042] Mon, 27 October 2008 18:02 Go to previous message
Cameron Bateman is currently offline Cameron BatemanFriend
Messages: 481
Registered: July 2009
Senior Member
> Is there a document that describes migrating a simple Java project to
> support JSF?

Not currently AFAIK. If you find one or want to write/blog one we would
be happy to link for others.

The main steps, as you observe, involve adding the JSF facet (this also
requires adding the Dynamic Web Project and Java facets) and adding the
runtime jars to the classpath (which can be done from the facet install
dialog). To add facets to an existing project, right-click on the
project, select Properties and go to Project Facets in the dialog that
opens.

Thanks,

Cameron
Re: Open Declaration from selection in xhtml [message #618575 is a reply to message #476043] Mon, 27 October 2008 18:05 Go to previous message
Cameron Bateman is currently offline Cameron BatemanFriend
Messages: 481
Registered: July 2009
Senior Member
> The problem reported on the xmlsn:ui attribute is "Can't find facelet tag
> library for uri http://java.sun.com/jsf/facelets"

Have you installed the Facelet incubator tools support? This will be
required since Facelets doesn't provide JSP support that would allow it to
work in basic WTP.
Re: Open Declaration from selection in xhtml [message #618716 is a reply to message #476046] Mon, 27 October 2008 20:11 Go to previous message
Michael Giroux is currently offline Michael GirouxFriend
Messages: 81
Registered: July 2009
Location: Phoenix, AZ
Member
Cameron Bateman wrote:

> Have you installed the Facelet incubator tools support?

Yes. I checked the Help->About->Plugin Feature details menu and see the
feature is installed, version 0.1.0 -- JSF Faceltes Tools - WTP Incubator
Project version 0.1.0.200807291102.

I must have missed a step. I'll try again.

Michael
Re: Open Declaration from selection in xhtml [message #618717 is a reply to message #476044] Mon, 27 October 2008 20:13 Go to previous message
Michael Giroux is currently offline Michael GirouxFriend
Messages: 81
Registered: July 2009
Location: Phoenix, AZ
Member
Cameron Bateman wrote:

> Michael Giroux wrote:

>> Is there a plan to implement an "Open Declaration" menu that navigates to
>> the Java class associated with an action or value reference in xhtml?

> What you want works (except this one case, see below) if you hold ctrl
> down and mouseover the EL expression,


Thanks Cameron. This is what I need.

Michael
Previous Topic:Open Declaration from selection in xhtml
Next Topic:Faces Config Editor only showing Source tab
Goto Forum:
  


Current Time: Fri Apr 19 07:51:41 GMT 2024

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

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

Back to the top