我有一个使用jsf2的应用程序JEE,并且我的应用程序模型带有消息的操作结果。
带有我的模型类代码的示例
/*
* This code is under license Creative Commons Attribution-ShareAlike 1.0
* <a href="https://creativecommons.org/licenses/by-sa/1.0/legalcode"></a>
*/
package it.unibas.printspooler.modello.logic.state;
import it.unibas.printspooler.Costanti;
import it.unibas.printspooler.modello.operations.Operation;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
/**
*
* @author https://github.com/vincenzopalazzo
*/
public class FreeState extends AbstractSpoolerState {
private final Log LOGGER = LogFactory.getLog(FreeState.class);
public FreeState() {
super(Costanti.State.STATE_FREE);
}
@Override
public boolean isBusy() {
return false;
}
@Override
public boolean isError() {
return false;
}
@Override
public boolean isFree() {
return true;
}
@Override
public String getDescriptionState() {
return super.getState();
}
@Override
public String hasPrintable(PrintSpoiler spoller, Operation newOperation, Operation lastOperation) {
super.hasPrintable(spoller, newOperation, lastOperation);
if(spoller.getWaitOperation().isEmpty()){
LOGGER.debug("The wait queue operation is empty");
spoller.getSuccessulfuOperation().add(newOperation);
return "The wait queue operation is empty";
}
return "The wait queue operation isn't empty, the spooler state is busy";
}
}
将消息返回到screen.jsf的方法是
@Override
public String hasPrintable(PrintSpoiler spoller, Operation newOperation, Operation lastOperation) {
super.hasPrintable(spoller, newOperation, lastOperation);
if(spoller.getWaitOperation().isEmpty()){
LOGGER.debug("The wait queue operation is empty");
spoller.getSuccessulfuOperation().add(newOperation);
return "The wait queue operation is empty";
}
return "The wait queue operation isn't empty, the spooler state is busy";
}
我应该使用jsf2框架将此消息国际化
对不起,我的英语不好,但是我正在学习
答案 0 :(得分:0)
您可以使用资源包来标记您的标签。可以直接从xhtml页面和/或Java Bean中使用捆绑软件。
很多网站都以很多细节介绍了这种技术,我个人将从这两个开始: