开发者

How to pass form parameters to Action class when opening a jsp in a new window through Javascript

Below is the Javascript function call in which I am calling a struts action which in turn resolves to a jsp .In the Jsp page which is opened in a separate w开发者_如何学Pythonindow I have a form with a few text boxes and drop down and a submit button.When I submit the filled form I am unable to get all these form fields although those instance variables are defined in the action class.Is there something that i am missing here????

function editQuestions(val) {
    window.open("fetchQuestionAction.action?"+
        "quesId="+val,'mywindow','width=400,height=200');
}


For get the data in the new window you can:

  1. POST the data to the Different action that will put it to the session. Then open the window. The POST action should be done via AJAX to not reload the page unneccessary.
  2. Add the data from the Form fields to the query string for the URI for the window.open first parameter. Then you could use this data on the server to render the new page or just send it in hidden fields and use on the client.


Can you read the data from the form fields and append them as request params to the URL. This way the params should be available on the opened window.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