We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hello, I followed the example in your getting started section to create my own form. I made an event class with the following fields:
package com.wseemann.fisticuffs.models; public class Event { private Integer id; private String eventName; private Integer eventLength; //....
I then created Event.properties:
Event.properties
event-id=Event ID event-eventName=Event Name event-eventLength=Event Length (in days)
However when I load my page the form labels are all shown as "??????". Any ideas what I'm doing wrong?
Finally, my JSP page:
<%@page contentType="text/html; charset=UTF-8" %> <%@page pageEncoding="UTF-8" %> <%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> <%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %> <fmt:bundle basename="com.wseemann.fisticuffs.models.Event"> <html> <body> <h1>Formio Getting Started</h1> <c:set var="fields" value="${eventForm.fields}"/> <form action="<c:url value="/"/>" method="post"> <div> <label><fmt:message key="${fields.eventName.labelKey}"/> <input type="text" name="${fields.eventName.name}" value="${fields.eventName.value}"/> </label> </div> <div> <label><fmt:message key="${fields.eventLength.labelKey}"/> <input type="text" name="${fields.eventLength.name}" value="${fields.eventLength.value}"/> </label> </div> <button name="submit" type="submit">Submit</button> </form> </body> </html> </fmt:bundle>
And controller:
@WebServlet("/") public class PersonController extends HttpServlet { private static final long serialVersionUID = 1L; private static final FormMapping<Event> eventForm = Forms.automatic(Event.class, "event").build(); @Override protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { processRequest(request, response); } @Override protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { processRequest(request, response); } protected void processRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType("text/html;charset=UTF-8"); Event event = new Event(); FormData<Event> formData = new FormData<Event>(event, ValidationResult.empty); FormMapping<Event> filledForm = eventForm.fill(formData); request.setAttribute("eventForm", filledForm); request.getRequestDispatcher("/WEB-INF/jsp/index.jsp").forward(request, response); } }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hello, I followed the example in your getting started section to create my own form. I made an event class with the following fields:
I then created
Event.properties
:However when I load my page the form labels are all shown as "??????". Any ideas what I'm doing wrong?
Finally, my JSP page:
And controller:
The text was updated successfully, but these errors were encountered: