You are on page 1of 3

fresher task jsp code exp

The code is a JSP page that includes several custom tags from different libraries.
Here's a line-by-line explanation of the code:

makefileCopy code
<js:container>

This is the start of a custom tag provided by the "jsf-comp" library.

bashCopy code
<form-ex:ajaxForm id="customerForm" widgetVar=""
modelAttribute="customer" action="${doCustomerURL}" commandName="customer">

This is another custom tag provided by the "spring-form" library. It creates a form
with an AJAX submit function. The form has an ID of "customerForm", a model
attribute of "customer", and an action that's determined by the "doCustomerURL"
variable. The command name is also "customer".

phpCopy code
<validate:errorSummary title="errorSummaryTitle" />

This is a custom tag provided by the "spring-form" library that displays a summary of
any errors that occur during form submission. The title of the summary is set to
"errorSummaryTitle".

luaCopy code
<form-ex:field path="customerId" cssClass="multi" required="true"
label="Customer ID">
<form:input path="${fieldPath}" name="customerid"
placeholder="Insert Customer ID" />
</form-ex:field>

This is another custom tag provided by the "spring-form" library that creates a field
for the "customerId" property of the "customer" model. The field has a CSS class of

fresher task jsp code exp 1


"multi", is required, and has a label of "Customer ID". The input field has a name of
"customerid" and a placeholder text of "Insert Customer ID".

luaCopy code
<form-ex:field path="customerName" cssClass="multi" required="true"
label="Customer Name">
<form:input path="${fieldPath}" name="customername"
placeholder="Insert Customer Name" />
</form-ex:field>

This is another custom tag that creates a field for the "customerName" property of
the "customer" model, with similar attributes as the previous field.

phpCopy code
<form-ex:field path="phoneNumber" cssClass="multi" required="true"
label="Phone Number">
<form:input path="${fieldPath}" placeholder="Insert Phone Number" />
<validate:custom name="checkPhone" path="phoneNumber"
message="formatoNumero" />
<validate:length minLength="6" maxLength="10" />
</form-ex:field>

This creates a field for the "phoneNumber" property of the "customer" model, with
similar attributes as the previous fields. It also includes two custom validation tags
that validate the phone number input. The "validate:custom" tag calls a custom
validator named "checkPhone" and sets an error message if the validation fails. The
"validate:length" tag sets a minimum and maximum length for the phone number.

phpCopy code
<form-ex:button-bar>
<form-ex:button-bar-section style="primary">
<button id="saveButton" class="btn btn-primary" type="submit">
Save<span><i class="icon-save im-normal"></i></span>
</button>
<a id="printList" href="${printCustomerURL}"
class="single vmid {media: {type:'pdf', height:'500'} } button-lik
e">
<span>
<spring:message code="Print" />
</span> <i class="icon-print im-normal"></i>
</a>
</form-ex:button-bar-section>
</form-ex:button-bar>

fresher task jsp code exp 2


This creates a button bar using custom tags provided by the "spring-form" library

The whole code:

js:container
<form-ex:ajaxForm id="customerForm" widgetVar=""
modelAttribute="customer" action="${doCustomerURL}" commandName="customer">

<validate:errorSummary title="errorSummaryTitle" />

<form-ex:field path="customerId" cssClass="multi" required="true"


label="Customer ID">
<form:input path="${fieldPath}" name="customerid"
placeholder="Insert Customer ID" />

</form-ex:field>

<form-ex:field path="customerName" cssClass="multi" required="true"


label="Customer Name">
<form:input path="${fieldPath}" name="customername"
placeholder="Insert Customer Name" />

<form-ex:field path="phoneNumber" cssClass="multi" required="true"


label="Phone Number">
<form:input path="${fieldPath}" placeholder="Insert Phone Number" />
<validate:custom name="checkPhone" path="phoneNumber"
message="formatoNumero" />
<validate:length minLength="6" maxLength="10" />

</form-ex:field>

<form-ex:button-bar>
<form-ex:button-bar-section style="primary">
<button id="saveButton" class="btn btn-primary" type="submit">
Save<span><i class="icon-save im-normal"></i></span>
</button>
<a id="printList" href="${printCustomerURL}"
class="single vmid {media: {type:'pdf', height:'500'} } button-like">
<span>
<spring:message code="Print" />
</span> <i class="icon-print im-normal"></i>
</a>
</form-ex:button-bar-section>
</form-ex:button-bar>

</form-ex:ajaxForm>

fresher task jsp code exp 3

You might also like