• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Generating actions for submit buttons based on button

 
Bartender
Posts: 1971
17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
We have a Struts JSP where there are multiple submit buttons on it. We want to have a new browser window (tab) open for one of the submit buttons on this form, but not for the other submit buttons (the other buttons should display response in the same window).

I've written a JavaScript function that does this using onClick events for the buttons to call functions that individually set the target variable of the document object. Works great.

I also found another way by using JavaScript's window.open.

So, my question is what's the best way to modify this JSP so I do this within the Struts environment?

I tried to add this information in to the forward definition (target="_blank") in Struts-config.xml, but that didn't work.

Perhaps the JavaScript solution works fine in Struts?

I look forward to any and all replies!!!

Thanks.

M
 
author & internet detective
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Mike,
What is wrong with using the JavaScript approach?
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The JavaScript approach will work just fine in a Struts application. If it works, why change it?
 
Mike London
Bartender
Posts: 1971
17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
OK, thanks.

I just got some feedback from our architect that I needed to do this the "Struts way". I wasn't sure what he meant either so I thought I'd post a message a "sanity check".

Thanks to all for your replies....MUCH APPRECIATED!!!



M
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic