[go: up one dir, main page]

Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Eclipse Web Tools Platform Project (WTP) » Control+Click on EL expression in Facelets not working in Eclipse after migration to Jakarta EE
Control+Click on EL expression in Facelets not working in Eclipse after migration to Jakarta EE [message #1871190] Wed, 18 September 2024 00:48 Go to next message
Himanshu Joshi is currently offline Himanshu JoshiFriend
Messages: 1
Registered: September 2024
Junior Member
I recently migrated project from javax to Jakarta EE v10, jdk 11 to 17, and Tomcat 10.1, primefaces v13

In earlier project, when I opened .xhtml files, and pressed control and clicked on any java class or method, it used to navigate to that specific method/file.

After migration, this has stopped working and so is code assist in xhtml files for java classes/methods.

My classes are defined as:
import jakarta.inject.Named;
import org.springframework.web.context.annotation.SessionScope;

@Named(LoginWorkBean.NAME)
@SessionScope
public class LoginWorkBean {
      private static final long serialVersionUID = 2383439018xL;
      public static final String NAME = "loginWorkBean";
      public String userName; //and getters and setters
}


xhtml files:
Here, earlier, If I pressed ctrl and click on loginWorkBean it will take me to above class. Now, after migration, this has stopped working, it throws no error/exceptions.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "hxxp://wxw.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xml:lang="en" lang="en" xmlns="hxxp://wxw.w3.org/1999/xhtml"
    xmlns:ui="hxxp://java.sun.com/jsf/facelets"
    xmlns:h="hxxp://java.sun.com/jsf/html"
    xmlns:o="hxxp://omnifaces.org/ui" xmlns:p="hxxp://primefaces.org/ui"
    xmlns:f="hxxp://java.sun.com/jsf/core">
    <ui:composition>
        <h:outputText
                value="#{loginWorkBean.userName}"
                styleClass="bold" escape="false" />
    </ui:composition>
</html>

faces-config.xhtml:
<?xml version="1.0" encoding="UTF-8"?>
<faces-config xmlns="hxxp://jakarta.ee/xml/ns/jakartaee"
    xmlns:xsi="hxxp://wxw.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="hxxp://jakarta.ee/xml/ns/jakartaee
        hxxp://jakarta.ee/xml/ns/jakartaee/web-facesconfig_4_0.xsd"
    version="4.0">
</faces-config>

web.xml:
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="hxxp://wxw.w3.org/2001/XMLSchema-instance"
    xmlns="hxxp://jakarta.ee/xml/ns/jakartaee"
    xmlns:web="hxxp://xmlns.jcp.org/xml/ns/javaee"
    xsi:schemaLocation="hxxp://jakarta.ee/xml/ns/jakartaee hxxp://jakarta.ee/xml/ns/jakartaee/web-app_5_0.xsd hxxp://xmlns.jcp.org/xml/ns/javaee hxxp://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
    id="WebApp_ID" version="5.0">
     <context-param>
        <param-name>jakarta.faces.CONFIG_FILES</param-name>
        <param-value>/WEB-INF/faces-config.xml</param-value>
    </context-param>
    <context-param>
        <param-name>jakarta.faces.DATETIMECONVERTER_DEFAULT_TIMEZONE_IS_SYSTEM_TIMEZONE</param-name>
        <param-value>true</param-value>
    </context-param>
    <context-param>
        <param-name>jakarta.faces.DEFAULT_SUFFIX</param-name>
        <param-value>.xhtml</param-value>
    </context-param>
    <context-param>
        <param-name>primefaces.THEME</param-name>
        <param-value>saga</param-value>
    </context-param>
    <context-param>
        <param-name>org.apache.myfaces.AUTOMATIC_EXTENSIONLESS_MAPPING</param-name>
        <param-value>true</param-value>
    </context-param>
</web-app>


Below are my approaches which didn't worked:


  1. Added JBoss Dependency
  2. Converted @SessionScope annotation to @SessionScoped and added @ManagedBean
  3. Added Dependency Spring Tools Suite in Eclipse
  4. Downloaded latest Eclipse IDE for Enterprise Java and Web Developers
  5. Downloaded fresh Jakarta project from Jakarta EE starter, and imported it.
  6. Downloaded MyEclipse and imported my project.
  7. Changed xhtml tags to below:

xmlns="hxxp://wxw.w3.org/1999/xhtml"
xmlns:f="jakarta.faces.core"
xmlns:jsf="jakarta.faces"
xmlns:h="jakarta.faces.html"


Approaches which worked:

  1. In NetBeans IDE it worked as expected. I was able to ctrl+click on java classes/methods and navigate to them, the code assist also worked. But I am used to Eclipse and I want to support this for my Jakarta project as well.
  2. Sometime cmd+. works for auto completion/code suggestion but they are not exact variable names.


Let me know if you need more information. Thank you!
Re: Control+Click on EL expression in Facelets not working in Eclipse after migration to Jakarta EE [message #1871205 is a reply to message #1871190] Wed, 18 September 2024 05:29 Go to previous message
Erik BrangsFriend
Messages: 55
Registered: February 2010
Member
The JSF tooling from Eclipse WTP does not yet support Jakarta Faces: https://github.com/eclipse-jsf/webtools.jsf/issues/8
Previous Topic:Hot deploy stopped working
Next Topic:Issue with jakarta faces
Goto Forum:
  


Current Time: Fri Dec 13 11:18:35 GMT 2024

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

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

Back to the top