JavaBeat

  • Home
  • Java
    • Java 7
    • Java 8
    • Java EE
    • Servlets
  • Spring Framework
    • Spring Tutorials
    • Spring 4 Tutorials
    • Spring Boot
  • JSF Tutorials
  • Most Popular
    • Binary Search Tree Traversal
    • Spring Batch Tutorial
    • AngularJS + Spring MVC
    • Spring Data JPA Tutorial
    • Packaging and Deploying Node.js
  • About Us
    • Join Us (JBC)
  • Privacy

Spring HTML TRANSFORM Tag (<spring:transform>)

December 6, 2010 by Krishna Srinivasan Leave a Comment

Spring Tag Library

Spring MVC provides a JSP tag library (Spring Form) for making it easier to bind form elements to Model data. Spring Framework also provides you with some tags for evaluating errors, setting themes and outputting internationalized messages.

also read:

  • Spring Framework Articles
  • Introduction to Spring MVC Web Framework – Web Tier
  • Integrating Spring Framework with Hibernate ORM Framework
  • Introduction to Spring Web Framework
  • Introduction to Spring’s Aspect Oriented Programming(AOP)
  • Introduction to Spring Web Services

Syntax to use Spring tag library

[code lang=”html”]&lt;%@taglib uri=&quot;http://www.springframework.org/tags&quot; prefix=&quot;spring&quot;&gt;[/code]

transform tag

-This tag provides support for transforming properties which is not contained by Command usign propertyEditors associated with Command. This tag can only be used inside the spring:bind tag.

Example for tags

1.Modify the web.xml to configure the Dispatcher Servlet.
web.xml

[code lang=”xml”]
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;web-app version=&quot;2.5&quot; xmlns=&quot;http://java.sun.com/xml/ns/javaee&quot;
xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;
xsi:schemaLocation=&quot;http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd&quot;&gt;
&lt;context-param&gt;
&lt;param-name&gt;contextConfigLocation&lt;/param-name&gt;
&lt;param-value&gt;/WEB-INF/applicationContext.xml&lt;/param-value&gt;
&lt;/context-param&gt;
&lt;listener&gt;
&lt;listener-class&gt;org.springframework.web.context.ContextLoaderListener&lt;/listener-class&gt;
&lt;/listener&gt;
&lt;servlet&gt;
&lt;servlet-name&gt;dispatcher&lt;/servlet-name&gt;
&lt;servlet-class&gt;org.springframework.web.servlet.DispatcherServlet&lt;/servlet-class&gt;
&lt;load-on-startup&gt;2&lt;/load-on-startup&gt;
&lt;/servlet&gt;
&lt;servlet-mapping&gt;
&lt;servlet-name&gt;dispatcher&lt;/servlet-name&gt;
&lt;url-pattern&gt;*.htm&lt;/url-pattern&gt;
&lt;/servlet-mapping&gt;
&lt;session-config&gt;
&lt;session-timeout&gt;
30
&lt;/session-timeout&gt;
&lt;/session-config&gt;
&lt;welcome-file-list&gt;
&lt;welcome-file&gt;index.html&lt;/welcome-file&gt;
&lt;/welcome-file-list&gt;
&lt;/web-app&gt;
[/code]

2.Create an dispatcher-servlet.xml file which contains all the configuration beans to handle the user requests.It handles the user request and dispatches to respective controllers.This file contains the countryController bean which is used to control the request.

dispatcher-servlet.xml

[code lang=”xml”]
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;beans xmlns=&quot;http://www.springframework.org/schema/beans&quot;
xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;
xmlns:p=&quot;http://www.springframework.org/schema/p&quot;
xmlns:aop=&quot;http://www.springframework.org/schema/aop&quot;
xmlns:tx=&quot;http://www.springframework.org/schema/tx&quot;
xsi:schemaLocation=&quot;http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd&quot;&gt;

&lt;bean class=&quot;org.springframework.web.servlet.mvc.support.ControllerClassNameHandlerMapping&quot;/&gt;

&lt;bean id=&quot;urlMapping&quot; class=&quot;org.springframework.web.servlet.handler.SimpleUrlHandlerMapping&quot;&gt;
&lt;property name=&quot;urlMap&quot;&gt;
&lt;map&gt;
&lt;entry key=&quot;/index.html&quot;&gt;
&lt;ref bean=&quot;CountryController&quot;/&gt;
&lt;/entry&gt;
&lt;/map&gt;
&lt;/property&gt;

