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"                       |
|        |          <[EMAIL PROTECTED]|
|        |          .army.mil>                 |
|        |                                     |
|        |          09/05/2002 01:12 PM        |
|        |          Please respond to "Struts  |
|        |          Users Mailing List"        |
|        |                                     |
|--------+------------------------------------->
  
>-----------------------------------------------------------------------------------------------------------|
  |                                                                                    
                       |
  |                                                                                    
                       |
  |                                                                                    
                       |
  |                                                                                    
                       |
  |                                                                                    
                       |
  |To: Struts Users Mailing List <[EMAIL PROTECTED]>                      
                       |
  |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: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
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'" <[EMAIL PROTECTED]>
                      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: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Thursday, September 05, 2002 1:19 PM
To: [EMAIL PROTECTED]
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:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>

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







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






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

Reply via email to