I have a form that have 2 buttons. one form register and another for cancel form. I create them with following code:
<s:submit name="cancel" key="project.button.cancel" />
<s:submit name="login" key="form.register.registerBtn" />
but I have a problem with its view. I will to command in one row. but it create two buttons in two row. you can see its picture in the following image:
how can I resolve this problem?
thanks.
update 2013/9/21 :
it is full jsp page code:
<%#taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<link rel="stylesheet" type="text/css"
href="${pageContext.request.contextPath}/resources/css/form.css" />
<title>Insert title here</title>
</head>
<body>
<div style="padding-top: 20px;"></div>
<div style="width: 600px; margin: 0 auto;">
<div style="float: left; padding: 20px; padding-top: 0px;">
<img alt=""
src="${pageContext.request.contextPath}/resources/img/register.png">
</div>
<div class="box" style="width: 300px; float: left;" id="col">
<h1>
<span class="title"><s:text name="form.register.title" /></span>
</h1>
<hr />
<form action="login" method="post" namespace="/">
<span class="text"><s:text name="user.nickname" /></span>
<s:textfield name="nickname" />
<hr />
<span class="text"><s:text name="user.username" /></span>
<s:textfield name="username" />
<span class="text"><s:text name="user.password" /></span>
<s:password name="password" />
<span class="text"><s:text name="user.validation" /></span>
<s:password name="validation" />
<s:checkbox name="recoverable" key="user.recoverable" />
<hr />
<span class="text"><s:text name="user.email" /></span>
<s:textfield name="validation" />
<div style="display: inline-block; white-space: no-wrap;">
<s:submit name="cancel" key="project.button.cancel"
cssClass="button-red" />
<s:submit name="login" key="form.register.registerBtn"
cssClass="button-green" />
</div>
</form>
</div>
</div>
The possible solution to wrap them in one div tag and apply CSS
<s:form action="login" method="post" namespace="/" theme="simple">
....
<div style="display:inline-block;white-space:nowrap;">
<s:submit name="cancel" key="project.button.cancel" />
<s:submit name="login" key="form.register.registerBtn" />
</div>
</s:form>
Related
Page "bookUpdate.html" does not work correctly because of the errors. I can open this page from page "bookList.html" via click to button "Edit". On all other pages bootstrap work correctly. I try to add to code something like "link rel="stylesheet" type="text/css" th:href="#{/webjars/bootstrap/css/bootstrap.min.css}" " but it did not work.
bookUpdate.html
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
xmlns:sec="https://www.thymeleaf.org/thymeleaf-extras-springsecurity5"
layout:decorate="~{fragments/main_layout}">
<body>
<div layout:fragment="content" class="container mySpace">
<form th:action="#{/bookUpdate/__${book.id}__}" th:object="${book.id}"
method="post">
<div class="form-group">
<label for="topic" class="form-control-label">Topic</label> <input
type="text" class="form-control" th:field="${book.topic}"
id="topic" />
</div>
<div class="form-group">
<label for="description" class="form-control-label">Description</label>
<textarea class="form-control" th:field="${book.description}"
id="description" style="height: 95px"></textarea>
</div>
<div class="form-group">
<label for="link" class="form-control-label">Link</label> <input
type="text" class="form-control" th:field="${book.link}" id="link" />
</div>
<input type="submit" value="Submit" class="btn btn-primary" />
</form>
</div>
</body>
</html>
SUGGESTION: Try changing "href" to "src":
https://stackoverflow.com/a/52435193/421195
ALSO: be sure to look at the other responses in the same thread.
I hope that helps ... and please post back what you find!
I resolved my issue. I added a links to bootstrap from file "main_layout.html", that I use for header, and added before them <base href="/">. Now it is working fine.
<head>
<base href="/">
<link rel="stylesheet" href="../../static/css/style.css"
th:href="#{css/style.css}" />
<link rel="stylesheet" href="../../static/css/materia/bootstrap.min.css"
th:href="#{css/materia/bootstrap.min.css}" />
<script type="text/javascript" th:src="#{scripts/jquery-3.2.1.min.js}"></script>
</head>
I am currently working on a java project and have made an html page with a design (css) page to accompany it. I have referenced it but it still won't have any effect. I hard reloaded the page still no changes. Don't really understand why this is happening. I keep getting "net::ERR_ABORTED 404" on localhost. The stylesheet file name is indeed correct (being loginStyle.css). They are also both located in the same folder. Would appreciate any help. Thanks!
.btn-color {
background-color: #0e1c36;
color: #fff;
}
.profile-image-pic {
height: 200px;
width: 200px;
object-fit: cover;
}
.cardbody-color {
background-color: #ebf2fa;
}
<!DOCTYPE html>
<html lang="en" xmlns:thymeleaf.org>
<head>
<link rel="stylesheet" type="text/css" href="loginStyle.css" />
</head>
<div class="container">
<div class="row">
<div class="col-md-6 offset-md-3">
<h2 class="text-center text-dark mt-5">Welcome</h2>
<div class="card my-5">
<form class="card-body cardbody-color p-lg-5" th:action="#{/userLogin}" th:object="${user}" method="post">
<div class="text-center">
<img src="https://cdn.pixabay.com/photo/2016/03/31/19/56/avatar-1295397__340.png" class="img-fluid profile-image-pic img-thumbnail rounded-circle my-3" width="200px" alt="profile">
</div>
<div class="mb-3">
<input type="text" class="form-control" id="Username" aria-describedby="emailHelp" placeholder="User Name" th:field="*{Id}">
</div>
<div class="mb-3">
<input type="password" class="form-control" id="password" placeholder="password" th:field="*{password}">
</div>
<div class="text-center"><button type="submit" class="btn btn-color px-5 mb-5 w-100">Login</button></div>
<div id="emailHelp" class="form-text text-center mb-5 text-dark">Not Registered?
<a href="#" class="text-dark fw-bold"> Create an Account
</a>
</div>
</form>
</div>
</div>
</div>
</div>
</html>
I have error in first line of following jsp page
<%#taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<%#taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<html>
<head>
<meta http-equiv="Content-Type"
content="text/html; charset=ISO-8859-
1">
<link rel="stylesheet"
href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/boo
tstrap.min.css">
<title>Products</title>
</head>
<body>
<section>
<div class="jumbotron">
<div class="container">
<h1>Products</h1>
<p>Add products</p>
</div>
</div>
</section>
<section class="container">
<form:form modelAttribute="newProduct" class="form-horizontal">
<fieldset>
<legend>Add new product</legend>
<div class="form-group">
<label class="control-label col-lg-2 col-lg-2" for="productId">Product
Id</label>
<div class="col-lg-10">
<form:input id="productId" path="productId" type="text"
class="form:input-large" />
</div>
</div>
<!-- Similarly bind <form:input> tag for
name,unitPrice,manufacturer,category,unitsInStock and unitsInOrder
fields-->
<div class="form-group">
<label class="control-label col-lg-2" for="description">Description</label>
<div class="col-lg-10">form:textarea id="description"
path="description" rows = "2"/></div>
</div>
<div class="form-group">
<label class="control-label col-lg-2" for="discontinued">Discontinued</label>
<div class="col-lg-10">
<form:checkbox id="discontinued" path="discontinued" />
</div>
</div>
<div class="form-group">
<label class="control-label col-lg-2" for="condition">Condition</label>
<div class="col-lg-10">
<form:radiobutton path="condition" value="New" />
New
<form:radiobutton path="condition" value="Old" />
Old
<form:radiobutton path="condition" value="Refurbished" />
Refurbished
</div>
</div>
<div class="form-group">
<div class="col-lg-offset-2 col-lg-10">
<input type="submit" id="btnAdd" class="btn btn-primary"
value="Add" />
</div>
</div>
</fieldset>
</form:form>
</section>
</body>
</html>
while doing this jsp i got error, I am new to view part and have little to none knowledge of Jstl el but while learning spring I got stuck in this error which says
Multiple annotations found at this line:
> - Missing end tag for
> "form:input"
>- Missing end tag for
> "form:input"
Am I missing something, how to solve this? even a small hint is welcomed too
Thanks
el will also evaluate expressions in comments, so you have to make the tags in comments as it is in "normal" page
Change
<!-- Similarly bind <form:input> tag for
name,unitPrice,manufacturer,category,unitsInStock and unitsInOrder
fields-->
to
<!-- Similarly bind <form:input/> tag for
name,unitPrice,manufacturer,category,unitsInStock and unitsInOrder
fields-->
I am new to spring MVC, JSP and bootstrap. I am trying to create a sign in form and read the values from it. For this purpose the login.jsp file I wrote is;
<%# page language="java" contentType="text/html; charset=utf-8"
pageEncoding="utf-8"%>
<%#taglib uri="http://www.springframework.org/tags" prefix="spring"%>
<%#taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Bootstrap Form With Spring Mvc Example</title>
<link href="http://getbootstrap.com/dist/css/bootstrap.min.css"
rel="stylesheet">
<link href="https://code.jquery.com/jquery-2.1.3.js" rel="stylesheet">
</head>
<body>
<jsp:include page="header.jsp"></jsp:include>
<div class="container">
<form:form class="form-signin" method="POST" commandName="user">
<h2 class="form-signin-heading">
<spring:message code="main.signin" />
</h2>
<label for="email" class="sr-only">
<spring:message code="main.email" />
</label>
<form:input type="email" path="email" id="email" class="form-control" placeholder=<spring:message code="main.email"/> required autofocus/>
<label for="password" class="sr-only">
<spring:message code="main.password" />
</label>
<form:input type="password" path="password" id="password" class="form-control" placeholder=<spring:message code="main.password"/> required/>
<div class="checkbox">
<label> <input type="checkbox" id="rememberme">
<spring:message code="main.rememberMe" />
</label>
</div>
<input class="btn btn-lg btn-primary btn-block" type="submit" id="submit" value=<spring:message code="main.signinBtn" /> >
</form:form>
</div>
<jsp:include page="footer.jsp"></jsp:include>
</body>
</html>
But I get
SEVERE: Servlet.service() for servlet [mvc-dispatcher] in context with path [/SpringMVC] threw exception [/WEB-INF/pages/login.jsp (line: 26, column: 86) quote symbol expected] with root cause
org.apache.jasper.JasperException: /WEB-INF/pages/login.jsp (line: 26, column: 86) quote symbol expected
exception. The line I get this exception is
<form:input type="email" path="email" id="email" class="form-control" placeholder=<spring:message code="main.email"/> required autofocus/>
I don't have any idea about the problem. Can you help?
You can't use <spring:message> within <form:input> in the manner attempted. Look at this question for the solution: how-to-use-springmessage-inside-an-attribute-of-forminput
I am using Spring Web Flow(SWF) for my conversation type page navigation. In that project, there is main flow called candidatemain-flow.xml and have subflow called candidate-flow.xml and matriculation-flow.xml. When I running my project, the main flow start and it transaction to the subflow called candidate-flow.xml and the registration page is rendered. But I fill some data in registration form and submit back to the subflow, it can't travel the second subflow called matriculation-flow.xml(I think) and show the registration form again and this flow step "execution=e1s1" show again.
This is my flow main definition:
<?xml version="1.0" encoding="UTF-8"?>
<flow xmlns="http://www.springframework.org/schema/webflow"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/webflow
http://www.springframework.org/schema/webflow/spring-webflow.xsd">
<var name="candidate" class="com.wcg.lms.models.CandidateDTOFull"/>
<subflow-state id="candidateRegistrationFir" subflow="candidate">
<input name="candidate" value="candidate" type="com.wcg.lms.models.CandidateDTOFull"/>
<output name="candidate" value="candidate" type="com.wcg.lms.models.CandidateDTOFull"/>
<transition on="candidateReady" to="candidateRegistrationSec" />
</subflow-state>
<subflow-state id="candidateRegistrationSec" subflow="matriculation">
<input name="candidate" value="candidate" type="com.wcg.lms.models.CandidateDTOFull"/>
<transition on="matriculationReady" to="candidateRegistrationThir" />
</subflow-state>
<subflow-state id="candidateRegistrationThir" subflow="academic">
<input name="candidate" value="candidate"/>
<transition on="academicReady" to="candidateRegistrationFourth" />
</subflow-state>
<subflow-state id="candidateRegistrationFourth" subflow="other">
<input name="candidate" value="candidate"/>
<transition on="otherReady" to="candidateRegistrationFifth" />
</subflow-state>
<subflow-state id="candidateRegistrationFifth" subflow="sourceoffinance">
<input name="candidate" value="candidate"/>
<transition on="sourceOfFinanceReady" to="candidateRegistrationSixth" />
</subflow-state>
<subflow-state id="candidateRegistrationSixth" subflow="parentdetails">
<input name="candidate" value="candidate"/>
<transition on="parentDetailsReady" to="addNewCandidate" />
</subflow-state>
<action-state id="addNewCandidate">
<evaluate result="flowScope.candidate" expression="candidateDelegate.addNewCandidateDetails(candidate)"></evaluate>
<transition to="thankCandidate"/>
</action-state>
<view-state id="thankCandidate" model="flowScope.candidate">
<on-entry>
<set name="flowScope.candidate" value="candidate" type="com.wcg.lms.models.CandidateDTOFull"/>
</on-entry>
<transition to="endState"/>
</view-state>
<end-state id="endState"/>
<global-transitions>
<transition on="cancel" to="endState"/>
</global-transitions>
</flow>
This is candidate-flow.xml:
<?xml version="1.0" encoding="UTF-8"?>
<flow xmlns="http://www.springframework.org/schema/webflow"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/webflow
http://www.springframework.org/schema/webflow/spring-webflow.xsd">
<input name="candidate" type="com.wcg.lms.models.CandidateDTOFull" required="true" />
<view-state id="candidateRegistrationViewFir" model="candidate">
<on-entry>
<evaluate result="viewScope.idTypeList" expression="idTypeDelegate.findAllIdType()"/>
<evaluate result="viewScope.genderList" expression="T(com.wcg.yude.lms.components.common.Gender).values()"/>
<evaluate result="viewScope.maritalStatusList" expression="T(com.wcg.yude.lms.components.common.MaritalStatus).values()"/>
<set name="candidate.name" value="new com.wcg.yude.lms.components.student.Name()"/>
<set name="candidate.address" value="new com.wcg.yude.lms.components.registrar.Address()" />
<set name="candidate.contactInfo" value="new com.wcg.yude.lms.components.registrar.ContactInfo()" />
<set name="candidate.photoAttachment" value="new com.wcg.lms.models.AttachmentHolderDTO()" />
</on-entry>
<transition on="submit" to="candidateReady"/>
</view-state>
<end-state id="cancel" />
<end-state id="candidateReady">
<output name="candidate" type="com.wcg.lms.models.CandidateDTOFull" />
</end-state>
<global-transitions>
<transition on="cancel" to="cancel" />
</global-transitions>
</flow>
This is matriculation-flow.xml:
<?xml version="1.0" encoding="UTF-8"?>
<flow xmlns="http://www.springframework.org/schema/webflow"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/webflow
http://www.springframework.org/schema/webflow/spring-webflow.xsd">
<var name="matriculationDetails" class="com.wcg.lms.models.CandidateMatriculationStandardDetailsDTO"/>
<input name="candidate" type="com.wcg.lms.models.CandidateDTOFull" required="true" />
<view-state id="candidateRegistrationViewSec" model="candidate">
<on-entry>
<set name="viewScope.photoAttachment" value="new com.wcg.lms.models.AttachmentHolderDTO()" />
</on-entry>
<transition on="submit" to="matriculationReady">
<evaluate expression="candidate.setMatriculationStandardDetails(matriculationDetails)"></evaluate>
</transition>
</view-state>
<end-state id="cancel" />
<end-state id="matriculationReady" />
<global-transitions>
<transition on="cancel" to="cancel" />
</global-transitions>
</flow>
This is candidateRegistrationViewFir.jsp for registration:
<%# page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
<%# taglib prefix="sf" uri="http://www.springframework.org/tags/form"%>
<%# taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>YUDE_Spring_Test</title>
<link href="<c:url value="/resources/css/bootstrap.min.css"/>" rel="stylesheet">
<link href="<c:url value="/resources/css/bootstrap.css"/>" rel="stylesheet">
<link href="<c:url value="/resources/css/thuStyle.css"/>" rel="stylesheet">
</head>
<body>
<div class="container-fluid">
<div class="row">
<img class="img-rounded" alt="" src="<c:url value="/resources/img/YUDE-Banner3.jpg"/>" style="width: 100%; height: 300px;">
</div>
<br/>
<div class="row">
<div class="col-md-8 col-md-offset-2">
<div class="well">
<sf:form cssClass="form-horizontal" commandName="candidate">
<input type="hidden" name="_flowExecutionKey" value="${flowExecutionKey}"/>
<label>flowExecutionKey: ${flowExecutionKey}</label>
<div class="form-group">
<label for="firstName" class="col-md-3 control-label">First Name :</label>
<div class="col-md-3">
<sf:input path="name.firstName" cssClass="form-control" size="15" id="firstName" placeholder="Full Name" />
</div>
<label for="street1" class="col-md-3 control-label">Street-1 :</label>
<div class="col-md-3">
<sf:input path="address.street1" cssClass="form-control" size="50" id="street1" placeholder="Street-1" />
</div>
</div>
<div class="form-group">
<label for="middleName" class="col-md-3 control-label">Middle Name :</label>
<div class="col-md-3">
<sf:input path="name.middleName" cssClass="form-control" size="15" id="middleName" placeholder="Middle Name" />
</div>
<label for="street2" class="col-md-3 control-label">Street-2 :</label>
<div class="col-md-3">
<sf:input path="address.street2" cssClass="form-control" size="50" id="street2" placeholder="Street-2" />
</div>
</div>
<div class="form-group">
<label for="lastName" class="col-md-3 control-label">Last Name :</label>
<div class="col-md-3">
<sf:input path="name.lastName" cssClass="form-control" size="15" id="lastName" placeholder="Last Name" />
</div>
<label for="city" class="col-md-3 control-label">City :</label>
<div class="col-md-3">
<sf:input path="address.city" cssClass="form-control" size="15" id="city" placeholder="City" />
</div>
</div>
<div class="form-group">
<label for="dob" class="col-md-3 control-label">Date Of Birth :</label>
<div class="col-md-3">
<sf:input path="dob" cssClass="form-control" size="15" id="dob" placeholder="Date Of Birth" />
</div>
<label for="state" class="col-md-3 control-label">State :</label>
<div class="col-md-3">
<sf:input path="address.state" cssClass="form-control" size="15" id="state" placeholder="State" />
</div>
</div>
<div class="form-group">
<label for="nationality" class="col-md-3 control-label">Nationality :</label>
<div class="col-md-3">
<sf:input path="nationality" cssClass="form-control" size="15" id="nationality" placeholder="Nationality" />
</div>
<label for="country" class="col-md-3 control-label">Country :</label>
<div class="col-md-3">
<sf:input path="address.country" cssClass="form-control" size="15" id="country" placeholder="Country" />
</div>
</div>
<div class="form-group">
<label for="race" class="col-md-3 control-label">Race</label>
<div class="col-md-3">
<sf:input path="race" cssClass="form-control" size="15" id="race" placeholder="Race" />
</div>
<label for="phone1" class="col-md-3 control-label">Phone-1 :</label>
<div class="col-md-3">
<sf:input path="contactInfo.phone1" cssClass="form-control" size="15" id="phone1" placeholder="Phone1" />
</div>
</div>
<div class="form-group">
<label for="idType" class="col-md-3 control-label">IdType :</label>
<div class="col-md-3">
<sf:select path="idType" cssClass="form-control" id="idType">
<c:forEach var="idType" items="${idTypeList}">
<sf:option value="${idType}">${idType.name}</sf:option>
</c:forEach>
</sf:select>
</div>
<label for="phone2" class="col-md-3 control-label">Phone-2 :</label>
<div class="col-md-3">
<sf:input path="contactInfo.phone2" cssClass="form-control" size="15" id="phone2" placeholder="Phone2" />
</div>
</div>
<div class="form-group">
<label for="idNo" class="col-md-3 control-label">Id No :</label>
<div class="col-md-3">
<sf:input path="idNo" cssClass="form-control" size="15" id="idNo" placeholder="IdNo" />
</div>
<label for="phone3" class="col-md-3 control-label">Phone-3 :</label>
<div class="col-md-3">
<sf:input path="contactInfo.phone3" cssClass="form-control" size="15" id="phone3" placeholder="Phone3" />
</div>
</div>
<div class="form-group">
<label class="col-md-2 control-label">MALE</label>
<div class="col-md-1">
<sf:radiobutton path="gender" cssClass="form-control" value="${gender.MALE}" />
</div>
<label class="col-md-2 control-label">FEMALE</label>
<div class="col-md-1">
<sf:radiobutton path="gender" cssClass="form-control" value="${gender.FEMALE}" />
</div>
<label for="email1" class="col-md-3 control-label">Email-1 :</label>
<div class="col-md-3">
<sf:input path="contactInfo.email1" cssClass="form-control" size="15" id="email1" placeholder="Email-1" />
</div>
</div>
<div class="form-group">
<label for="maritalStatus" class="col-md-3 control-label">MaritalStatus :</label>
<div class="col-md-3">
<sf:select path="maritalStatus" cssClass="form-control" id="maritalStatus">
<c:forEach var="maritalStatus" items="${maritalStatusList}">
<sf:option value="${maritalStatus}">${maritalStatus}</sf:option>
</c:forEach>
</sf:select>
</div>
<label for="email2" class="col-md-3 control-label">Email-2 :</label>
<div class="col-md-3">
<sf:input path="contactInfo.email2" cssClass="form-control" size="15" id="email2" placeholder="Email-2" />
</div>
</div>
<div class="form-group">
<label for="occupation" class="col-md-3 control-label">Occupation :</label>
<div class="col-md-3">
<sf:input path="occupation" cssClass="form-control" size="15" id="occupation" placeholder="Occupation" />
</div>
<div class="form-group">
<label for="photoAttachment" class="col-md-3 control-label">File input</label>
<div class="col-md-3">
<sf:input path="photoFile" type="file" id="photoAttachment" />
</div>
</div>
</div>
<div class="form-group">
<div class="col-md-3 pull-left">
<button type="submit" class="btn btn-primary" name="_eventId_cancel" disabled="disabled">← Older</button>
</div>
<div class="col-md-3 pull-right">
<input type="submit" class="btn btn-primary" name="_eventId_submit" value="Newer →"/>
</div>
</div>
</sf:form>
</div>
</div>
</div>
</div>
</body>
</html>
This is the candidateRegistrationViewSec.jsp:
<%# page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
<%# taglib prefix="sf" uri="http://www.springframework.org/tags/form"%>
<%# taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>YUDE_Spring_Test</title>
<link href="<c:url value="/resources/css/bootstrap.min.css"/>" rel="stylesheet">
<link href="<c:url value="/resources/css/bootstrap.css"/>" rel="stylesheet">
<link href="<c:url value="/resources/css/thuStyle.css"/>" rel="stylesheet">
</head>
<body>
<blockquote>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.</p>
<footer>Someone famous in <cite title="Source Title">Source Title</cite></footer>
</blockquote>
</body>
There are two possibilities here. This can be inferred from the statement "..it can't travel the second subflow called matriculation-flow.xml(I think) and show the registration form again and this flow step "execution=e1s1" show again."
Include method as post in
<sf:form cssClass="form-horizontal" commandName="candidate" method="post">
1) Event is not being generated by your view candidateRegistrationViewFir.jsp and so there will not be a change in snapshotId(e1s1).
The syntax looks correct for submit button:
<input type="submit" class="btn btn-primary" name="_eventId_submit" value="Newer →"/>
But to make sure just try couple of things:
Either change button to(this really doesn't make a difference):
<input type="submit" value="submit" />
<input type="hidden" name="_eventId" value="submit"/>
or:
Include javascript function:
function submitEvent(eventId)
{
document.getElementById("candidate")._eventId.value = eventId;
document.getElementById("canditate").submit();
}
and include in jsp as:
<input type="hidden" name="_eventId" value=""/>
and replace button with
<span>Newer</span>
2) There is a registered validator validating the model "candidate".
If there is a validation error on the model, flow will land in the same view and so there will not be a change in snapshotId(e1s1).
But scenario 2 is ruled out per your comment.
Your comment is partially right but not validator but it need converter or formatter. Although I directly fill data by call ref-type dot its value type variable, "IdTypeDTO" object and "Gender" enum are binding as String to its model class's property's property(means "candidateModelBean.candidate.idType" property is reference type and I bind that property as String).
So I simply add custom formatter for that type of property like this :
public class GenderFormatter implements Formatter<Gender>{
#Override
public String print(Gender gender, Locale local) {
return gender.getLabel();
}
#Override
public Gender parse(String value, Locale local) throws ParseException {
if(Gender.valueOf(value) == Gender.MALE) {
return Gender.MALE;
} else {
return Gender.FEMALE;
}
}
}
and registered in formatter registray and config in web flow config file and every things go well and transition to page 2(candidateRegistrationViewSec.jsp). However because of your comment, I check again and realize the solution. Thank for answering Prasad :)