paulsp      2002/11/23 01:48:09

  Modified:    src/java/org/apache/jetspeed/util/template
                        BaseJetspeedLink.java
  Log:
  o Remove path elements before adding them to the URL, i.e. we
     do not want media-type to exist twice on the URL.
  
  Revision  Changes    Path
  1.19      +6 -11     
jakarta-jetspeed/src/java/org/apache/jetspeed/util/template/BaseJetspeedLink.java
  
  Index: BaseJetspeedLink.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/util/template/BaseJetspeedLink.java,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- BaseJetspeedLink.java     20 Nov 2002 17:01:46 -0000      1.18
  +++ BaseJetspeedLink.java     23 Nov 2002 09:48:09 -0000      1.19
  @@ -662,46 +662,41 @@
               // Set Template in path
               if (templateName != null)
               {
  +                uri.removePathInfo( JetspeedResources.PATH_TEMPLATE_KEY);
                   if (templateName.length() > 0)
                       uri.addPathInfo( JetspeedResources.PATH_TEMPLATE_KEY, 
templateName);
  -                else
  -                    uri.removePathInfo( JetspeedResources.PATH_TEMPLATE_KEY);
               }
   
               // Set Action in path
               if (actionName != null)
               {
  +                uri.removeQueryData( JetspeedResources.PATH_ACTION_KEY);
                   if (actionName.length() > 0)
                       uri.addQueryData( JetspeedResources.PATH_ACTION_KEY, 
actionName);
  -                else
  -                    uri.removeQueryData( JetspeedResources.PATH_ACTION_KEY);
               }
   
               // Set MediaType in path
               if (mediaType != null)
               {
  +                uri.removePathInfo( Profiler.PARAM_MEDIA_TYPE);
                   if (mediaType.length() > 0)
                       uri.addPathInfo( Profiler.PARAM_MEDIA_TYPE, mediaType);
  -                else
  -                    uri.removePathInfo( Profiler.PARAM_MEDIA_TYPE);
               }
   
               // Set Language in path
               if (language != null)
               {
  +                uri.removePathInfo( Profiler.PARAM_LANGUAGE);
                   if (language.length() > 0)
                       uri.addPathInfo( Profiler.PARAM_LANGUAGE, language);
  -                else
  -                    uri.removePathInfo( Profiler.PARAM_LANGUAGE);
               }
   
               // Set Country in path
               if (country != null)
               {
  +                uri.removePathInfo( Profiler.PARAM_COUNTRY);
                   if (country.length() > 0)
                       uri.addPathInfo( Profiler.PARAM_COUNTRY, country);
  -                else
  -                    uri.removePathInfo( Profiler.PARAM_COUNTRY);
               }
   
               return uri;
  
  
  

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

Reply via email to