struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Lydia P <>
Subject Struts Actions and redirected URL's
Date Wed, 18 Jun 2003 17:14:49 GMT
Any suggestions will be greatly appreciated!

I have a search Action that returns a list of objects in tablular format 
from a query to one database table.
An object can be selected via a radio button, and deleted via a "Delete" 

The delete Action checks to see if this object exists in another 
database table.  If the object exists in other tables, I do not want the 
object deleted from the main table.  The logic for delete works fine, 
however, I want to let the user know WHY the object isnt being deleted, 
I am already using errors.add in other places, but can not use it here 
because of a different way of forwarding.
The results list table from the search has a URL that looks like :
 If I use :
    return (mapping.findForward("success"));
Then an application resource message can be returned , but the URL for 
the original page is lost and it shows:

To resolve the URL problem, here is the URL code snippet with its 
corresponding actionForward:
String base64ReturnUrl= form.getReturnUrl();
            String returnUrl = null;
            if (base64ReturnUrl!=null){
                //get rid of the "/activate" from the url since the 
ActionForward will tack
                //that on as a result of the contextRelative == true setting
                int startIndex = returnUrl.indexOf("/",1);
            ActionForward forward = new 
ActionForward("dynDelRedirect",returnUrl, true, true);
            return forward;

Action mapping for this action in struts-config.xml:
        <action path="/delete" 
name="inventoryFormEdit" scope="request" validate="false" 
            <exception key="errors.unknownExceptionMsg" 
            <forward name="success" path="" 

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message