LoginSignup
1
0

More than 5 years have passed since last update.

<html:form>でアクションフォームBeanが取得できずJSPでエラーが発生

Posted at

Form bean not specified on mapping for actionというエラーで、JSPページが表示されなくて詰まってしまいました。

これはstruts-config.xmlでaction要素でform-beanが結びついていない場合に起きるエラーです。actionのname属性とform-beanのnameが違っているとマッピングに問題が起きます。しかし、今回はここが原因でありませんでした。原因はactionのtype属性が指定されていないことでした。

<!-- struts-config.xml -->
<action-mappings>
        <action path="/TestAction" name="TestActionForm" type="TestAction" scope="request">
            <forward name="success" path="/pages/Welcome.jsp">
        </forward></action>
<action-mappings>

リクエストパス(~.do)に対し、まずアクションフォームBeanがセットされてから、アクションクラスが実行されます。このリクエストパスで実行されるアクションクラスが指定していないため、form-beanとのマッピングが上手くいってなかったようです。

1
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
1
0