URL Binding with multiple URLs

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

URL Binding with multiple URLs

Adam Stokar
Hi all,

It doesn't seem like it's possible to assign two URL's to the same action bean.  Does anyone have an easy workaround for this?  I'm trying to do something like:

@UrlBinding({"/locations","/Locations"})

Thanks,

Adam


------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users
Reply | Threaded
Open this post in threaded view
|

Re: URL Binding with multiple URLs

Ben Gunter
A workaround is to subclass the ActionBean in question and put a different @UrlBinding on the subclass.

-Ben


On Wed, Jul 24, 2013 at 9:59 AM, Adam Stokar <[hidden email]> wrote:
Hi all,

It doesn't seem like it's possible to assign two URL's to the same action bean.  Does anyone have an easy workaround for this?  I'm trying to do something like:

@UrlBinding({"/locations","/Locations"})

Thanks,

Adam


------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users



------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users
Reply | Threaded
Open this post in threaded view
|

Re: URL Binding with multiple URLs

Adam Stokar
That's not a very scalable solution.  I have over 60 ActionBean classes that would each need a subclass.  I think this is a reasonable request to add to the library.


On Wed, Jul 24, 2013 at 10:54 AM, Ben Gunter <[hidden email]> wrote:
A workaround is to subclass the ActionBean in question and put a different @UrlBinding on the subclass.

-Ben


On Wed, Jul 24, 2013 at 9:59 AM, Adam Stokar <[hidden email]> wrote:
Hi all,

It doesn't seem like it's possible to assign two URL's to the same action bean.  Does anyone have an easy workaround for this?  I'm trying to do something like:

@UrlBinding({"/locations","/Locations"})

Thanks,

Adam


------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users



------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users



------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users
Reply | Threaded
Open this post in threaded view
|

Re: URL Binding with multiple URLs

Grzegorz Krugły
My usual solution is to implement a kind of mod_rewrite filter. It has
an advantage of not only allowing to direct multiple URLs into a single
place, but also to do a lot of URL customization.

Basically, something like this:

public class UrlRewritingFilter implements Filter {
     private FilterConfig filterConfig;

     @Override
     public void init(FilterConfig filterConfig) throws ServletException {
         this.filterConfig = filterConfig;
     }

     @Override
     public void doFilter(ServletRequest request, ServletResponse
response, FilterChain chain) throws IOException, ServletException {
         HttpServletRequest req = (HttpServletRequest) request;

         String rewrittenUrl =
mapUrlToACanonicalOne(req.getRequestURI()); // mapUrlToACanonicalOne
returns e.g. "/location" for "/location", "/Location", "/miejsce", etc.

         if (rewrittenUrl == null) {
             chain.doFilter(request, response);
         } else {
filterConfig.getServletContext().getRequestDispatcher(rewrittenUrl).forward(request,
response);
             return;
         }
     }

     @Override
     public void destroy() {
         this.filterConfig = null;
     }
}

I configure it like this in web.xml:

     <filter>
         <filter-name>UrlRewritingFilter</filter-name>
