Java 使用Facelets/JSF显示动态视图
我即将开始一个使用JSF/Facelets的项目,该项目将与第三方库集成 此第三方库包含屏幕定义,并具有以下API:Java 使用Facelets/JSF显示动态视图,java,jsf,facelets,Java,Jsf,Facelets,我即将开始一个使用JSF/Facelets的项目,该项目将与第三方库集成 此第三方库包含屏幕定义,并具有以下API: /** This method gets the screen information**/ public Screen getScreen(int screenId); /** This method gets the first screen id **/ public int getFirstScreenId(); /** This method submits the
/** This method gets the screen information**/
public Screen getScreen(int screenId);
/** This method gets the first screen id **/
public int getFirstScreenId();
/** This method submits the screen with the user supplied
values and gets the next screen id **/
public int submitScreen(int screenId, Map<String,Sring> keyValuePair)
throws ScreenValidationException;
/**此方法获取屏幕信息**/
公共屏幕getScreen(int screenId);
/**此方法获取第一个屏幕id**/
public int getFirstScreenId();
/**此方法提交用户提供的屏幕
值并获取下一个屏幕id**/
public int submitScreen(int screenId,Map keyValuePair)
抛出ScreenValidationException;
“Screen”对象包含控件列表。“控件”是一个大约有25个实现的接口
-即LabelControl、TextBoxControl、TextArea Control、DropDownList Control等
以下是如何使用API从用户收集数据的示例:
步骤1:调用getFirstScreenId()==>这将向用户返回要显示的第一个屏幕的id
步骤2:使用屏幕id调用getScreen()
步骤3:步骤2中返回的Screen对象具有控件列表。向用户显示屏幕的HTML表示形式以及所有控件(作为HTML表单)
步骤4:用户已提交HTML表单。使用submitScreen()提交值。
第三方库将返回下一个屏幕id,如果没有更多屏幕显示,则返回-1
步骤5:重复步骤2-4,直到submitScreen()返回-1。如果返回-1,则表示
数据收集步骤结束后,向用户显示“谢谢”页面
submitScreen()可以抛出ScreenValidationException—在本例中,使用
ScreenValidationException对象中存在的验证消息
所以,我的问题是在这个场景中如何使用JSF/Facelets来显示用户界面 我可以想象,我需要以下