For a project I am working on, I need to implement a feature where users can view and edit their personal details on a JSP page. If a user is logged in, their information should be fetched from the session and displayed automatically. However, even if they are not logged in, users should still be able to enter their details into blank fields. The twist is that if a user is logged in, they should not be allowed to update or modify their details. Below is a snippet of my JSP code:
<form:form commandName="Chat" id="Chat" data-widget="form" onsubmit="return false">
<table>
<tr>
<td><label><spring:message code="label.chat.name" /></label></td><td><form:input data-validation="[required allowspecialchr]" data-validation-tip="true" maxlength="40" path="name" id="name" placeholder=""/></td>
</tr>
<tr>
<td><label><spring:message code="label.chat.email" /></label></td><td><form:input data-validation="[required email]" data-validation-tip="true" path="email" id="email" placeholder=""/></td>
</tr>
<tr>
<td><label><spring:message code="label.chat.mobileNo" /></label></td><td><form:input data-validation="[required number]" data-validation-tip="true" path="mobileNo" id="mobileNo" placeholder=""/></td>
</tr>
</form>
If anyone has any suggestions or guidance on how to achieve this, please let me know.