&lt;/bean&gt;
&lt;bean id=&quot;CountryController&quot; class=&quot;countryController&quot;&gt;

&lt;property name=&quot;commandName&quot; value=&quot;Country&quot;&gt;&lt;/property&gt;

&lt;property name=&quot;commandClass&quot; value=&quot;country&quot;&gt;&lt;/property&gt;

&lt;property name=&quot;formView&quot;&gt;&lt;value&gt;index&lt;/value&gt;&lt;/property&gt;

&lt;property name=&quot;successView&quot;&gt;&lt;value&gt;success&lt;/value&gt;&lt;/property&gt;

&lt;/bean&gt;

&lt;bean id=&quot;viewResolver&quot;
class=&quot;org.springframework.web.servlet.view.InternalResourceViewResolver&quot;
p:prefix=&quot;/WEB-INF/jsp/&quot;
p:suffix=&quot;.jsp&quot; /&gt;

&lt;bean name=&quot;indexController&quot;
class=&quot;org.springframework.web.servlet.mvc.ParameterizableViewController&quot;
p:viewName=&quot;index&quot; /&gt;

&lt;/beans&gt;

[/code]

3.Create a Jsp file index.jsp which contains the spring tranform tag. In this example the user has to select a country from the list and click submit button.The selected country name in the list will be displayed along with “selected ” word which shows the transform tag tranforming the properties of the given object.

index.jsp

[code lang=”html”]

&lt;%@page contentType=&quot;text/html&quot; pageEncoding=&quot;UTF-8&quot;%&gt;
&lt;%@taglib uri=&quot;http://www.springframework.org/tags&quot; prefix=&quot;spring&quot; %&gt;
&lt;%@taglib uri=&quot;http://java.sun.com/jsp/jstl/core&quot; prefix=&quot;c&quot; %&gt;
&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.01 Transitional//EN&quot;
&quot;http://www.w3.org/TR/html4/loose.dtd&quot;&gt;

&lt;html&gt;
&lt;head&gt;
&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=UTF-8&quot;&gt;
&lt;title&gt;Welcome to Spring Web MVC project&lt;/title&gt;
&lt;/head&gt;

&lt;body bgcolor=&quot;#DDDDDD&quot;&gt;
&lt;h1&gt;Spring:transform tag example.&lt;/h1&gt;
Select any country and click the submit button.The selected country in the list will
be displayed along with the word &quot;selected&quot; thus shows the transform tag provide support for transforming properties.
&lt;form action=&quot;&quot; method=&quot;post&quot;&gt;
&lt;spring:nestedPath path=&quot;Country&quot;&gt;
&lt;spring:bind path=&quot;country_name&quot; &gt;
&lt;b&gt;Country&lt;/b&gt; &lt;select name=&quot;&lt;c:out value=’${status.expression}’/&gt;&quot;&gt;

&lt;c:forEach items=&quot;${countryName}&quot; var=&quot;type&quot;&gt;

&lt;spring:transform value=&quot;${type}&quot; var=&quot;typeString&quot;/&gt;
&lt;option value=&quot;&lt;c:out value=’${typeString}’/&gt;&quot;/&gt;

&lt;c:if test=&quot;${status.value == typeString}&quot;&gt; selected&lt;/c:if&gt;

&lt;c:out value=&quot;${typeString}&quot;/&gt;
&lt;/option&gt;
&lt;h1&gt;${name}&lt;/h1&gt;
&lt;/c:forEach&gt;
&lt;/select&gt;
&lt;h1&gt;${name}&lt;/h1&gt;
&lt;/spring:bind&gt;
&lt;/spring:nestedPath&gt;
&lt;input type=&quot;submit&quot;&gt;
&lt;/form&gt;

&lt;/body&gt;
&lt;/html&gt;
[/code]

4.Create countryController.java which extends a SimpleFormController class provides configurable form and success views.In this example we have referenceData method which returns a Map of values from the bean.These Map values are loaded into the list in the index.jsp page.

countryController.java

[code lang=”java”]

