No the three servlets do not forward each other in the old application, now
there is a new requirement where i have to combine all the 3 servlets
functionality.  So i guess i can write helper classes as u suggested.

-----Original Message-----
From: Jim Barrows [mailto:[EMAIL PROTECTED]
Sent: Thursday, August 26, 2004 2:13 PM
To: Struts Users Mailing List
Subject: RE: can a non struts application be called from inside stuts
application.




> -----Original Message-----
> From: Shilpa Nalgonda [mailto:[EMAIL PROTECTED]
> Sent: Thursday, August 26, 2004 11:03 AM
> To: Struts Users Mailing List
> Subject: RE: can a non struts application be called from inside stuts
> application.
>
>
> O.k thats great, but i have make a 3 different servlet calls
> one by one in
> my action class.
> Like  gotoservlet1 then gotoServlet2 and then gotoServlet3,
>
> how can i achieve that in one action forward...

Not in one action forward... Are these three servlets forwarding to each
other now?  Is this a new requirement.

If this is a new requirement, I'm wondering if it might not be a better
(from and engineering point of view only) to refactor these somehow....
If you are already using these servlets as is, and now need to combine them
for a new action, you could create a helper class something like:
public class DuhHelperClass{

        public static void servlet1CommonFunctionality(blahRequest req,
blahResponse resp) {
                copy and paste appropriate code here.
        }
        public static void doTheSameThingForServlet2( blah, blah){
                blah
        }
        etc
}
Then in your servlets, call the appropriate static, and in your action class
you could call all three.
There might be a better way to re-factor the code, I would tend to doubt
this is the right way.


>
> -----Original Message-----
> From: Jim Barrows [mailto:[EMAIL PROTECTED]
> Sent: Thursday, August 26, 2004 2:01 PM
> To: Struts Users Mailing List
> Subject: RE: can a non struts application be called from inside stuts
> application.
>
>
>
>
> > -----Original Message-----
> > From: Shilpa Nalgonda [mailto:[EMAIL PROTECTED]
> > Sent: Thursday, August 26, 2004 10:53 AM
> > To: Struts Users Mailing List
> > Subject: RE: can a non struts application be called from
> inside stuts
> > application.
> >
> >
> >
> >
> > Servlets are accessed by URLs, action classes forward to
> > URLs.  So you can
> > forward to them, but call them directly akin to a method
> > call... I don't
> > think so... not without a lot of handwaving and chanting anyway.
> >
> > >> so you mean to say that i have to rewrite my old servlet
> > class into an
> > action class.
> > My old servlet class which takes httprequest and httpresponse
> > and calls do
> > post should be converted to an action class execute method
> having the
> > functionality of do post method.
>
> Not really... if your forward can be the URL /gotoMyServlet, then your
> okay... it will still work as is.  If in your code you want
> to do something
> like gotoMyServlet.doPut(blah), then your going to have to do
> some work to
> set up the environment that the servlet expects to run in.
>
>
> >
> >
> >
> > -----Original Message-----
> > From: Jim Barrows [mailto:[EMAIL PROTECTED]
> > Sent: Thursday, August 26, 2004 1:43 PM
> > To: Struts Users Mailing List
> > Subject: RE: can a non struts application be called from
> inside stuts
> > application.
> >
> >
> >
> >
> > > -----Original Message-----
> > > From: Shilpa Nalgonda [mailto:[EMAIL PROTECTED]
> > > Sent: Thursday, August 26, 2004 10:37 AM
> > > To: Struts Users Mailing List
> > > Subject: can a non struts application be called from inside stuts
> > > application.
> > >
> > >
> > > i have  a shopping cart struts application, when update
> > > button of a jsp is
> > > clicked, some action is performed and after the successful
> > > excution of that
> > > action, a servlet which takes certain parameters should be
> > > called from the
> > > action class.
> > >
> > > The servlets which i am talking about are non-struts based
> > > and are already
> > > implemented, and it would take much time to redo those using
> > > struts, so i am
> > > wondering if there is any way to reuse those and call those
> > > servlets from
> > > actions class.
> >
> > Servlets are accessed by URLs, action classes forward to
> > URLs.  So you can
> > forward to them, but call them directly akin to a method
> > call... I don't
> > think so... not without a lot of handwaving and chanting anyway.
> >
> >
> > >
> > >
> > >
> > >
> > >
> > > -----Original Message-----
> > > From: Jim Barrows [mailto:[EMAIL PROTECTED]
> > > Sent: Tuesday, August 10, 2004 4:33 PM
> > > To: Struts Users Mailing List
> > > Subject: RE: Servlet help for a Struts programmer
> > >
> > >
> > >
> > >
> > > > -----Original Message-----
> > > > From: Michael McGrady [mailto:[EMAIL PROTECTED]
> > > > Sent: Tuesday, August 10, 2004 1:22 PM
> > > > To: Struts Users Mailing List
> > > > Subject: Re: Servlet help for a Struts programmer
> > > >
> > > >
> > > > At 12:57 PM 8/10/2004, you wrote:
> > > > >Yes, Struts is based on Servlets, but you don't have to know
> > > > >anything about Servlets to make a useful Struts webapp.
> > > >
> > > > I wonder if this is true.  I cannot imagine that it could be.
> > > >  Maybe it
> > > > is.  I am beginning to think so.  ///;-)
> > >
> > > Try it yourself.... no JSP's.  No struts, and basic CRUD
> > > operations on an
> > > address book.
> > >
> > > Now today, you would probably be smart.  You would have a
> > > CRUD servlet for
> > > the "actions", that would redirect to a servlet for
> > > generating HTML.  That's
> > > 4 serlvets handling CRUD, one servlet to generate the
> > > add/edit form page,
> > > one servlet to generate the list address page.
> > >
> > > And no, you don't get to use jakarta's ECS either!!!  Nope.
> > > Not at all..
> > > you can however drool over it :)
> > >
> > > out.println( "<html>");
> > >   out.println( "<head>");
> > >           out.println( "<title>THis is the title of my
> > > page.</title>");
> > >   <out.println( "</head>");
> > >
> > > Or:
> > >
> > > out.println( "<html>"
> > >           +"<head>"
> > >           +"  <title>This is the title of my page.</title>");
> > >           +"</head>");
> > >
> > >
> > >
> >
> ---------------------------------------------------------------------
> > > 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]
> > >
> > >
> >
> >
> ---------------------------------------------------------------------
> > 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]
> >
> >
>
> ---------------------------------------------------------------------
> 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]
>
>

---------------------------------------------------------------------
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