Hi 
I am pradeep Jain . Currently I am using  Struts 1.2.X . But I am facing 
some problems. 

1.I am trying to create my own action mapping but  in Action class when 
ever I am  try to use that  it is giving me class cast exception . 
following is my  web.xml 

<servlet>
        <servlet-name>action</servlet-name>
 <servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
        <init-param>
                <param-name>debug</param-name>
                <param-value>5</param-value>
        </init-param>
        <init-param>( this is custome action mapping class) 
                <param-name>mapping</param-name>
 <param-value>com.wiley.EmployeesActionMapping</param-value>
        </init-param>
        <init-param>
                <param-name>config</param-name>
                <param-value>/WEB-INF/struts-config.xml</param-value>
        </init-param>
 
        <load-on-startup>1</load-on-startup>
</servlet>


But when in my action class ... 
public ActionForward execute(ActionMapping mapping,ActionForm 
form,HttpServletRequest request,HttpServletResponse response)
                                throws IOException, ServletException {
        ActionMapping mapping1 = mapping;
        System.out.println("***********mapping 
.getclass"+mapping.getClass());
        EmployeesActionMapping employeesMapping 
=(EmployeesActionMapping)mapping;( Here I am getting   class cast 
exception ) 

...........

}


Please help in in resloving this .. 

Thanks & regards
Pradeep Jain 






Don Brown <[EMAIL PROTECTED]> 
11/10/2004 12:55 PM
Please respond to
"Struts Users Mailing List" <[EMAIL PROTECTED]>


To
Struts Users Mailing List <[EMAIL PROTECTED]>
cc

Subject
Re: Struts-Chain Roadmap and Inevitable Cocoon Analogy






Well, you could do that with chain now by writing an action that
deferred handling to a particular chain, but I do like the sitemap
concept as evidenced by my porting of their wildcard matching to
Struts.

It might be interesting for an alternate struts-config format that
does allow us to stick chain commands right in struts-config rather
than having them defined somewhere else and have it look kinda like
ant:

<action-mapping path="edit*">
  <authorize type="{1}" />
  <retrieveFormData type="{1}" />
  <generateJsp path="/jsp/{1}.jsp" forward="success" />
</action-mapping>

Personally, however, I prefer something like struts-flow which allows
workflows to be defined in a more powerful scripting language.  These
XML mappings work great for simple cases, but don't really for the
more complex workflows you'd find in a real application.  I think that
was one of the main reasons why Struts developers insist on one Action
per request as Java is a much more capable workflow language than XML.

Don


On Wed, 10 Nov 2004 19:25:57 +0200, Emmanouil Batsis
<[EMAIL PROTECTED]> wrote:
> Don Brown wrote:
> 
> >Well, pipelines won't work for Struts in the strictest sense, as they
> >rely on SAX and Struts isn't an XML transformation framework.
> >
> >
> 
> Struts could use a sitemap thingy to pass a request along actions
> (without having the action choose an ActionForward). I guess that could
> work by consulting the sitemap object like
> mapping.findForward(sitemap.getForward(request));
> 
> Manos
> 
> ---------------------------------------------------------------------
> 
> 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Reply via email to