This week's book giveaway is in the Cloud/Virtualizaton forum.
We're giving away four copies of Mesos in Action and have Roger Ignazio on-line!
See this thread for details.
Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to get a new instance of a form bean?

 
Bruno Frascino
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Can I get a new instance of a form bean in my action, i mean, another one, or various?
I don't know... something like this:
DynaActionForm anotherForm = (ActionForm)FormBean.getInstance();

How to get it?
Thanks, sorry about my english...
 
Jason Menard
Sheriff
Posts: 6450
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"BJack",
Welcome to JavaRanch. We don't have too many rules here, but one thing we do have is a naming policy. Please edit your display name to comply with this policy. Thanks in advance, and we look forward to seeing you around the Ranch.
 
Bruno Frascino
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Anyone to help me?!
 
Jason Menard
Sheriff
Posts: 6450
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Let's assume you've defined the following form and action in your struts-config.xml:

The following code in your Action class should give you an idea how to do what you want.

HTH
[ January 05, 2004: Message edited by: Jason Menard ]
 
Bruno Frascino
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Jason!
 
Bruno Frascino
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

ModuleConfig moduleConfig = RequestUtils.getModuleConfig(request, getServlet().getServletContext());

That ModuleConfig class is from which package?
Is it an interface?!

I can't import that... what I'm forgetting to do?
 
Jason Menard
Sheriff
Posts: 6450
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
http://jakarta.apache.org/struts/api/index.html
org.apache.struts.config.ModuleConfig is an interface. It was introduced in Struts 1.1.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic