Action with an epub resolution

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

Action with an epub resolution

Heather and Jon Turgeon
Hello all, I have a web app that generates an epub from information stored in a database. I have an action that creates the book and then sends it back to the client as an epub. This works great in Windows/Linux and Android but is less than great on my iPad. Since the link on the page that calls the epub code ends in .action the iPad does not know which app to use to open the book. Is there some way in Struts to call an action using a link that ends with .epub? Something like www.somewebsite.com/newbook.epub that would call a Stripes action which could then pass back a book named differentBookName.ebub (my site can create multiple books depending on user content).

Jon

------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users
Reply | Threaded
Open this post in threaded view
|

Re: Action with an epub resolution

Joaquin Valdez-2
From Freddy’s book:   

In web.xml

<servlet-mapping> <servlet-name>DispatcherServlet</servlet-name> <url-pattern>*.abc</url-pattern>

</servlet-mapping>

and override the getBindingSuffix( ) method of NameBasedActionResolver: 

Create this class: /src/yourname/ext/MyActionResolver.java

package yourpackage.ext;
public class MyActionResolver extends NameBasedActionResolver {

@Override
protected String getBindingSuffix() {

return ".abc"; }

}

Joaquin Valdez
[hidden email]
1.541.702.1281

On May 5, 2015, at 6:51 AM, Heather and Jon Turgeon <[hidden email]> wrote:

Hello all, I have a web app that generates an epub from information stored in a database. I have an action that creates the book and then sends it back to the client as an epub. This works great in Windows/Linux and Android but is less than great on my iPad. Since the link on the page that calls the epub code ends in .action the iPad does not know which app to use to open the book. Is there some way in Struts to call an action using a link that ends with .epub? Something like <a href="x-msg://34/www.somewebsite.com/newbook.epub" target="_blank" class="">www.somewebsite.com/newbook.epub that would call a Stripes action which could then pass back a book named differentBookName.ebub (my site can create multiple books depending on user content).

Jon
------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud 
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users


------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users
Reply | Threaded
Open this post in threaded view
|

Re: Action with an epub resolution

Poitras Christian
In reply to this post by Heather and Jon Turgeon

Hi,

 

You can use any extension you want. As long as the StripesDispatcher is configured to handle URL ending with epub or that you use DynamicMappingFilter with an ActionBean annotated like @UrlBinding(“someurl/abc.epub”).

I successfully generate some PNGs dynamically through an ActionBean.

 

Christian

 

De : Heather and Jon Turgeon [[hidden email]]
Envoyé : May-05-15 8:51 AM
À : [hidden email]
Objet : [Stripes-users] Action with an epub resolution

 

Hello all, I have a web app that generates an epub from information stored in a database. I have an action that creates the book and then sends it back to the client as an epub. This works great in Windows/Linux and Android but is less than great on my iPad. Since the link on the page that calls the epub code ends in .action the iPad does not know which app to use to open the book. Is there some way in Struts to call an action using a link that ends with .epub? Something like www.somewebsite.com/newbook.epub that would call a Stripes action which could then pass back a book named differentBookName.ebub (my site can create multiple books depending on user content).

Jon


------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users
Reply | Threaded
Open this post in threaded view
|

Re: Action with an epub resolution

VANKEISBELCK Remi
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

I don't think you have to use a given extension.

Do you specify the appropriate content-type ?

You can set the appropriate content-type via StreamingResolution's
ctor arg :
http://stripes.sourceforge.net/docs/current/javadoc/net/sourceforge/stri
pes/action/StreamingResolution.html

Stuff like :
return new StreamingResolution('application/epub', ePubInputStream)
?

Using the extension in the URL is probably prettier, but I think it's
just a fallback that browsers use to associate the content with an
app, when content-type ain't specified.

Cheers

Rémi

On 05/05/15 15:40, Poitras Christian wrote:

> Hi,
>
>
>
> You can use any extension you want. As long as the
> StripesDispatcher is configured to handle URL ending with epub or
> that you use DynamicMappingFilter with an ActionBean annotated
> like @UrlBinding(“someurl/abc.epub”).
>
> I successfully generate some PNGs dynamically through an
> ActionBean.
>
>
>
> Christian
>
>
>
> *De :*Heather and Jon Turgeon
> [mailto:[hidden email]] *Envoyé :* May-05-15 8:51
> AM *À :* [hidden email]
> <mailto:[hidden email]> *Objet :*
> [Stripes-users] Action with an epub resolution
>
>
>
> Hello all, I have a web app that generates an epub from
> information stored in a database. I have an action that creates the
> book and then sends it back to the client as an epub. This works
> great in Windows/Linux and Android but is less than great on my
> iPad. Since the link on the page that calls the epub code ends in
> .action the iPad does not know which app to use to open the book.
> Is there some way in Struts to call an action using a link that
> ends with .epub? Something like www.somewebsite.com/newbook.epub
> that would call a Stripes action which could then pass back a book
> named differentBookName.ebub (my site can create multiple books
> depending on user content).
>
> Jon
>
>
>
> ----------------------------------------------------------------------
- --------
>
>
One dashboard for servers and applications across Physical-Virtual-Cloud

> Widest out-of-the-box monitoring support with 50+ applications
> Performance metrics, stats and reports that give you Actionable
> Insights Deep dive visibility with transaction tracing using APM
> Insight. http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
>
>
>
> _______________________________________________ Stripes-users
> mailing list [hidden email]
> https://lists.sourceforge.net/lists/listinfo/stripes-users
>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.22 (Darwin)
Comment: GPGTools - http://gpgtools.org

iQEcBAEBAgAGBQJVTJHsAAoJEG/h6Wgx2lCmZ4kH/0EMzFVe546EiwI3jGotSiRv
eDYq7hAB8WIyTv59kMFzmKMuejIeQEtH+FWfApiXfpO0RZN/x/sXcoJCLCWI7VJ3
DZvUHrDn6jLwGhTeDj5MZoRBDoHtsxIp3Wu2h9wOSB7VZ1L+xP03A+J3HyTIb99/
i6zddgkgIRp/KlKmgOezEdgPfIQTpMqnEAGc08mDPB6tdzYBbDeolCSE3o17yn/A
D1jU93i8RtlA2DOLappAz0AbCq6SJ9JndBWk9ua59BiypuOtWyn1fHBJtWW5XuSP
n35QKx/1bpSI+35OM1kl9H+8bKUWONCKEYLYjZ5mLP2yS8GVOzejGwejDfl0lvw=
=pBMR
-----END PGP SIGNATURE-----

------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users