import java.util.ArrayList;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.SimpleFormController;

public class countryController extends SimpleFormController {

public countryController() {

}

@Override
@SuppressWarnings(&quot;empty-statement&quot;)
protected Map referenceData(HttpServletRequest request) throws Exception {
country c1=new country();
Map mp=new HashMap();

ArrayList&lt;string&gt; li=new ArrayList&lt;string&gt;();
li.add(&quot;India&quot;);
li.add(&quot;USA&quot;);
li.add(&quot;UK&quot;);
c1.setCountry_name(li);
mp.put(&quot;countryName&quot;,c1.getCountry_name());

return mp;
}

}

[/code]

5.Create country.java bean to hold the country names as an ArrayList.This bean is declared in the dispatcher-servlet.xml file which makes the spring to control the bean with their respective getter and setter methods.

country.java

[code lang=”java”]

import java.util.ArrayList;

public class country {

private ArrayList&lt;string&gt; country_name=new ArrayList&lt;string&gt;();

public country() {

}

public ArrayList&lt;string&gt; getCountry_name() {
return country_name;
}

public void setCountry_name(ArrayList&lt;string&gt; country_name) {
this.country_name = country_name;
}

}

[/code]

4.Building and running the application
Output

Access page:http://localhost:8084/transform/index.html
After user selects a country and clicks submit button.

also read:

  • Spring Framework Articles
  • Introduction to Spring MVC Web Framework – Web Tier
  • Integrating Spring Framework with Hibernate ORM Framework
  • Introduction to Spring Web Framework
  • Introduction to Spring’s Aspect Oriented Programming(AOP)
  • Introduction to Spring Web Services

Filed Under: Spring Framework Tagged With: Spring Tags

Spring HTML ESCAPE and ESCAPE BODY Tags (<spring:htmlEscape> and <spring:escapeBody>)

November 30, 2010 by Krishna Srinivasan Leave a Comment

Spring Tag Library

Spring MVC provides a JSP tag library (Spring Form) for making it easier to bind form elements to Model data. Spring Framework also provides you with some tags for evaluating errors, setting themes and outputting internationalized messages.

also read:

  • Spring Tutorials
  • Spring 4 Tutorials
  • Spring Interview Questions

Syntax to use Spring tag library

[code lang=”html”]
<%@taglib uri="http://www.springframework.org/tags" prefix="spring">
[/code]

htmlEscape and escapeBody tags

-This tag sets the default HTML escape value for the current page.The default is “false”.We can also set a “defaultHtmlEscape” web.xml context-param.A page-level setting overrides a context-param

-This tag is used to escape its enclosed body content, applying HTML escaping and/or JavaScript escaping. It is used to explicitly specify whether to apply HTMlL escaping or not. If not set, a page-level default (e.g. from the HtmlEscapeTag) or an application-wide default (the “defaultHtmlEscape” context-param in web.xml) is used.

Example for and tags

1.Modify the web.xml to configure the Dispatcher Servlet.
web.xml

[code lang=”xml”]
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/applicationContext.xml</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<servlet>
<servlet-name>dispatcher</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<load-on-startup>2</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>dispatcher</servlet-name>
<url-pattern>*.htm</url-pattern>
</servlet-mapping>
<session-config>
<session-timeout>
30
</session-timeout>
</session-config>
<welcome-file-list>
<welcome-file>index.htm</welcome-file>
</welcome-file-list>
</web-app>
[/code]

2.Create an dispatcher-servlet.xml file which contains all the configuration beans to handle the user requests.It handles the user request and dispatches to respective controllers.

dispatcher-servlet.xml

[code lang=”xml”]
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:p="http://www.springframework.org/schema/p"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd">

<bean class="org.springframework.web.servlet.mvc.support.ControllerClassNameHandlerMapping"/>

<bean id="urlMapping" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
<property name="mappings">
<props>
<prop key="index.htm">indexController</prop>
</props>
</property>
</bean>

<bean id="viewResolver"
class="org.springframework.web.servlet.view.InternalResourceViewResolver"
p:prefix="/WEB-INF/jsp/"
p:suffix=".jsp" />

<!–
The Index Controller
–>

<bean name="indexController"
class="org.springframework.web.servlet.mvc.ParameterizableViewController"
p:viewName="index" />

