×

Loading...
Ad by
  • 推荐 OXIO 加拿大高速网络,最低月费仅$40. 使用推荐码 RCR37MB 可获得一个月的免费服务
Ad by
  • 推荐 OXIO 加拿大高速网络,最低月费仅$40. 使用推荐码 RCR37MB 可获得一个月的免费服务

A question about using jsp:setProperty and View Controller

Since there are lots of input fields in my JSPs, jsp:setProperty will be a easy way to send the input data to the JavaBean which is for storing data. Meanwhile, a controller is good for handling the JSPs. However, I don't know how to use both of them at the same time because of the conflict in setting the action in the HTML form. The action seems set to the JSP itself when using setProperty, and set to the controller when using MVC. Is it right? Is there any good ways to using them together?

Thanks.

J2EE beginner
Report

Replies, comments and Discussions:

  • 工作学习 / IT技术讨论 / A question about using jsp:setProperty and View Controller
    Since there are lots of input fields in my JSPs, jsp:setProperty will be a easy way to send the input data to the JavaBean which is for storing data. Meanwhile, a controller is good for handling the JSPs. However, I don't know how to use both of them at the same time because of the conflict in setting the action in the HTML form. The action seems set to the JSP itself when using setProperty, and set to the controller when using MVC. Is it right? Is there any good ways to using them together?

    Thanks.

    J2EE beginner
    • Can anyone help?
      • go to javaranch.com and u will find tons of gurus hanging around there
      • inside
        1.you can create action.jsp, and write < form action = "action.jsp">, then in action.jsp, use jsp:setProperty to pass parameters to JavaBean
        2.use <% if ... to check the parameter to do different work in the same page
        check java.sun.com to find the examples.