0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Struts2 の [S2-016][S2-017] 影響チェック

Last updated at Posted at 2013-08-05

検証 : Struts2-core-2.3.15+convention plugin

IndexAction
package s2016.action;

import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.Namespace;
import org.apache.struts2.convention.annotation.ParentPackage;
import org.apache.struts2.convention.annotation.Result;
import org.apache.struts2.convention.annotation.Results;

import com.opensymphony.xwork2.ActionSupport;

@SuppressWarnings({ "javadoc", "serial" })
@Namespace("/")
@ParentPackage("struts-default")
@Action("index")
@Results({
		@Result(name = "success", location = "index.html"),
		@Result(location = "index.html"),
})
public class IndexAction extends ActionSupport {

}
テスト用HTML+結果
<html>
	<body>
		<h1>S2-016/S2-017 check</h1>
		<h2>A-GET-action</h2>
		<dl>
			<dt><a href="?action:%25{1}">test</a></dt>
			<dt><a href="?action:%25%7b1%7d">test</a></dt>
			<dd>(2.3.15.0) -> html表示</dd>
			<dd>(2.3.15.1) -> html表示</dd>
		</dl>
		<h2>A-GET-redirect</h2>
		<dl>
			<dt><a href="?redirect:%25{1}">test</a></dt>
			<dt><a href="?redirect:%25%7b1%7d">test</a></dt>
			<dd>(2.3.15.0) -> 画面遷移 NG</dd>
			<dd>(2.3.15.1) -> 遷移せず OK</dd>
		</dl>
		<h2>A-GET-redirectAction</h2>
		<dl>
			<dt><a href="?redirectAction:%25{1}">test</a></dt>
			<dt><a href="?redirectAction:%25%7b1%7d">test</a></dt>
			<dd>(2.3.15.0) -> 画面遷移 NG</dd>
			<dd>(2.3.15.1) -> 遷移せず OK</dd>
		</dl>
		<h2>A-GET-direct</h2>
		<dl>
			<dt><a href="/s2-016/%25{1}">test</a></dt>
			<dd>(2.3.15.0) -> There is no Action mapped for namespace [/] and action name [1] associated with context path [/s2-016].</dd>
			<dd>(2.3.15.1) -> There is no Action mapped for namespace [/] and action name [1] associated with context path [/s2-016].</dd>
			<dd>変化しない??</dd>
		</dl>
		<h2>A-GET-direct</h2>
		<dl>
			<dt><a href="/s2-016/%25{1}.action">test</a></dt>
			<dd>(2.3.15.0) -> There is no Action mapped for namespace [/] and action name [1] associated with context path [/s2-016].</dd>
			<dd>(2.3.15.1) -> There is no Action mapped for namespace [/] and action name [1] associated with context path [/s2-016].</dd>
			<dd>変化しない??</dd>
		</dl>
		<h2>GET-Form(x-www-form-urlencoded)</h2>
		<form enctype="application/x-www-form-urlencoded">
			<table>
				<tr>
					<th>
						<input type="submit" name="action:${1}">
						<input type="submit" name="action:%{1}">
					</th>
					<td>(2.3.15.0) -> html表示</td>
					<td>(2.3.15.1) -> html表示</td>
				</tr>
				<tr>
					<th>
						<input type="submit" name="redirect:${1}">
						<input type="submit" name="redirect:%{1}">
					</th>
					<td>(2.3.15.0) -> There is no Action mapped for namespace [/] and action name [1] associated with context path [/s2-016]</td>
					<td>(2.3.15.1) -> There is no Action mapped for namespace [/] and action name [1] associated with context path [/s2-016]</td>
				</tr>
				<tr>
					<th>
						<input type="submit" name="redirectAction:${1}">
						<input type="submit" name="redirectAction:%{1}">
					</th>
					<td>(2.3.15.0) -> There is no Action mapped for namespace [/] and action name [1] associated with context path [/s2-016]</td>
					<td>(2.3.15.1) -> There is no Action mapped for namespace [/] and action name [1] associated with context path [/s2-016]</td>
				</tr>
			</table>
		</form>
		<h2>POST-Form(x-www-form-urlencoded)</h2>
		<form enctype="application/x-www-form-urlencoded" method="post">
			<table>
				<tr>
					<th>
						<input type="submit" name="action:${1}">
						<input type="submit" name="action:%{1}">
					</th>
					<td>(2.3.15.0) -> html表示</td>
					<td>(2.3.15.1) -> html表示</td>
				</tr>
				<tr>
					<th>
						<input type="submit" name="redirect:${1}">
						<input type="submit" name="redirect:%{1}">
					</th>
					<td>(2.3.15.0) -> There is no Action mapped for namespace [/] and action name [1] associated with context path [/s2-016]</td>
					<td>(2.3.15.1) -> There is no Action mapped for namespace [/] and action name [1] associated with context path [/s2-016]</td>
				</tr>
				<tr>
					<th>
						<input type="submit" name="redirectAction:${1}">
						<input type="submit" name="redirectAction:%{1}">
					</th>
					<td>(2.3.15.0) -> There is no Action mapped for namespace [/] and action name [1] associated with context path [/s2-016]</td>
					<td>(2.3.15.1) -> There is no Action mapped for namespace [/] and action name [1] associated with context path [/s2-016]</td>
				</tr>
			</table>
		</form>
	</body>
</html>

URL組み込み式がまだ実行されている?
もう少し確認

<dl>
 <dt><a href="/s2-016/${1+1}">test</a></dt>
 <dd>(2.3.15.0) -> There is no Action mapped for namespace [/] and action name [11] associated with context path [/s2-016].
 <dd>(2.3.15.1) -> There is no Action mapped for namespace [/] and action name [11] associated with context path [/s2-016].
</dl>

URLに含まれる文字列は置換されてるのか・・

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?