</beans>

[/code]

3.Create a Jsp file index.jsp which contains the spring htmlEscape and escapeBody tags. In this example both tags are set with different cominations of values(“true”,”false”).

index.jsp

[code lang=”html”]
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib uri="http://www.springframework.org/tags" prefix="spring"%>
<!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=UTF-8">
<title>Welcome to Spring Web MVC project</title>
</head>

<body bgcolor="#DDDDDD">

<h3>htmlEscape is false </h3>
<h3>escapeBody is false </h3>
<spring:htmlEscape defaultHtmlEscape="false">
<spring:escapeBody htmlEscape="false">

<h5> less than < </h5>
<h5> greater than > </h5>
</spring:escapeBody>
</spring:htmlEscape>

<h3>htmlEscape is false </h3>
<h3>escapeBody is true </h3>
<spring:htmlEscape defaultHtmlEscape="false">
<spring:escapeBody htmlEscape="true">

<h5> less than < </h5>
<h5> greater than > </h5>
</spring:escapeBody>
</spring:htmlEscape>

<h3>htmlEscape is true </h3>
<h3>escapeBody is false </h3>
<spring:htmlEscape defaultHtmlEscape="true">
<spring:escapeBody htmlEscape="false">

<h5> less than < </h5>
<h5> greater than > </h5>
</spring:escapeBody>
</spring:htmlEscape>

<h3>htmlEscape is true </h3>
<h3>escapeBody is true </h3>
<spring:htmlEscape defaultHtmlEscape="true">
<spring:escapeBody htmlEscape="true">

<h5> less than < </h5>
<h5> greater than > </h5>
</spring:escapeBody>
</spring:htmlEscape>

</body>
</html>

[/code]

4.Building and running the application
Output

Access page:http://localhost:8084/HtmlEscape/index.htm

also read:

  • Spring Books
  • Introduction to Spring Framework
  • Introduction to Spring MVC Framework

Filed Under: Spring Framework Tagged With: Spring Tags

Spring BIND and NESTEDPATH Tags (<spring:bind> and <spring:nestedPath>)

November 30, 2010 by Krishna Srinivasan Leave a Comment

Spring Tag Library

Spring MVC provides a JSP tag library (Spring Form) for making it easier to bind form elements to Model data. Spring Framework also provides you with some tags for evaluating errors, setting themes and outputting internationalized messages.

also read:

  • Spring Tutorials
  • Spring 4 Tutorials
  • Spring Interview Questions

Syntax to use Spring tag library

[code lang=”html”]
<%@taglib uri="http://www.springframework.org/tags" prefix="spring">
[/code]

Bind and NestedPath tags

-This tag provides support for the evaluation of the certain bean or bean property.The status may includes the actual value of the certain bean or bean property as well as possible errors and the expression for the databinding functionality.

-This tag provide support and assist with nested beans or bean properties.It exports a “nestedPath” variable of type String.
The BindTag will automatically detect the nested path and automatically prepend it to its own path to form a complete path to the bean or bean property.
This tag will also prepend any existing nested path that is currently set. Thus, you can nest multiple nested path tags.

Example for and tags

1.Modify the web.xml to configure the Dispatcher Servlet.
web.xml

[code lang=”xml”]
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/applicationContext.xml</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<servlet>
<servlet-name>dispatcher</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<load-on-startup>2</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>dispatcher</servlet-name>
<url-pattern>*.htm</url-pattern>
</servlet-mapping>
<session-config>
<session-timeout>
30
</session-timeout>
</session-config>
<welcome-file-list>
<welcome-file>index.htm</welcome-file>
</welcome-file-list>
</web-app>
[/code]

2.Create an dispatcher-servlet.xml file which contains all the configuration beans to handle the user requests.It handles the user request and dispatches to respective controllers.

dispatcher-servlet.xml

[code lang=”xml”]
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:p="http://www.springframework.org/schema/p"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd">

<bean class="org.springframework.web.servlet.mvc.support.ControllerClassNameHandlerMapping"/>

<bean id="urlMapping" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
<property name="urlMap">
<map>
<entry key="/index.htm">
<ref bean="helloService"/>
</entry>
</map>
</property>
</bean>

