jsp error
sunkariramesh Mar 14, 2011 5:48 AMHi all,
I did validation for two fields from action class but those validations are coming in console.And my code is here.I am facing jsp problem.
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:s="http://jboss.com/products/seam/taglib"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:rich="http://richfaces.org/rich"
xmlns:a="http://richfaces.org/a4j"
template="../template.jsp">
<ui:define name="body">
<div class="page_title"><h:outputText value="Notifications" /></div>
<h:form id="ramesh">
<h:panelGroup id="generalAccountPanel">
<rich:tabPanel switchType="client">
<rich:tab value="general" name="general" label="#{messages['tab.generalInfo'] }">
<h:panelGroup>
<s:validateAll>
<table>
<tr>
<s:fragment rendered="#{adminNotificationAction.serviceAlerts.id == 0}">
<td class="form_req_labels" style="width: 78px;">
<h:outputText value="NotificationType" />
</td>
<td>
<s:decorate id="notificationTypeId">
<table cellspacing="0" cellpadding="0">
<h:selectOneMenu id="visitPurpose" label="VisitPurposeType" value="#{adminNotificationAction.serviceAlerts.notificationType}" style="width: 150px;" required="true">
<s:selectItems value="#{notificationType}" var="type" label="#{type.name}" />
<s:convertEnum />
<a:support event="onchange" reRender="panel1" ajaxSingle="true" />
</h:selectOneMenu>
</table>
</s:decorate>
</td>
</s:fragment>
<s:fragment rendered="#{adminNotificationAction.serviceAlerts.id gt 0}">
<td class="required-field" style="width: 79px;"><h:outputText value="NotificationType" /></td>
<td class="non-required-field"><h:outputText value="#{adminNotificationAction.serviceAlerts.notificationType.name}" style="width: 150px;" /></td>
</s:fragment>
</tr>
</table>
</s:validateAll>
</h:panelGroup>
<h:panelGroup id="panel1">
<s:validateAll>
<table>
<s:fragment rendered="#{adminNotificationAction.serviceAlerts.notificationType == 'Custom'}">
<tr>
<td width="78" class="required-field"><h:outputText value="CustomName" /></td>
<td>
<s:decorate id="CustomName">
<table cellspacing="0" cellpadding="0">
<tr><td><h:inputText label="CustomName" value="#{adminNotificationAction.serviceAlerts.customNotificationName}" style="width: 150px;" required="true" /></td></tr>
<tr><td><s:message errorClass="error" /></td></tr>
</table>
</s:decorate>
</td>
</tr>
</s:fragment>
</table>
</s:validateAll>
</h:panelGroup>
<h:panelGroup>
<s:validateAll>
<table>
<tr>
<s:fragment rendered="#{adminNotificationAction.serviceAlerts.id == 0}">
<td class="required-field" style="width: 79px;"><h:outputText value="MessageType" /></td>
<td>
<s:decorate id="messageTypeId">
<table cellspacing="0" cellpadding="0">
<h:selectOneMenu id="filterId" label="MessageType" value="#{adminNotificationAction.serviceAlerts.messageType}" style="width: 150px;" required="true">
<s:selectItems value="#{messageType}" var="type" label="#{type.name}" />
<s:convertEnum />
<a:support event="onchange" reRender="panel2" ajaxSingle="true" />
</h:selectOneMenu>
</table>
</s:decorate>
</td>
</s:fragment>
<s:fragment rendered="#{adminNotificationAction.serviceAlerts.id gt 0}">
<td class="required-field" style="width: 79px;"><h:outputText value="MessageType" /></td>
<td class="non-required-field"><h:outputText value="#{adminNotificationAction.serviceAlerts.messageType.name}" style="width: 150px;" /></td>
</s:fragment>
</tr>
</table>
</s:validateAll>
</h:panelGroup>
<h:panelGroup id="panel2">
<s:validateAll>
<table>
<s:fragment rendered="#{adminNotificationAction.serviceAlerts.messageType == 'Email' or adminNotificationAction.serviceAlerts.messageType == 'EmailAndSMS'}">
<tr> <td style="font-size: 12px; width: 89px;"><h:outputText value="Email Subject" /></td>
<td>
<s:decorate id="subjectId">
<table cellspacing="0" cellpadding="0">
<tr><td><h:inputText id="subject" value="#{adminNotificationAction.serviceAlerts.emailSubject}" /></td></tr>
</table>
</s:decorate>
</td>
</tr>
<tr>
<td style="font-size: 12px; width: 89px;"><h:outputText value="Email Content" /></td>
<td><table cellspacing="0" cellpadding="0" style="width: 450px;">
<tr><td>
<rich:editor value="#{adminNotificationAction.serviceAlerts.emailContent}" theme="advanced" style="width: 450px; height:200px;" >
<f:param name="theme_advanced_buttons1" value="bold,italic,underline, cut,copy,paste,pasteword"/>
<f:param name="theme_advanced_toolbar_location" value="top"/>
<f:param name="theme_advanced_toolbar_align" value="left"/>
</rich:editor>
</td></tr>
</table>
</td>
</tr>
<tr><td style="font-size: 12px; width: 89px;"><h:outputText value="Attachments" /></td>
<td>
<table cellspacing="0" cellpadding="0">
<tr><td><s:fileUpload id="uploadFile" fileName="#{adminNotificationDetails.name}" fileSize="#{adminNotificationDetails.contentLength}" /></td></tr>
</table>
</td>
</tr>
<tr>
<td style="font-size: 12px"><h:outputText value="Add emails" /></td>
<td>
<s:decorate id="inthenameofId">
<table cellspacing="0" cellpadding="0">
<tr>
<td><h:inputText id="innameof" value="#{adminNotificationDetails.addEmails}" style="width: 250px;" label="In the name of" /></td>
</tr>
<tr>
<td><s:message errorClass="error" /></td>
</tr>
</table>
</s:decorate>
</td>
</tr>
</s:fragment>
<s:fragment id="messageId1" rendered="#{adminNotificationAction.serviceAlerts.messageType == 'SMS' or adminNotificationAction.serviceAlerts.messageType == 'EmailAndSMS' }">
<tr><td style="font-size: 12px;; width: 88px;"><h:outputText value="SMS Content" /></td>
<td><s:decorate id="smsContent">
<table cellspacing="0" cellpadding="0">
<tr><td><h:inputTextarea id="content" value="#{adminNotificationAction.serviceAlerts.smsContent}" /></td></tr>
</table>
</s:decorate></td></tr>
<tr>
<td style="font-size: 12px; width: 88px;"><h:outputText value="Add Mobile No" /></td>
<td>
<s:decorate id="intheemailofId">
<table cellspacing="0" cellpadding="0">
<tr>
<td><h:inputText id="inemailof" value="#{adminNotificationDetails.addSmss}" style="width: 250px;" label="In the name of" /></td>
</tr>
<tr>
<td><s:message errorClass="error" /></td>
</tr>
</table>
</s:decorate>
</td>
</tr>
</s:fragment>
</table>
</s:validateAll>
</h:panelGroup>
<h:panelGroup>
<s:validateAll>
<table>
<tr>
<td class="form_req_labels"><h:outputText value="Start Date" /></td>
<td>
<s:decorate id="createdDateId">
<table cellspacing="0" cellpadding="0">
<tr>
<td><rich:calendar id="createdDate" value="#{adminNotificationAction.serviceAlerts.startDate}" required="true" label="Date from" inputStyle="width: 80px;" datePattern="#{systemUtils.getSystemParamValue('DATE_FORMAT')}" /></td>
</tr>
<tr><td><s:message errorClass="error" /></td></tr>
</table>
</s:decorate></td>
</tr>
<tr><td style="font-size: 12px"><h:outputText value="Send Frequency" /></td>
<td>
<s:decorate id="sendFrequencyId">
<table cellspacing="0" cellpadding="0">
<tr><td><h:inputText id="sendFrequency" value="#{adminNotificationAction.serviceAlerts.sendFrequency}" style="width: 80px;" /></td></tr>
</table>
</s:decorate></td>
</tr>
</table>
</s:validateAll>
</h:panelGroup>
<br />
<h:commandButton action="#{adminNotificationAction.confirmNotification()}" value="#{messages['button.confirm'] }" reRender="ramesh,generalAccountPanel" styleClass="submit_btn" title="#{messages['button.confirm'] }" />
<h:commandButton value="#{messages['button.cancel'] }" action="#{adminNotificationAction.cancel()}" styleClass="submit_btn" title="#{messages['button.cancel'] }" immediate="true" />
</rich:tab>
<rich:tab value="selectHotel" name="selectHotel" label="#{messages['tab.selectHotels'] }">
<table width="100%">
<tr>
<td valign="top">
<table>
<h:panelGroup layout="block" style="margin-top: 2px;">
<a href="#" onClick="selectDeselectAll(true); return false;" class="selectUnselect">Select All</a>
<h:outputText value=" | " />
<a href="#" onClick="selectDeselectAll(false); return false;" class="selectUnselect">Unselect All</a>
</h:panelGroup>
<br />
<rich:dataTable id="dayslist" var="hotelName" value="#{adminNotificationAction.getHotelsList()}" width="200">
<rich:column width="30">
<h:selectBooleanCheckbox id="selectBox" value="#{adminNotificationAction.hotelForSelect[hotelName]}" />
</rich:column>
<h:column><h:outputText value="#{hotelName.name}" /></h:column>
</rich:dataTable>
</table>
</td>
</tr>
</table>
<h:panelGroup>
<h:commandButton action="#{adminNotificationAction.confirmNotification()}" value="#{messages['button.confirm'] }" reRender="generalAccountPanel,ramesh" styleClass="submit_btn" title="#{messages['button.confirm'] }" />
<h:commandButton value="#{messages['button.cancel'] }" action="#{adminNotificationAction.cancel()}" styleClass="submit_btn" title="#{messages['button.cancel'] }" immediate="true" />
</h:panelGroup>
<script>
function selectDeselectAll(isSelection) {
for(i = 0; i < #{adminNotificationAction.getHotelsList().size()}; i++) {
document.getElementById('ramesh:dayslist:' + i + ':selectBox').checked = isSelection;
}
}
</script>
</rich:tab>
</rich:tabPanel>
</h:panelGroup>
</h:form>
</ui:define>
<ui:define name="verticalMenu">
<ui:include src="../menus/operationsmenu.jsp" />
</ui:define>
</ui:composition>
I did validation for two fields from action class but those validations are coming in console.And my code is here.I am facing jsp problem.
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:s="http://jboss.com/products/seam/taglib"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:rich="http://richfaces.org/rich"
xmlns:a="http://richfaces.org/a4j"
template="../template.jsp">
<ui:define name="body">
<div class="page_title"><h:outputText value="Notifications" /></div>
<h:form id="ramesh">
<h:panelGroup id="generalAccountPanel">
<rich:tabPanel switchType="client">
<rich:tab value="general" name="general" label="#{messages['tab.generalInfo'] }">
<h:panelGroup>
<s:validateAll>
<table>
<tr>
<s:fragment rendered="#{adminNotificationAction.serviceAlerts.id == 0}">
<td class="form_req_labels" style="width: 78px;">
<h:outputText value="NotificationType" />
</td>
<td>
<s:decorate id="notificationTypeId">
<table cellspacing="0" cellpadding="0">
<h:selectOneMenu id="visitPurpose" label="VisitPurposeType" value="#{adminNotificationAction.serviceAlerts.notificationType}" style="width: 150px;" required="true">
<s:selectItems value="#{notificationType}" var="type" label="#{type.name}" />
<s:convertEnum />
<a:support event="onchange" reRender="panel1" ajaxSingle="true" />
</h:selectOneMenu>
</table>
</s:decorate>
</td>
</s:fragment>
<s:fragment rendered="#{adminNotificationAction.serviceAlerts.id gt 0}">
<td class="required-field" style="width: 79px;"><h:outputText value="NotificationType" /></td>
<td class="non-required-field"><h:outputText value="#{adminNotificationAction.serviceAlerts.notificationType.name}" style="width: 150px;" /></td>
</s:fragment>
</tr>
</table>
</s:validateAll>
</h:panelGroup>
<h:panelGroup id="panel1">
<s:validateAll>
<table>
<s:fragment rendered="#{adminNotificationAction.serviceAlerts.notificationType == 'Custom'}">
<tr>
<td width="78" class="required-field"><h:outputText value="CustomName" /></td>
<td>
<s:decorate id="CustomName">
<table cellspacing="0" cellpadding="0">
<tr><td><h:inputText label="CustomName" value="#{adminNotificationAction.serviceAlerts.customNotificationName}" style="width: 150px;" required="true" /></td></tr>
<tr><td><s:message errorClass="error" /></td></tr>
</table>
</s:decorate>
</td>
</tr>
</s:fragment>
</table>
</s:validateAll>
</h:panelGroup>
<h:panelGroup>
<s:validateAll>
<table>
<tr>
<s:fragment rendered="#{adminNotificationAction.serviceAlerts.id == 0}">
<td class="required-field" style="width: 79px;"><h:outputText value="MessageType" /></td>
<td>
<s:decorate id="messageTypeId">
<table cellspacing="0" cellpadding="0">
<h:selectOneMenu id="filterId" label="MessageType" value="#{adminNotificationAction.serviceAlerts.messageType}" style="width: 150px;" required="true">
<s:selectItems value="#{messageType}" var="type" label="#{type.name}" />
<s:convertEnum />
<a:support event="onchange" reRender="panel2" ajaxSingle="true" />
</h:selectOneMenu>
</table>
</s:decorate>
</td>
</s:fragment>
<s:fragment rendered="#{adminNotificationAction.serviceAlerts.id gt 0}">
<td class="required-field" style="width: 79px;"><h:outputText value="MessageType" /></td>
<td class="non-required-field"><h:outputText value="#{adminNotificationAction.serviceAlerts.messageType.name}" style="width: 150px;" /></td>
</s:fragment>
</tr>
</table>
</s:validateAll>
</h:panelGroup>
<h:panelGroup id="panel2">
<s:validateAll>
<table>
<s:fragment rendered="#{adminNotificationAction.serviceAlerts.messageType == 'Email' or adminNotificationAction.serviceAlerts.messageType == 'EmailAndSMS'}">
<tr> <td style="font-size: 12px; width: 89px;"><h:outputText value="Email Subject" /></td>
<td>
<s:decorate id="subjectId">
<table cellspacing="0" cellpadding="0">
<tr><td><h:inputText id="subject" value="#{adminNotificationAction.serviceAlerts.emailSubject}" /></td></tr>
</table>
</s:decorate>
</td>
</tr>
<tr>
<td style="font-size: 12px; width: 89px;"><h:outputText value="Email Content" /></td>
<td><table cellspacing="0" cellpadding="0" style="width: 450px;">
<tr><td>
<rich:editor value="#{adminNotificationAction.serviceAlerts.emailContent}" theme="advanced" style="width: 450px; height:200px;" >
<f:param name="theme_advanced_buttons1" value="bold,italic,underline, cut,copy,paste,pasteword"/>
<f:param name="theme_advanced_toolbar_location" value="top"/>
<f:param name="theme_advanced_toolbar_align" value="left"/>
</rich:editor>
</td></tr>
</table>
</td>
</tr>
<tr><td style="font-size: 12px; width: 89px;"><h:outputText value="Attachments" /></td>
<td>
<table cellspacing="0" cellpadding="0">
<tr><td><s:fileUpload id="uploadFile" fileName="#{adminNotificationDetails.name}" fileSize="#{adminNotificationDetails.contentLength}" /></td></tr>
</table>
</td>
</tr>
<tr>
<td style="font-size: 12px"><h:outputText value="Add emails" /></td>
<td>
<s:decorate id="inthenameofId">
<table cellspacing="0" cellpadding="0">
<tr>
<td><h:inputText id="innameof" value="#{adminNotificationDetails.addEmails}" style="width: 250px;" label="In the name of" /></td>
</tr>
<tr>
<td><s:message errorClass="error" /></td>
</tr>
</table>
</s:decorate>
</td>
</tr>
</s:fragment>
<s:fragment id="messageId1" rendered="#{adminNotificationAction.serviceAlerts.messageType == 'SMS' or adminNotificationAction.serviceAlerts.messageType == 'EmailAndSMS' }">
<tr><td style="font-size: 12px;; width: 88px;"><h:outputText value="SMS Content" /></td>
<td><s:decorate id="smsContent">
<table cellspacing="0" cellpadding="0">
<tr><td><h:inputTextarea id="content" value="#{adminNotificationAction.serviceAlerts.smsContent}" /></td></tr>
</table>
</s:decorate></td></tr>
<tr>
<td style="font-size: 12px; width: 88px;"><h:outputText value="Add Mobile No" /></td>
<td>
<s:decorate id="intheemailofId">
<table cellspacing="0" cellpadding="0">
<tr>
<td><h:inputText id="inemailof" value="#{adminNotificationDetails.addSmss}" style="width: 250px;" label="In the name of" /></td>
</tr>
<tr>
<td><s:message errorClass="error" /></td>
</tr>
</table>
</s:decorate>
</td>
</tr>
</s:fragment>
</table>
</s:validateAll>
</h:panelGroup>
<h:panelGroup>
<s:validateAll>
<table>
<tr>
<td class="form_req_labels"><h:outputText value="Start Date" /></td>
<td>
<s:decorate id="createdDateId">
<table cellspacing="0" cellpadding="0">
<tr>
<td><rich:calendar id="createdDate" value="#{adminNotificationAction.serviceAlerts.startDate}" required="true" label="Date from" inputStyle="width: 80px;" datePattern="#{systemUtils.getSystemParamValue('DATE_FORMAT')}" /></td>
</tr>
<tr><td><s:message errorClass="error" /></td></tr>
</table>
</s:decorate></td>
</tr>
<tr><td style="font-size: 12px"><h:outputText value="Send Frequency" /></td>
<td>
<s:decorate id="sendFrequencyId">
<table cellspacing="0" cellpadding="0">
<tr><td><h:inputText id="sendFrequency" value="#{adminNotificationAction.serviceAlerts.sendFrequency}" style="width: 80px;" /></td></tr>
</table>
</s:decorate></td>
</tr>
</table>
</s:validateAll>
</h:panelGroup>
<br />
<h:commandButton action="#{adminNotificationAction.confirmNotification()}" value="#{messages['button.confirm'] }" reRender="ramesh,generalAccountPanel" styleClass="submit_btn" title="#{messages['button.confirm'] }" />
<h:commandButton value="#{messages['button.cancel'] }" action="#{adminNotificationAction.cancel()}" styleClass="submit_btn" title="#{messages['button.cancel'] }" immediate="true" />
</rich:tab>
<rich:tab value="selectHotel" name="selectHotel" label="#{messages['tab.selectHotels'] }">
<table width="100%">
<tr>
<td valign="top">
<table>
<h:panelGroup layout="block" style="margin-top: 2px;">
<a href="#" onClick="selectDeselectAll(true); return false;" class="selectUnselect">Select All</a>
<h:outputText value=" | " />
<a href="#" onClick="selectDeselectAll(false); return false;" class="selectUnselect">Unselect All</a>
</h:panelGroup>
<br />
<rich:dataTable id="dayslist" var="hotelName" value="#{adminNotificationAction.getHotelsList()}" width="200">
<rich:column width="30">
<h:selectBooleanCheckbox id="selectBox" value="#{adminNotificationAction.hotelForSelect[hotelName]}" />
</rich:column>
<h:column><h:outputText value="#{hotelName.name}" /></h:column>
</rich:dataTable>
</table>
</td>
</tr>
</table>
<h:panelGroup>
<h:commandButton action="#{adminNotificationAction.confirmNotification()}" value="#{messages['button.confirm'] }" reRender="generalAccountPanel,ramesh" styleClass="submit_btn" title="#{messages['button.confirm'] }" />
<h:commandButton value="#{messages['button.cancel'] }" action="#{adminNotificationAction.cancel()}" styleClass="submit_btn" title="#{messages['button.cancel'] }" immediate="true" />
</h:panelGroup>
<script>
function selectDeselectAll(isSelection) {
for(i = 0; i < #{adminNotificationAction.getHotelsList().size()}; i++) {
document.getElementById('ramesh:dayslist:' + i + ':selectBox').checked = isSelection;
}
}
</script>
</rich:tab>
</rich:tabPanel>
</h:panelGroup>
</h:form>
</ui:define>
<ui:define name="verticalMenu">
<ui:include src="../menus/operationsmenu.jsp" />
</ui:define>
</ui:composition>