JSP

Append leading zeros in jstl tag when the value is less than 10

I have a select element in my jsp view. I want that when the value is less than 10, it appends 0 before the number so 1 will be 01. So far this is my code: <select id=”sample” name=”sample”> <c:forEach var=”i” begin=”1″ end=”10″> <option value=${i}>${ i<12 ? “0”+i : i} hour</option> </c:forEach> </select> When I run my code I get…
Read more

hybris – Adding a new page – Unable to refer to tag

I am trying to add a new page and I did so using the impex. I used the following impex: INSERT_UPDATE ContentPage;$contentCV[unique=true];uid[unique=true];name;masterTemplate(uid,$contentCV);label;defaultPage[default=’true’];approvalStatus(code)[default=’approved’];homepage[default=’false’] ;;homeleads;HomePageLeadsOverview;ContentPage1Template;/homeleads I have also done the controller changes to ensure the jsp is getting called and the jsp is also called. In the jsp file, I have the following lines of code: <%@ taglib prefix=”c” uri=”http://java.sun.com/jsp/jstl/core”%> <%@ taglib…
Read more

Retrieve multiple checkbox values from jsp in the spring controller class

In my table, I’ve a row with checkbox which tells the controller whether that particular row of the table has to be included or no. The check box does not have relation with other rows. I tried adding it in the following way : <form:checkbox class=”editable${ifeeCount}” disabled=”true” path=”includeFeeValue” value=”false”/> And in my form, I’ve a list “private ArrayList includeFeeValue;” And…
Read more

NotReadablePropertyException using c:foreach "items" variable in path attribute of Spring form:checkbox

Background – A data grid (list of ServiceOfferedForm) populated based on given filter criteria (SearchCriteriaForm). Also, each data row has a radiobutton bound to ID field of ServiceOfferedForm, which will be populated in serviceCode field of “selectedService”, to be used for Edit action. I have a Model as below, with getters & setters (not shown here) – public class ServiceOfferedForm…
Read more

Binding dropdown list using ajax and jQuery

I would like to bind the data from splunk to a dropdown list. The servlet return a JsonString by gson Gson gson = new Gson(); String jsonString = gson.toJson(arrays); resp.getWriter().write(jsonString); In the jsp, ajax was used to get back the jsonString and blind in drop down list. $(document).ready(function() { $.ajax({ type: “POST”, dataType : “json”, url : “../getName”, success :…
Read more

How can I show a new <form:select> which values depends on the choice made in a first <form:select> using Spring MVC?

I am pretty new in Spring MVC and I have the following problem. I know that in a JSP page I can use the Spring tag library to create a select input field that is automatically binded by a field of a specific bean by Spring framework, something like this: <label>Regioni:</label> <form:select path=”regioneSelezionata”> <form:options items=”${listaRegioni}” itemLabel=”desReg” itemValue=”codReg” /> </form:select> So…
Read more

Posting and fetching url parameters inside a jsp in struts

I am trying to get the parameters of an url in a .jsp using struts lib and create a custom url for the action attribute of a form inside the jsp page using that parameter. JavaScript where parameter is populated: function openNewWindow(qtype) { var x = screen.width / 3; var y = screen.height / 3; window.open(‘FileUpload.jsp?q=’ + qtype, ‘UploadExelSheet’, ‘height=250,width=400’);…
Read more