• 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

Starting server side action without any follwing forward

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

I'm using Struts. What I'm trying to do is to send information into a bean from a formulare inside a jsp and launch a server side treatment.
To do that, I have created a formulare in a JSP linked with the struts-config.xml a bean and an java action. Every thing perform as my wishes except that I must define a forward and I don't want to. I don't want any refresh or forward in my view, I just want to launch a server side treatment over sent data.

What should I do? How should I set my action in struts-config.xml and in the java action file?

Please forgive my english,
Thanks for all in advance!
 
Sheriff
Posts: 6450
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"smurf smurf",

Welcome to JavaRanch. We don't have many rules here, but we do have a naming policy which we try to strictly enforce. Please re-read this document and edit your display name in order to comply. Thanks in advance, and we look forward to seeing you around the Ranch.

-Moderator Smurf
 
Guillaume Jud
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Done
 
Jason Menard
Sheriff
Posts: 6450
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Your Action has to forward somewhere. Why not just send it back to the same view your submitting from? If you really don't want that screen to refresh or change, I suppose you could use the target attribute of <html:form> to specify a new HTML window (you can control the size through javascript), your Action will forward to that new window. Have the forward point to a JSP containing javascript to close the window.
 
pie sneak
Posts: 4727
Mac VI Editor Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I had to look up what formulare meant. It's French for "application form", no?

Usually, your forward is defined in your Action class. The Action class is part of the Controller, not the View, so this is fine.

In the simplest of cases, the Action will always return "success" as a forward
return mapping.findForward("success");
and it will refer to a forward defined in struts-config. The forward is typically a way for the Controller(which Action is a part of) to decide which View(which is often a jsp or tile) to go to next.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic