×

Loading...
Ad by
  • 最优利率和cashback可以申请特批,好信用好收入offer更好。请点链接扫码加微信咨询,Scotiabank -- Nick Zhang 6478812600。
Ad by
  • 最优利率和cashback可以申请特批,好信用好收入offer更好。请点链接扫码加微信咨询,Scotiabank -- Nick Zhang 6478812600。

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.