This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Starting server side action without any follwing forward

 
Guillaume Jud
Greenhorn
Posts: 2
  • 0
  • Mark post as helpful
  • send pies
  • 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!
 
Jason Menard
Sheriff
Posts: 6450
  • 0
  • Mark post as helpful
  • send pies
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Done
 
Jason Menard
Sheriff
Posts: 6450
  • 0
  • Mark post as helpful
  • send pies
  • 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.
 
Marc Peabody
pie sneak
Sheriff
Posts: 4727
Mac Ruby VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • 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.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic