简体   繁体   English

如何在我的xhtml页面中重新激活代码辅助(eclipse 3.5,jboss tools 3.1,jsf 1.2)

[英]How to reactivate code assist in my xhtml page (eclipse 3.5, jboss tools 3.1, jsf 1.2)

I develop jsf xhtml pages with facelets, and I always had code assist for all the taglibs i declared i my xhtml root element (h, f etc..) 我使用facelets开发jsf xhtml页面,并且我总是为所有taglib提供代码辅助,我声明了我的xhtml根元素(h,f等...)

But, since, like 30 minutes, when i ctrl+space i only have regular html and ui:* proposals. 但是,因为,像30分钟,当我按Ctrl +空格我只有常规的html和ui:*提议。

I didn't change anything. 我什么都没改变。 It just broke, no error message, nothing. 它只是破了,没有错误信息,没有。

I searched the web, but nothing either, or i am not searching right. 我在网上搜索,但也没有,或者我没有正确搜索。

Please help me :) 请帮我 :)

ps : here's an example of one of my xhtml page's header : ps:这是我的一个xhtml页面标题的示例:

<?xml version="1.0" encoding="ISO-8859-1"?>
<ui:composition xmlns="http://www.w3.org/1999/xhtml" 
 xmlns:ui="http://java.sun.com/jsf/facelets" 
 xmlns:h="http://java.sun.com/jsf/html"
 xmlns:f="http://java.sun.com/jsf/core" 
 xmlns:a4j="http://richfaces.org/a4j" 
 xmlns:r="http://richfaces.org/rich"
 xmlns:c="http://java.sun.com/jstl/core"
 xmlns:s="http://jboss.com/products/seam/taglib">
  1. Right click on the project, choose properties, select “Project Facets“, make sure the “JavaServer Faces” is checked. 右键单击项目,选择属性,选择“Project Facets”,确保选中“JavaServer Faces”。 If it is checked go to step 2. 如果选中,请转到步骤2。

  2. Create an user library and include the JSF API and implementation library, jsf-api-xxx.jar and jsf-impl-xxx.jar. 创建用户库并包含JSF API和实现库jsf-api-xxx.jar和jsf-impl-xxx.jar。 It will add the JSF capabilities to your project. 它将为您的项目添加JSF功能。

If you don't understand click: http://www.mkyong.com/jsf2/eclipse-ide-xhtml-code-assist-is-not-working-for-jsf-tag/ 如果你不理解点击: http//www.mkyong.com/jsf2/eclipse-ide-xhtml-code-assist-is-not-working-for-jsf-tag/

Best Regards. 最好的祝福。

Firstly: 首先:

  1. Check the content assist options. 检查内容辅助选项。
  2. Check the Error Log and search for any messages you suspect are related. 检查错误日志并搜索您怀疑与之相关的任何消息。 As well as Google, check bugs.eclipse.org . 和Google一样,请查看bugs.eclipse.org

It hasn't been unknown for bugs to leave workspaces with cached state that can adversely affect behaviour. 对于错误而言,将工作空间保留为可能会对行为产生负面影响的缓存状态并不为人所知。 You can try these tricks: 你可以尝试这些技巧:

  1. Close and reopen the affected project. 关闭并重新打开受影响的项目。
  2. Start the workspace with the -clean option. 使用-clean选项启动工作区。
  3. Delete the project (but not contents under !) and reimport it as an existing project. 删除项目(但不是! 下的内容 )并将其重新导入为现有项目。
  4. If the workspace is caching something broken, you may be able to delete it by poking around in the workspace/.metadata/.plugins directory. 如果工作空间缓存了某些内容,您可以通过在workspace / .metadata / .plugins目录中进行删除来删除它。 Most of that stuff is fairly transient (though backup first and watch for deleted preferences). 大部分内容都是相当短暂的(尽管先备份并观察已删除的首选项)。

Adding xhtml to JSP content types worked for me. 将xhtml添加到JSP内容类型对我有用。 Window > Preferences > General > Content Types > Text > JSP. 窗口>首选项>常规>内容类型>文本> JSP。

Ok, here's the solution that worked for me : 好的,这是适用于我的解决方案:

ProjectWebApp > properties > Projet Facets > switched "Java 5.0" to 6.0 ProjectWebApp> properties> Projet Facets>将“Java 5.0”切换为6.0

That did the trick. 这就是诀窍。

My solution for similar problem when migrating from the JBoss Developer Studio version 1 to version 3: 从JBoss Developer Studio版本1迁移到版本3时,我遇到类似问题的解决方案:

Check xmlns entries, they should look as follows: 检查xmlns条目,它们应如下所示:

...
xmlns:a="http://richfaces.org/a4j"
xmlns:rich="http://richfaces.org/rich">

The old ones in my case were: 在我的案例中,旧的是:

...
xmlns:rich="http://richfaces.ajax4jsf.org/rich"
xmlns:a="https://ajax4jsf.dev.java.net/ajax">

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM