• 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

Struts 2 result in New Window

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi

I want to open a JSP in a new window based on the result from action class.

on submitting a form, some processing is done in action class and dao and based on the result a new window should open if result is positive(true) else it displays a error message in the same form page.

Is there any way in struts.xml by which I can open a new window based on a particular result ?
 
Ranch Hand
Posts: 281
Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
struts.xml ummm... I doubt... you can do it from action class or any other servlet...

well, what do you want exactly... a new window altogether or a pop-up and if you want a new window do you want a child window ? and do you want to disable the parent first ?

anyways.. the conditions can be handled using <s:if> tag.

 
Sameer Ahmed
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I want to open a child window if a method in action class returns a string "true".
if it returns "false" then it should not open a new window and it should print the error on the parent window.
Nothing should happen to the parent window(only child window should open) after clicking the submit button if the return string is "true".

 
Robin John
Ranch Hand
Posts: 281
Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
you can get the concept at this Link

Just replace the button logic with your <s:if> and <s:else> tags...

I dont know if you have any struts 2 tags for doing this.. libraries / javascript seems to be the solution..
 
It would give a normal human mental abilities to rival mine. To think it is just a tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic