分析Facelets代码时查找JSF托管Bean实现类 [英] Finding a JSF managed bean implementation class while analyzing Facelets code

查看:55
本文介绍了分析Facelets代码时查找JSF托管Bean实现类的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您正在分析别人编写的一个非常大的JSF Web应用程序的Facelets代码(例如,在生产事件期间),并且您想找到实现bean的bean类,并且知道它在EL表达式中的名称.

You are analyzing the Facelets code of a very large JSF web application written by others (e.g. during a production incident) and you want to find the bean class that is implementing a bean, knowing its name as it comes in EL expression.

您没有编写它,并且Bean的名称与项目中的任何Java类都不匹配.

You didn't write it and the bean's name does not match any Java class in the project.

您不能假定该类是带注释的.

You can't assume that the class is annotated.

虽然有几种方法可以达到相同的结果,但我希望这个问题能够记录解决该问题的最佳实践.

While there are several methods to reach to the same result, I hope this question can document the best practices to solve this problem.

注意:此问题不是关于如何启用IDE选项的问题,而是关于在没有IDE支持的情况下如何处理它的问题.我已经进行了很多搜索,但在此处表达的术语中,在StackOverflow中没有找到这个问题.

NOTE: This question is not about how to enable an IDE option to do so, it is about how to deal with it, without IDE support. I have made many searches and haven't found this question in StackOverflow, in the terms expressed here.

推荐答案

打印!

(-)需要重新部署.

  • 编辑XHTML文件以写出类的名称

<!-- #{msg.getClass().getSimpleName()} -->  

  • 重新部署修改后的XHTML文件

  • Redeploy the modified XHTML file

重新加载页面

查找注释

(-)并不总是有效

  • 在工作区中搜索注释("@ManagedBean")并找到注释.

查看Face-Config

  • 搜索faces-config.xml(例如ResourceBundles)

IDE支持

  • E.g. Eclipse with JBoss Tools EL proposals / autocomplete / code assist in Facelets with Eclipse

这篇关于分析Facelets代码时查找JSF托管Bean实现类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