<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Blog &#187; JSP</title>
	<atom:link href="http://blog.marcuscobden.co.uk/tag/jsp/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.marcuscobden.co.uk</link>
	<description>Reflections of a compulsive engineer</description>
	<lastBuildDate>Wed, 01 Sep 2010 10:05:25 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Spring MVC Wizards &amp; Form Taglib</title>
		<link>http://blog.marcuscobden.co.uk/2008/01/spring-mvc-wizards-form-taglib/</link>
		<comments>http://blog.marcuscobden.co.uk/2008/01/spring-mvc-wizards-form-taglib/#comments</comments>
		<pubDate>Sat, 26 Jan 2008 16:30:00 +0000</pubDate>
		<dc:creator>Marcus</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Forms]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[JSP]]></category>
		<category><![CDATA[Spring]]></category>
		<category><![CDATA[Spring Framework]]></category>

		<guid isPermaLink="false">http://newblog.marcuscobden.co.uk/?p=6</guid>
		<description><![CDATA[I&#8217;ve been building a JSP based website for a course module titled &#8220;Technologies for Electronic Commerce&#8221;. It&#8217;s finished now, but I&#8217;ve only just got round to writing up this post. As part of this I was trying to make a multi-page form, using Spring&#8216;s AbstractWizardFormController and spent an hour or so trying to make the [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been building a JSP based website for a course module titled &#8220;Technologies for Electronic Commerce&#8221;. It&#8217;s finished now, but I&#8217;ve only just got round to writing up this post.</p>
<p>As part of this I was trying to make a multi-page form, using <a href="http://www.springframework.org/">Spring</a>&#8216;s <a href="http://static.springframework.org/spring/docs/2.5.x/api/index.html">AbstractWizardFormController</a> and spent an hour or so trying to make the form submission change the form page. My problem was that it wasn&#8217;t immediately obvious how to use the <a href="http://static.springframework.org/spring/docs/2.0.x/reference/mvc.html#mvc-formtaglib">form taglib</a> with the Wizard architecture.</p>
<p>The docs mentioned using request parameters, which was a bit confusing as I was using a POST form submission, however all you actually need to do is add one of these parameters to the form data (usually using a button).</p>
<blockquote><p>Finish and cancel actions can be triggered by request parameters, named PARAM_FINISH (&#8220;_finish&#8221;) and PARAM_CANCEL (&#8220;_cancel&#8221;), ignoring parameter values to allow for HTML buttons. The target page for page changes can be specified by PARAM_TARGET, appending the page number to the parameter name (e.g. &#8220;_target1&#8243;). The action parameters are recognized when triggered by image buttons too (via &#8220;_finish.x&#8221;, &#8220;_abort.x&#8221;, or &#8220;_target1.x&#8221;).</p></blockquote>
<p>For example:
<pre><code>&lt;input value="Submit" name="_target1" type="submit"/&gt;</code></pre>
<p>This will request to change to page 2 of the form (remember Array base is 0).<br />
Because of the way forms work, you can have a number of these (either as clickable images or buttons) and only the one the user eventually selects will be submitted with the request.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.marcuscobden.co.uk/2008/01/spring-mvc-wizards-form-taglib/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
