aspose file tools*
The moose likes Struts and the fly likes Getting the extended ActionMapping class from my extended ActionServlet class Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Getting the extended ActionMapping class from my extended ActionServlet class" Watch "Getting the extended ActionMapping class from my extended ActionServlet class" New topic
Author

Getting the extended ActionMapping class from my extended ActionServlet class

Janis Lee
Greenhorn

Joined: Dec 22, 2005
Posts: 27
I was going through the example in http://www.javaworld.com/javaworld/jw-05-2002/jw-0510-struts.html
to redirect an http request to an https request. This requires that a new ActionMapping class is created with a new field "secure". In the Action Servlet class it is checked whether the secure has a value of true or false. If true, the page is redirected to the corresponding https request.
The source code attached with the article seems faulty . I am unable to compile it.

It requires that I get the Action Mapping class within the servlet.
How is this possible?
I tried this
this.processor.processMapping(request, response, path); but it didnt work because processMappnig is a protected method of RequestProcessor :-(
What can I do?
Janis Lee
Greenhorn

Joined: Dec 22, 2005
Posts: 27
This is what I can do :-)
ModuleConfig config = getModuleConfig(request);
MyActionMapping mapping = (MyActionMapping)config.findActionConfig(path);
 
wood burning stoves
 
subject: Getting the extended ActionMapping class from my extended ActionServlet class