struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jwan...@mmm.com
Subject RE: Call action from JSP
Date Thu, 05 Sep 2002 17:58:42 GMT

The JSP is an index.jsp and condition has to be check there.

If I use response.sendRedirect(URL) in the JSP scriplet, it seems that a
new request is created during redirect. Is there a simple way to keep the
previous request rather than create a new one?



                                                                                         
                                             
                      "Joe Barefoot"                                                     
                                             
                      <Joe.Barefoot@moti       To:       "Struts Users Mailing List" <struts-user@jakarta.apache.org>
                 
                      va.com>                  cc:                                    
                                                
                                               Subject:  RE: Call action from JSP        
                                             
                      09/05/2002 12:42                                                   
                                             
                      PM                                                                 
                                             
                      Please respond to                                                  
                                             
                      "Struts Users                                                      
                                             
                      Mailing List"                                                      
                                             
                                                                                         
                                             
                                                                                         
                                             



hmmm...why not check your condition and perform this logic in an action
before you even forward to the JSP in the first place?

b.t.w., you can always issue a response.sendRedirect( URL ) in the JSP
scriplet, and give it the URL-mapping for the action you wish to redirect
to.  I don't think that doing this is a great idea, however. :)


peace,
Joe

> -----Original Message-----
> From: jwang13@mmm.com [mailto:jwang13@mmm.com]
> Sent: Thursday, September 05, 2002 10:40 AM
> 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>







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