So I was wondering if I could open a new window in struts
I didn't want to code my javascript anymore since I used struts. I find them so untidy when I mix it up with my jsp(html and struts tags). Do you guys have any elegant solution with this?
There are only 2 ways I know of to open a new window from a page:
1- Specify a target="" attribute on either a link or a form. This will open up a new window as long as the target name is different from the target name used when the current page was displayed. The disadvantage of this method is that you have no control over the size or position of the new window.
2- Use the javaScript window.open() method. With this method, you do have control over the size and position of the window, as well as other features, such as whether it is resizable. You can call a struts action from this command also, as in: window.open("/myAction.do"):