Using an ActionForward from within a custom tag in Struts 1.1

  • Thread starter Brian J. Sayatovic
  • Start date
B

Brian J. Sayatovic

I've got custom tag where, under certain conditions, I'd like to
forward the request to a forward defined in the struts config. Under
Struts 1.0, I saw an example where one could get at the necessary
information through objects stored under the request attributes using
the keys defined under the Action class.

However, in Struts 1.1, all of these things are deprecated. So,
what's the new way to get at this information?

Or does someone have a better design?

Regards,
Brian.
 
B

Brian J. Sayatovic

OK, I figured it out. It is stored as a request attribute under the
key defined by the constant Globals.MAPPING_KEY. This is actually
pretty much the same place it was in Struts 1.0, but when I tried this
in Struts 1.1, it didn't work at first.

Turns out, somehow during my late-night coding session, I overlooked
the fact that I was trying to get the value out of the ServletContext
attributes instead of the request attributes.

So, now, my custom tag can pull a forward out of the mappings to
forward to in certain conditions.

Regards,
Brian.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,436
Messages
2,571,696
Members
48,796
Latest member
Greg L.
Top