<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="https://www.nakamuri.info/mw/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ja">
		<id>https://www.nakamuri.info/mw/index.php?action=history&amp;feed=atom&amp;title=Struts2_%E3%81%A7%E3%83%95%E3%82%A9%E3%83%BC%E3%83%A0%E3%81%A7%E8%A4%87%E6%95%B0%E3%83%9C%E3%82%BF%E3%83%B3%E3%82%92%E4%BD%BF%E3%81%86%E9%9A%9B%E3%80%81%E3%83%9C%E3%82%BF%E3%83%B3%E3%81%A7%E3%82%A2%E3%82%AF%E3%82%B7%E3%83%A7%E3%83%B3%E3%82%92%E5%88%87%E3%82%8A%E6%9B%BF%E3%81%88%E3%82%8B%E3%81%AB%E3%81%AF</id>
		<title>Struts2 でフォームで複数ボタンを使う際、ボタンでアクションを切り替えるには - 変更履歴</title>
		<link rel="self" type="application/atom+xml" href="https://www.nakamuri.info/mw/index.php?action=history&amp;feed=atom&amp;title=Struts2_%E3%81%A7%E3%83%95%E3%82%A9%E3%83%BC%E3%83%A0%E3%81%A7%E8%A4%87%E6%95%B0%E3%83%9C%E3%82%BF%E3%83%B3%E3%82%92%E4%BD%BF%E3%81%86%E9%9A%9B%E3%80%81%E3%83%9C%E3%82%BF%E3%83%B3%E3%81%A7%E3%82%A2%E3%82%AF%E3%82%B7%E3%83%A7%E3%83%B3%E3%82%92%E5%88%87%E3%82%8A%E6%9B%BF%E3%81%88%E3%82%8B%E3%81%AB%E3%81%AF"/>
		<link rel="alternate" type="text/html" href="https://www.nakamuri.info/mw/index.php?title=Struts2_%E3%81%A7%E3%83%95%E3%82%A9%E3%83%BC%E3%83%A0%E3%81%A7%E8%A4%87%E6%95%B0%E3%83%9C%E3%82%BF%E3%83%B3%E3%82%92%E4%BD%BF%E3%81%86%E9%9A%9B%E3%80%81%E3%83%9C%E3%82%BF%E3%83%B3%E3%81%A7%E3%82%A2%E3%82%AF%E3%82%B7%E3%83%A7%E3%83%B3%E3%82%92%E5%88%87%E3%82%8A%E6%9B%BF%E3%81%88%E3%82%8B%E3%81%AB%E3%81%AF&amp;action=history"/>
		<updated>2026-04-19T16:09:25Z</updated>
		<subtitle>このウィキのこのページに関する変更履歴</subtitle>
		<generator>MediaWiki 1.22.6</generator>

	<entry>
		<id>//www.nakamuri.info/mw/index.php?title=Struts2_%E3%81%A7%E3%83%95%E3%82%A9%E3%83%BC%E3%83%A0%E3%81%A7%E8%A4%87%E6%95%B0%E3%83%9C%E3%82%BF%E3%83%B3%E3%82%92%E4%BD%BF%E3%81%86%E9%9A%9B%E3%80%81%E3%83%9C%E3%82%BF%E3%83%B3%E3%81%A7%E3%82%A2%E3%82%AF%E3%82%B7%E3%83%A7%E3%83%B3%E3%82%92%E5%88%87%E3%82%8A%E6%9B%BF%E3%81%88%E3%82%8B%E3%81%AB%E3%81%AF&amp;diff=3832&amp;oldid=prev</id>
		<title>2016年12月21日 (水) 12:14にNakamuriによる</title>
		<link rel="alternate" type="text/html" href="https://www.nakamuri.info/mw/index.php?title=Struts2_%E3%81%A7%E3%83%95%E3%82%A9%E3%83%BC%E3%83%A0%E3%81%A7%E8%A4%87%E6%95%B0%E3%83%9C%E3%82%BF%E3%83%B3%E3%82%92%E4%BD%BF%E3%81%86%E9%9A%9B%E3%80%81%E3%83%9C%E3%82%BF%E3%83%B3%E3%81%A7%E3%82%A2%E3%82%AF%E3%82%B7%E3%83%A7%E3%83%B3%E3%82%92%E5%88%87%E3%82%8A%E6%9B%BF%E3%81%88%E3%82%8B%E3%81%AB%E3%81%AF&amp;diff=3832&amp;oldid=prev"/>
				<updated>2016-12-21T12:14:09Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;←前の版&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;2016年12月21日 (水) 12:14時点における版&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;4行:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;4行:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;struts2 でひとつのフォームで複数のサブミットボタンを使う場合、&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;struts2 でひとつのフォームで複数のサブミットボタンを使う場合、&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;s:submit タグの action &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;タグを使うのが定番でしたが、セキュリティ強化のため、&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;s:submit タグの &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;'''&lt;/ins&gt;action &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;タグ'''を使うのが定番でしたが、&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;struts &lt;/del&gt;2.3.15.3 以降、既定ではこの手法は使えなくなりました。&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;'''セキュリティ強化のため、struts &lt;/ins&gt;2.3.15.3 以降、既定ではこの手法は使えなくなりました。&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;'''&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;もちろん、struts2 のシステムの定数&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;もちろん、struts2 のシステムの定数&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Nakamuri</name></author>	</entry>

	<entry>
		<id>//www.nakamuri.info/mw/index.php?title=Struts2_%E3%81%A7%E3%83%95%E3%82%A9%E3%83%BC%E3%83%A0%E3%81%A7%E8%A4%87%E6%95%B0%E3%83%9C%E3%82%BF%E3%83%B3%E3%82%92%E4%BD%BF%E3%81%86%E9%9A%9B%E3%80%81%E3%83%9C%E3%82%BF%E3%83%B3%E3%81%A7%E3%82%A2%E3%82%AF%E3%82%B7%E3%83%A7%E3%83%B3%E3%82%92%E5%88%87%E3%82%8A%E6%9B%BF%E3%81%88%E3%82%8B%E3%81%AB%E3%81%AF&amp;diff=3822&amp;oldid=prev</id>
		<title>Nakamuri: ページの作成:「Category:コンピュータCategory:JavaCategory:Struts2 メインページ&amp;gt;コンピュータの部屋#Java&amp;gt;Struts2 Tips   struts2 でひ...」</title>
		<link rel="alternate" type="text/html" href="https://www.nakamuri.info/mw/index.php?title=Struts2_%E3%81%A7%E3%83%95%E3%82%A9%E3%83%BC%E3%83%A0%E3%81%A7%E8%A4%87%E6%95%B0%E3%83%9C%E3%82%BF%E3%83%B3%E3%82%92%E4%BD%BF%E3%81%86%E9%9A%9B%E3%80%81%E3%83%9C%E3%82%BF%E3%83%B3%E3%81%A7%E3%82%A2%E3%82%AF%E3%82%B7%E3%83%A7%E3%83%B3%E3%82%92%E5%88%87%E3%82%8A%E6%9B%BF%E3%81%88%E3%82%8B%E3%81%AB%E3%81%AF&amp;diff=3822&amp;oldid=prev"/>
				<updated>2016-12-18T15:18:17Z</updated>
		
		<summary type="html">&lt;p&gt;ページの作成:「&lt;a href=&quot;/mw/index.php/%E3%82%AB%E3%83%86%E3%82%B4%E3%83%AA:%E3%82%B3%E3%83%B3%E3%83%94%E3%83%A5%E3%83%BC%E3%82%BF&quot; title=&quot;カテゴリ:コンピュータ&quot;&gt;Category:コンピュータ&lt;/a&gt;&lt;a href=&quot;/mw/index.php/%E3%82%AB%E3%83%86%E3%82%B4%E3%83%AA:Java&quot; title=&quot;カテゴリ:Java&quot;&gt;Category:Java&lt;/a&gt;&lt;a href=&quot;/mw/index.php/%E3%82%AB%E3%83%86%E3%82%B4%E3%83%AA:Struts2&quot; title=&quot;カテゴリ:Struts2&quot;&gt;Category:Struts2&lt;/a&gt; &lt;a href=&quot;/mw/index.php/%E3%83%A1%E3%82%A4%E3%83%B3%E3%83%9A%E3%83%BC%E3%82%B8&quot; title=&quot;メインページ&quot;&gt;メインページ&lt;/a&gt;&amp;gt;&lt;a href=&quot;/mw/index.php/%E3%82%B3%E3%83%B3%E3%83%94%E3%83%A5%E3%83%BC%E3%82%BF%E3%81%AE%E9%83%A8%E5%B1%8B#Java&quot; title=&quot;コンピュータの部屋&quot;&gt;コンピュータの部屋#Java&lt;/a&gt;&amp;gt;&lt;a href=&quot;/mw/index.php/Struts2_Tips&quot; title=&quot;Struts2 Tips&quot;&gt;Struts2 Tips&lt;/a&gt;   struts2 でひ...」&lt;/p&gt;
&lt;p&gt;&lt;b&gt;新規ページ&lt;/b&gt;&lt;/p&gt;&lt;div&gt;[[Category:コンピュータ]][[Category:Java]][[Category:Struts2]]&lt;br /&gt;
[[メインページ]]&amp;amp;gt;[[コンピュータの部屋#Java]]&amp;amp;gt;[[Struts2 Tips]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
struts2 でひとつのフォームで複数のサブミットボタンを使う場合、&lt;br /&gt;
s:submit タグの action タグを使うのが定番でしたが、セキュリティ強化のため、&lt;br /&gt;
struts 2.3.15.3 以降、既定ではこの手法は使えなくなりました。&lt;br /&gt;
&lt;br /&gt;
もちろん、struts2 のシステムの定数&lt;br /&gt;
 struts.mapper.action.prefix.enabled&lt;br /&gt;
をtrueに変更すれば使えるのですが、セキュリティ上使わない方が無難でしょう。&lt;br /&gt;
&lt;br /&gt;
以下のようにして、Javascriptでactionを切り替えることをお勧めします。&lt;br /&gt;
&lt;br /&gt;
Javascript&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
    function submitForm(action) {&lt;br /&gt;
        document.forms[0].action = action;&lt;br /&gt;
        document.forms[0].submit();&lt;br /&gt;
        return false;&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
サブミットボタンは JSP では以下のように記述します。以下は okアクションを呼び出すボタンの記述です。&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;s:url var=&amp;quot;ok_url&amp;quot; action=&amp;quot;ok&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;button type=&amp;quot;button&amp;quot; onclick=&amp;quot;return submitForm('${ok_url}')&amp;quot;&amp;gt;ボタンのキャプション&amp;lt;/button&amp;gt;&lt;/div&gt;</summary>
		<author><name>Nakamuri</name></author>	</entry>

	</feed>