本文整理汇总了Java中org.apache.struts.util.MessageResources.getMessageResources方法的典型用法代码示例。如果您正苦于以下问题:Java MessageResources.getMessageResources方法的具体用法?Java MessageResources.getMessageResources怎么用?Java MessageResources.getMessageResources使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.struts.util.MessageResources
的用法示例。
在下文中一共展示了MessageResources.getMessageResources方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: validate
import org.apache.struts.util.MessageResources; //导入方法依赖的package包/类
@Override
public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) {
ActionErrors errors = new ActionErrors();
MessageResources resources = MessageResources.getMessageResources(Constants.APP_RESOURCES);
if (StringUtils.isBlank(this.serverURL)) {
errors.add(ActionMessages.GLOBAL_MESSAGE,
new ActionMessage("error.mandatoryField", resources.getMessage("config.serverURL")));
}
if (StringUtils.isBlank(this.securitySalt)) {
errors.add(ActionMessages.GLOBAL_MESSAGE,
new ActionMessage("error.mandatoryField", resources.getMessage("config.securitySalt")));
}
return errors;
}
示例2: initInternal
import org.apache.struts.util.MessageResources; //导入方法依赖的package包/类
/**
* <p>Initialize our internal MessageResources bundle.</p>
*
* @exception ServletException if we cannot initialize these resources
*/
protected void initInternal() throws ServletException {
// :FIXME: Document UnavailableException
try {
internal = MessageResources.getMessageResources(internalName);
} catch (MissingResourceException e) {
log.error("Cannot load internal resources from '" + internalName + "'",
e);
throw new UnavailableException
("Cannot load internal resources from '" + internalName + "'");
}
}
示例3: execute
import org.apache.struts.util.MessageResources; //导入方法依赖的package包/类
public void execute(ComponentContext tileContext,
HttpServletRequest request, HttpServletResponse response,
ServletContext servletContext) throws Exception {
InstanciaDelegate delegate = RegistroManager.recuperarInstancia(request);
boolean telematic = (delegate instanceof InstanciaTelematicaDelegate);
// Fijar el titulo.
MessageResources messages;
if (telematic) {
messages = MessageResources.getMessageResources("form-front-messages-caib");
} else {
messages = MessageResources.getMessageResources("form-front-messages");
}
tileContext.putAttribute("title", messages.getMessage(getLocale(request),"resultados.title"));
// Fijar formulario
Formulario formulario = delegate.obtenerFormulario();
request.setAttribute("formulario", formulario);
Result[] resultados = RegistroManager.recuperarResultados(request);
request.setAttribute("resultados", resultados);
// Path Icongrafia
request.setAttribute("pathIconografia", delegate.obtenerPathIconografia());
// Botones.
request.setAttribute("saveButton", Boolean.FALSE);
request.setAttribute("discardButton", Boolean.FALSE);
request.setAttribute("backButton", Boolean.FALSE);
request.setAttribute("nextButton", Boolean.TRUE);
request.setAttribute("endButton", Boolean.FALSE);
}
示例4: initInternal
import org.apache.struts.util.MessageResources; //导入方法依赖的package包/类
/**
* <p>Initialize our internal MessageResources bundle.</p>
*
* @throws ServletException if we cannot initialize these resources
* @throws UnavailableException if we cannot load resources
*/
protected void initInternal()
throws ServletException {
try {
internal = MessageResources.getMessageResources(internalName);
} catch (MissingResourceException e) {
log.error("Cannot load internal resources from '" + internalName
+ "'", e);
throw new UnavailableException(
"Cannot load internal resources from '" + internalName + "'");
}
}
示例5: openPreviewMeeting
import org.apache.struts.util.MessageResources; //导入方法依赖的package包/类
public ActionForward openPreviewMeeting(ActionMapping mapping, ActionForm form, HttpServletRequest request,
HttpServletResponse response) throws Exception {
// get user uid parameter
Long uid = WebUtil.readLongParam(request, Constants.PARAM_USER_UID);
BbbUser user = bbbService.getUserByUID(uid);
BbbSession session = user.getBbbSession();
// Get LAMS userDTO
org.lamsfoundation.lams.usermanagement.dto.UserDTO lamsUserDTO = (org.lamsfoundation.lams.usermanagement.dto.UserDTO) SessionManager
.getSession().getAttribute(AttributeNames.USER);
// create random strings for attendee and moderator passwords
String attendeePassword = RandomPasswordGenerator.nextPassword(20);
String moderatorPassword = RandomPasswordGenerator.nextPassword(20);
MessageResources resources = MessageResources.getMessageResources(Constants.APP_RESOURCES);
String meetingKey = BbbUtil.getMeetingKey(session.getSessionId(), attendeePassword);
// Get default localized welcome message
String welcomeMessage = resources.getMessage("activity.welcome.message");
logger.debug("Creating new room with meetingKey =" + meetingKey);
String meetingStartResponse = bbbService.startConference(meetingKey, attendeePassword, moderatorPassword,
BbbUtil.getReturnURL(request), welcomeMessage);
if (meetingStartResponse == Constants.RESPONSE_SUCCESS) {
session.setMeetingCreated(true);
session.setAttendeePassword(attendeePassword);
session.setModeratorPassword(moderatorPassword);
String redirectUrl = bbbService.getJoinMeetingURL(lamsUserDTO, meetingKey, moderatorPassword);
// redirect to meeting
response.sendRedirect(redirectUrl);
} else {
logger.error("startAction did not return a url to start the meeting");
throw new BbbException("Unable to start meeting");
}
return null;
}
示例6: execute
import org.apache.struts.util.MessageResources; //导入方法依赖的package包/类
public void execute(ComponentContext tileContext,
HttpServletRequest request, HttpServletResponse response,
ServletContext servletContext) throws Exception {
InstanciaDelegate delegate = RegistroManager.recuperarInstancia(request);
boolean telematic = (delegate instanceof InstanciaTelematicaDelegate);
// Fijar el titulo.
MessageResources messages;
if (telematic) {
messages = MessageResources.getMessageResources("form-front-messages-caib");
} else {
messages = MessageResources.getMessageResources("form-front-messages");
}
tileContext.putAttribute("title", messages.getMessage(getLocale(request),"penultima.title"));
/*tileContext.putAttribute("title",
getResources(request).getMessage(getLocale(request), "penultima.title"));*/
// Fijar formulario
Formulario formulario = delegate.obtenerFormulario();
request.setAttribute("formulario", formulario);
// -- INDRA: ESTABLECEMOS VERSION DE FUNCIONAMIENTO
String sufijo = StringUtils.defaultString(formulario.getModoFuncionamiento().getSufijo());
request.setAttribute("sufijoModoFuncionamiento", sufijo );
// -- INDRA: FIN MODIFICACION
List pantallasProcesadas = delegate.obtenerPantallasProcesadas();
request.setAttribute("pantallasProcesadas", pantallasProcesadas);
// Path Icongrafia
request.setAttribute("pathIconografia", delegate.obtenerPathIconografia());
// Propiedades del formulario en el caso de que sea telem�tico
Map propiedadesForm = null;
if (telematic) {
InstanciaTelematicaDelegate itd = (InstanciaTelematicaDelegate) delegate;
propiedadesForm = itd.obtenerPropiedadesFormulario();
request.setAttribute("propiedadesForm", propiedadesForm);
}
// Tiene boton de back?
request.setAttribute("saveButton", Boolean.valueOf(!telematic));
request.setAttribute("discardButton", Boolean.TRUE);
request.setAttribute("backButton", Boolean.TRUE);
request.setAttribute("nextButton", Boolean.FALSE);
// Bot�n para crear documento o volver al sistema de tramitacion?
request.setAttribute("endButton", Boolean.TRUE);
// Url de finalizaci�n
if (telematic) {
// Consultamos configuraci�n para la �ltima pantalla:
// - pantallaFin.mostrar: true/false
// - pantallaFin.titulo
// - pantallaFin.texto
String pantallaFinTitulo =(String)propiedadesForm.get("pantallaFin.titulo");
String pantallaFinTexto =(String)propiedadesForm.get("pantallaFin.texto");
if (pantallaFinTitulo!=null) tileContext.putAttribute("title", pantallaFinTitulo);
if (pantallaFinTexto!=null) request.setAttribute("pantallaFinTexto", pantallaFinTexto);
request.setAttribute("actionPath", "/finalitzarTelematic");
} else {
request.setAttribute("actionPath", "/calcularResultados");
}
}
示例7: addDrugReason
import org.apache.struts.util.MessageResources; //导入方法依赖的package包/类
private void addDrugReason(String codingSystem,
String primaryReasonFlagStr, String comments,
String code, String drugIdStr, String demographicNo,
String providerNo, HttpServletRequest request ) {
MessageResources mResources = MessageResources.getMessageResources( "oscarResources" );
DrugReasonDao drugReasonDao = (DrugReasonDao) SpringUtils.getBean("drugReasonDao");
Integer drugId = Integer.parseInt(drugIdStr);
// should this be instantiated with the Spring Utilities?
CodingSystemManager codingSystemManager = new CodingSystemManager();
if ( ! codingSystemManager.isCodeAvailable(codingSystem, code) ){
request.setAttribute("message", mResources.getMessage("SelectReason.error.codeValid"));
return;
}
if(drugReasonDao.hasReason(drugId, codingSystem, code, true)){
request.setAttribute("message", mResources.getMessage("SelectReason.error.duplicateCode"));
return;
}
MiscUtils.getLogger().debug("addDrugReasonCalled codingSystem "+codingSystem+ " code "+code+ " drugIdStr "+drugId);
boolean primaryReasonFlag = true;
if(!"true".equals(primaryReasonFlagStr)){
primaryReasonFlag = false;
}
DrugReason dr = new DrugReason();
dr.setDrugId(drugId);
dr.setProviderNo(providerNo);
dr.setDemographicNo(Integer.parseInt(demographicNo));
dr.setCodingSystem(codingSystem);
dr.setCode(code);
dr.setComments(comments);
dr.setPrimaryReasonFlag(primaryReasonFlag);
dr.setArchivedFlag(false);
dr.setDateCoded(new Date());
drugReasonDao.addNewDrugReason(dr);
String ip = request.getRemoteAddr();
LogAction.addLog((String) request.getSession().getAttribute("user"), LogConst.ADD, LogConst.CON_DRUGREASON, ""+dr.getId() , ip,demographicNo,dr.getAuditString());
}
示例8: addDrugReason
import org.apache.struts.util.MessageResources; //导入方法依赖的package包/类
public ActionForward addDrugReason(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) {
if (!securityInfoManager.hasPrivilege(LoggedInInfo.getLoggedInInfoFromSession(request), "_rx", "r", null)) {
throw new RuntimeException("missing required security object (_rx)");
}
MessageResources mResources = MessageResources.getMessageResources( "oscarResources" );
DrugReasonDao drugReasonDao = (DrugReasonDao) SpringUtils.getBean("drugReasonDao");
Icd9Dao icd9Dao = (Icd9Dao) SpringUtils.getBean("Icd9DAO");
String codingSystem = request.getParameter("codingSystem");
String primaryReasonFlagStr = request.getParameter("primaryReasonFlag");
String comments = request.getParameter("comments");
String code = request.getParameter("code");
String drugIdStr = request.getParameter("drugId");
String demographicNo = request.getParameter("demographicNo");
String providerNo = (String) request.getSession().getAttribute("user");
request.setAttribute("drugId",Integer.parseInt(drugIdStr));
request.setAttribute("demoNo",Integer.parseInt(demographicNo));
if(code != null && code.trim().equals("")){
request.setAttribute("message", mResources.getMessage("SelectReason.error.codeEmpty"));
return (mapping.findForward("success"));
}
List<Icd9> list = icd9Dao.getIcd9Code(code);
if (list.size() == 0){
request.setAttribute("message", mResources.getMessage("SelectReason.error.codeValid"));
return (mapping.findForward("success"));
}
if(drugReasonDao.hasReason(Integer.parseInt(drugIdStr),codingSystem, code, true)){
request.setAttribute("message", mResources.getMessage("SelectReason.error.duplicateCode"));
return (mapping.findForward("success"));
}
MiscUtils.getLogger().debug("addDrugReasonCalled codingSystem "+codingSystem+ " code "+code+ " drugIdStr "+drugIdStr);
boolean primaryReasonFlag = true;
if(!"true".equals(primaryReasonFlagStr)){
primaryReasonFlag = false;
}
DrugReason dr = new DrugReason();
dr.setDrugId(Integer.parseInt(drugIdStr));
dr.setProviderNo(providerNo);
dr.setDemographicNo(Integer.parseInt(demographicNo));
dr.setCodingSystem(codingSystem);
dr.setCode(code);
dr.setComments(comments);
dr.setPrimaryReasonFlag(primaryReasonFlag);
dr.setArchivedFlag(false);
dr.setDateCoded(new Date());
drugReasonDao.addNewDrugReason(dr);
String ip = request.getRemoteAddr();
LogAction.addLog((String) request.getSession().getAttribute("user"), LogConst.ADD, LogConst.CON_DRUGREASON, ""+dr.getId() , ip,demographicNo,dr.getAuditString());
return (mapping.findForward("close"));
}