您可以像这样指定代码:
<aui:input model="<%= User.class %>"
name="firstName"
showRequiredLabel=""
label="First Name <span style='color: red;'>*</span>"
value="<%=user.getFirstName() %>">
</aui:input>
<!--
or else you can also include a CSS Class as <span class="required">*</span>
then you would need to add a style as:
-->
<style>
.required {
color: red;
}
</style>
或者,您可以改为:
<label class="aui-field-label" for="<portlet:namespace />firstName">
First Name
<span style="color: red;">*</span>
</label>
<aui:input model="<%= User.class %>"
name="firstName"
showRequiredLabel=""
label=""
value="<%=user.getFirstName() %>">
</aui:input>
哪个是你喜欢的。