struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Manish-Hirapara <MHirap...@OfficeDepot.com>
Subject RE: *.do ---- Proof of Concepts
Date Fri, 19 Apr 2002 18:55:18 GMT
Struts has a class org.apache.struts.actions.ForwardAction that will
probably fill your need.

In your web.xml, you can leave the default *.do configuration as is.
In your struts-config.xml, add the following action (in the actionmappings
section), and replace the 'parameter' with the jsp file you want to forward
to (and the /test with whatever you would like to call your action): 

  <action-mappings>
    <action    path="/test"
               type="org.apache.struts.actions.ForwardAction"
               name="whateveryouwanttocallit"
               parameter="/index.jsp">
    </action>
  </action-mappings>

Restart, and now if you issue a /test.do you will be redirected to your jsp
page (through the controller). This way, you don't have to create an action
class, but you still can use the controller.

See the javadoc on the ForwardAction class for more.

-Manish 


-----Original Message-----
From: K J [mailto:tony_dinapoli@yahoo.com]
Sent: Friday, April 19, 2002 2:04 PM
To: Struts Users Mailing List
Subject: *.do ---- Proof of Concepts


Say I have a web application which contains 1 JSP and
I wanted to use Struts. I don't have any action
classes, but I want to use the controler servelt and
the taglib. Will the *.do work only when you have
action classes? What would this entry look like if I
only want the Controler servelt to forward to a
JSP(without any action classes)?

can you tell me what needs to go where(i.e. web.xml
vs. struts-config.xml). what should go in the global
forward path, and the servelet-mapping section?


Thanks.

=====


__________________________________________________
Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax
http://taxes.yahoo.com/

--
To unsubscribe, e-mail:
<mailto:struts-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail:
<mailto:struts-user-help@jakarta.apache.org>

--
To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@jakarta.apache.org>


Mime
View raw message