<bean id="viewResolver"
class="org.springframework.web.servlet.view.InternalResourceViewResolver"
p:prefix="/WEB-INF/jsp/"
p:suffix=".jsp" />

<!–
The Index Controller
–>
<bean class="controller.HelloController" id="helloService"/>
</beans>

[/code]

3.Create a Jsp file for taking input from the user nameView.jsp which contains all the form fields with Spring bind tags.Later we set the FormView as this file to accept input.

nameView.jsp

[code lang=”html”]

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib uri="http://www.springframework.org/tags" prefix="spring" %>
<%@taglib uri="http://www.springframework.org/tags/form" prefix="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=UTF-8">
<title>JSP Page</title>
</head>
<body bgcolor="#DDDDDD">
<h1>Spring nestedpath and bind tag example</h1>
<spring:nestedPath path="name">
Enter Your Details…
<form action="" method="post">
Name:
<spring:bind path="name">
<input type="text" name="${status.expression}" value="${status.value}"><br />
</spring:bind>
Country:
<spring:bind path="country">
<input type="text" name="${status.expression}" value="${status.value}"><br />
</spring:bind>
Email:
<spring:bind path="email">
<input type="text" name="${status.expression}" value="${status.value}">
</spring:bind>
<input type="submit" value="OK">
</form>
</spring:nestedPath>

</body>
</html>

[/code]

4.Create another Jsp file helloView.jsp which is a View for Spring to display the output. In this file we use Expression Language to display the details from as the bean properties.In Spring we can set the success view page from the controller.

helloView.jsp

[code lang=”html”]
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@page import="java.util.Enumeration"%>
<!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=UTF-8">
<title>JSP Page</title>
</head>
<body bgcolor="#DDDDDD">
<h1>Spring nestedpath and bind tag example</h1>

<h3>Your Details are…</h3>
<h4>${name}</h4>
<h4>${country}</h4>
<h4>${email}</h4>
</body>
</html>

[/code]

5.Create a Java class file Name.java this bean contains the 3 private variables to store the values which are binded using bind tag.Binding is associated with setting the bean property by using respective setter methods.Using getter methods we can retrieve the values in the controller.

Name.java

[code lang=”java”]
public class Name {

private String name;
private String country;
private String email;

public String getCountry() {
return country;
}

public void setCountry(String country) {
this.country = country;
}

public String getEmail() {
return email;
}

public void setEmail(String email) {
this.email = email;
}

public String getName() {
return name;
}

public void setName(String name) {
this.name = name;
}

}

[/code]

6.Create a HelloController.java file which extends SimpleFormController to control the user request and return respective ModelAndView object. In this controller we can set the FormView,Success View and Bean as setCommand.
HelloController.java

[code lang=”java”]

import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.SimpleFormController;

public class HelloController extends SimpleFormController {

private HelloService helloService;

public void setHelloService(HelloService helloService) {
this.helloService = helloService;
}
public HelloController() {

setCommandClass(Name.class);
setCommandName("name");
setSuccessView("helloView");
setFormView("nameView");
}

@Override
protected ModelAndView onSubmit(Object command) throws Exception {
Name name = (Name)command;
ModelAndView mv = new ModelAndView(getSuccessView());

mv.addObject("name", name.getName());
mv.addObject("country",name.getCountry());
mv.addObject("email",name.getEmail());

return mv;
}

}

[/code]

7.Building and running the application
Output

Access page:http://localhost:8080/HelloSpring/index.html
Success View page is displayed with the details

Spring Framework Articles

also read:

  • Spring Framework Articles
  • Introduction to Spring MVC Web Framework – Web Tier
  • Integrating Spring Framework with Hibernate ORM Framework
  • Introduction to Spring Web Framework
  • Introduction to Spring Web Services

Filed Under: Spring Framework Tagged With: Spring Tags

Follow Us

  • Facebook
  • Pinterest

As a participant in the Amazon Services LLC Associates Program, this site may earn from qualifying purchases. We may also earn commissions on purchases from other retail websites.

JavaBeat

FEATURED TUTORIALS

Answered: Using Java to Convert Int to String

What is new in Java 6.0 Collections API?

The Java 6.0 Compiler API

Copyright © by JavaBeat · All rights reserved