struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tim T. Young" <Young_Ti...@cat.com>
Subject RE: Call action from JSP
Date Thu, 05 Sep 2002 18:24:55 GMT

I see nothing wrong with what you are doing.  You don't even need the name
="" in the xml.   You might want to look at <html:link> in case you need to
do anything more with maintaining session, etc.

Tim



|--------+------------------------------------->
|        |          "Piper, James D CECOM SEC  |
|        |          EPS"                       |
|        |          <James.Piper@mail1.monmouth|
|        |          .army.mil>                 |
|        |                                     |
|        |          09/05/2002 01:12 PM        |
|        |          Please respond to "Struts  |
|        |          Users Mailing List"        |
|        |                                     |
|--------+------------------------------------->
  >-----------------------------------------------------------------------------------------------------------|
  |                                                                                      
                    |
  |                                                                                      
                    |
  |                                                                                      
                    |
  |                                                                                      
                    |
  |                                                                                      
                    |
  |To: Struts Users Mailing List <struts-user@jakarta.apache.org>                  
                          |
  |cc:                                                                                   
                    |
  |                                                                                      
                    |
  |                                                                                      
                    |
  |                                                                                      
                    |
  |       Subject:     RE: Call action from JSP                                          
                    |
  >-----------------------------------------------------------------------------------------------------------|



Caterpillar: Confidential Green          Retain Until: 10/05/2002
                                         Retention Category:  G90 -
                                         Information and Reports





I am new to struts and I don't know if this is of any use or if it is even
right, but when I wanted to call an Action when the user clicked a link I
used something like (no forms involved):

<p>Build Database: <a href="1-5-1_BuildDatabaseAction.do">Button</a></p>

and in my struts-config.xml had something like:

 <action
         path="/1-5-1_BuildDatabaseAction"
         type="com.myapp.view.DBAdminClient"
         name=""
         input="/1-5_SAMainPage.jsp">
                <forward name="db_create_success"    path="/success.html"/>
                <forward name="db_create_failed"     path="/fail.html"/>
 </action>

I left name="" because I wasn't doing anything with a form, just responding
to a user clicking on a link.  I welcome comments letting me know if this
is
the right way to be doing this or (rather more likely) that I am clueless
and that there is some other struts mechanism I should be using to handle
getting access to the action mappings when no forms are involved.

Thanks,

- Jim



-----Original Message-----
From: jwang13@mmm.com [mailto:jwang13@mmm.com]
Sent: Thursday, September 05, 2002 1:40 PM
To: Struts Users Mailing List
Subject: RE: Call action from JSP



I don't use form because I don't need to submit any data. The action will
perform some logic against query string in request and data in session, and
forward wither to a success page or a failure page.

I could put this logic directly in JSP rather than in an action, but I
don't want so many Java code in JSP.





                      "Galbreath, Mark"

                      <Galbreath@tessco.       To:       "'Struts Users
Mailing List'" <struts-user@jakarta.apache.org>
                      com>                     cc:

                                               Subject:  RE: Call action
from JSP
                      09/05/2002 12:27

                      PM

                      Please respond to

                      "Struts Users

                      Mailing List"








Why would you want to call an Action class directly from a JSP (outside a
form:action block)?

-----Original Message-----
From: jwang13@mmm.com [mailto:jwang13@mmm.com]
Sent: Thursday, September 05, 2002 1:19 PM
To: struts-user@jakarta.apache.org
Subject: Call action from JSP


Could someone help me on this code:

In *.jsp:

<%
      if (condition satisfied) {
            // how to fill this line to call an action, say invoke.do?
      }
%>

Thanks.


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







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