I read several tutorial about RESTful Web Services and I understood main target of it. But I don't understand how combine REST and xhtml pages.
Usually, I have pages like this
<h:form>
<p:tabView orientation="left" id="mainTabId">
<p:tab title="User information">
<h:panelGrid columns="2" columnClasses="column" cellpadding="5"
styleClass="dataTableStyle" border="2" cellspacing="5">
<h:outputLabel value="First name:" />
<p:inputText id="firstName" value="#{user.firstName}"
validatorMessage="Length should be 3 or more" required="true"
requiredMessage="This field can not be empty">
<p:ajax event="mouseout" update="firstNameMsg"></p:ajax>
<f:validateLength minimum="3"></f:validateLength>
</p:inputText>
<p:message id="firstNameMsg" for="firstName" />
<f:facet name="footer">
<p:commandButton id="brnId" value="Save changes"
icon="ui-icon-document" action="saveFuckingData"
onstart="statusDialog.show()" onsuccess="statusDialog.hide()" />
</f:facet>
</h:panelGrid>
</p:tab>
</p:tabView>
</h:form>
In this case, I have static page that I dynamically fill.
How can I get similar page via REST Api? Should I return whole web page in Java method?
I mean, I know how get JSON/XML via request. But then my web page will look like:
<SubjectsList>
<subject>
<coef>4</coef>
<name>Some data</name>
<score>71</score>
</subject>
</SubjectsList>
But I need page that contains many buttons, tables, text fields and other elements, not only JSON/XML text presentation.
I hope you understand what I want)