<filter-class>package.UrlRewritingFilter</filter-class>
     </filter>
     <filter-mapping>
         <filter-name>UrlRewritingFilter</filter-name>
         <url-pattern>/*</url-pattern>
     </filter-mapping>


------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users
Reply | Threaded
Open this post in threaded view
|

Re: URL Binding with multiple URLs

Ben Gunter
In reply to this post by Adam Stokar
It would seem you are not alone.



On Wed, Jul 24, 2013 at 11:18 AM, Adam Stokar <[hidden email]> wrote:
That's not a very scalable solution.  I have over 60 ActionBean classes that would each need a subclass.  I think this is a reasonable request to add to the library.


On Wed, Jul 24, 2013 at 10:54 AM, Ben Gunter <[hidden email]> wrote:
A workaround is to subclass the ActionBean in question and put a different @UrlBinding on the subclass.

-Ben


On Wed, Jul 24, 2013 at 9:59 AM, Adam Stokar <[hidden email]> wrote:
Hi all,

It doesn't seem like it's possible to assign two URL's to the same action bean.  Does anyone have an easy workaround for this?  I'm trying to do something like:

@UrlBinding({"/locations","/Locations"})

Thanks,

Adam


------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users



------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users



------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users



------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users
Reply | Threaded
Open this post in threaded view
|

Re: URL Binding with multiple URLs

Nikolaos Giannopoulos
In reply to this post by Adam Stokar
Adam,

If you need to handle multiple URI's I would look at UrlRewriterFilter.

Once upon a time I too felt that Stripes should offer such a capability (in our case it was multilingual support) and subclassing was not scalable (as you point out as well) BUT after having built out the UrlRewriterFilter integration I have to say I am glad I used it.

--Nikolaos



On 2013-07-24, at 11:18 AM, Adam Stokar <[hidden email]> wrote:

That's not a very scalable solution.  I have over 60 ActionBean classes that would each need a subclass.  I think this is a reasonable request to add to the library.


On Wed, Jul 24, 2013 at 10:54 AM, Ben Gunter <[hidden email]> wrote:
A workaround is to subclass the ActionBean in question and put a different @UrlBinding on the subclass.

-Ben


On Wed, Jul 24, 2013 at 9:59 AM, Adam Stokar <[hidden email]> wrote:
Hi all,

It doesn't seem like it's possible to assign two URL's to the same action bean.  Does anyone have an easy workaround for this?  I'm trying to do something like:

@UrlBinding({"/locations","/Locations"})

Thanks,

Adam


------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users



------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users


------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users

------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users
Reply | Threaded
Open this post in threaded view
|

Re: URL Binding with multiple URLs

Joaquin Valdez-2
In reply to this post by Ben Gunter
This would be great!

Joaquin 

On Jul 24, 2013, at 9:19 AM, Ben Gunter <[hidden email]> wrote:

It would seem you are not alone.



On Wed, Jul 24, 2013 at 11:18 AM, Adam Stokar <[hidden email]> wrote:
That's not a very scalable solution.  I have over 60 ActionBean classes that would each need a subclass.  I think this is a reasonable request to add to the library.


On Wed, Jul 24, 2013 at 10:54 AM, Ben Gunter <[hidden email]> wrote:
A workaround is to subclass the ActionBean in question and put a different @UrlBinding on the subclass.

-Ben


On Wed, Jul 24, 2013 at 9:59 AM, Adam Stokar <[hidden email]> wrote:
Hi all,

It doesn't seem like it's possible to assign two URL's to the same action bean.  Does anyone have an easy workaround for this?  I'm trying to do something like:

@UrlBinding({"/locations","/Locations"})

Thanks,

Adam


------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users



------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users



------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users


------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users

------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users
Reply | Threaded
Open this post in threaded view
|

Re: URL Binding with multiple URLs

Ben Gunter
The reason it hasn't been done is it's not as simple as it seems at first. Mapping the URL to the ActionBean would be easy enough. The problem would be building a link to an ActionBean with the stripes:link tag. That tag knows how to read the @UrlBinding and produce a clean URL with the parameters from stripes:param tags. If there are multiple @UrlBindings associated with an ActionBean, it wouldn't know which one to use to build the URL.

On Wed, Jul 24, 2013 at 12:35 PM, Joaquin Valdez <[hidden email]> wrote:
This would be great!

Joaquin 

On Jul 24, 2013, at 9:19 AM, Ben Gunter <[hidden email]> wrote:

It would seem you are not alone.



On Wed, Jul 24, 2013 at 11:18 AM, Adam Stokar <[hidden email]> wrote:
That's not a very scalable solution.  I have over 60 ActionBean classes that would each need a subclass.  I think this is a reasonable request to add to the library.


On Wed, Jul 24, 2013 at 10:54 AM, Ben Gunter <[hidden email]> wrote:
A workaround is to subclass the ActionBean in question and put a different @UrlBinding on the subclass.

-Ben


On Wed, Jul 24, 2013 at 9:59 AM, Adam Stokar <[hidden email]> wrote:
Hi all,

It doesn't seem like it's possible to assign two URL's to the same action bean.  Does anyone have an easy workaround for this?  I'm trying to do something like:

@UrlBinding({"/locations","/Locations"})

Thanks,

Adam


------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users



------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users



------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users


------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users

------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users



------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users
Reply | Threaded
Open this post in threaded view
|

Re: URL Binding with multiple URLs

Adam Stokar
In reply to this post by Nikolaos Giannopoulos
Thank guys.  UrlRewriteFilter looks like the way to go.  Appreciate the feedback.


On Wed, Jul 24, 2013 at 12:31 PM, Nikolaos Giannopoulos <[hidden email]> wrote:
Adam,

If you need to handle multiple URI's I would look at UrlRewriterFilter.

Once upon a time I too felt that Stripes should offer such a capability (in our case it was multilingual support) and subclassing was not scalable (as you point out as well) BUT after having built out the UrlRewriterFilter integration I have to say I am glad I used it.

--Nikolaos



On 2013-07-24, at 11:18 AM, Adam Stokar <[hidden email]> wrote:

That's not a very scalable solution.  I have over 60 ActionBean classes that would each need a subclass.  I think this is a reasonable request to add to the library.


On Wed, Jul 24, 2013 at 10:54 AM, Ben Gunter <[hidden email]> wrote:
A workaround is to subclass the ActionBean in question and put a different @UrlBinding on the subclass.

-Ben


On Wed, Jul 24, 2013 at 9:59 AM, Adam Stokar <[hidden email]> wrote:
Hi all,

It doesn't seem like it's possible to assign two URL's to the same action bean.  Does anyone have an easy workaround for this?  I'm trying to do something like:

@UrlBinding({"/locations","/Locations"})

Thanks,

Adam


------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users



------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users


------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users

------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users



------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users